Commit d98327cb by HuAnYing

商品相关dto

parent d3b47235
package com.jomalls.custom.app.dto.product; package com.jomalls.custom.app.dto.product;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.jomalls.custom.page.PageRequest;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Digits; import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import org.aspectj.bridge.IMessage;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
...@@ -24,7 +22,7 @@ import java.util.List; ...@@ -24,7 +22,7 @@ import java.util.List;
* @date 2026-06-02 19:07:12 * @date 2026-06-02 19:07:12
*/ */
@Data @Data
public class CustomProductInfoDto implements Serializable { public class CustomProductInfoDto extends PageRequest implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -65,7 +63,7 @@ public class CustomProductInfoDto implements Serializable { ...@@ -65,7 +63,7 @@ public class CustomProductInfoDto implements Serializable {
*/ */
@Schema(description = "商品类别ID", example = "") @Schema(description = "商品类别ID", example = "")
@NotBlank(message = "商品类别不能为空") @NotBlank(message = "商品类别不能为空")
private Integer categoryId; private Integer category_id;
/** /**
* 重量kg * 重量kg
...@@ -250,8 +248,8 @@ public class CustomProductInfoDto implements Serializable { ...@@ -250,8 +248,8 @@ public class CustomProductInfoDto implements Serializable {
@Schema(description = "模型ID", example = "") @Schema(description = "模型ID", example = "")
private Integer diyId; private Integer diyId;
// @Schema(description = "商品明细", implementation = ProductChangeDTO.class) @Schema(description = "商品明细", implementation = ProductChangeDto.class)
// private ProductChangeDTO productChange; private ProductChangeDto productChange;
@Schema(description = "商品明细", implementation = CustomProductItemDto.class) @Schema(description = "商品明细", implementation = CustomProductItemDto.class)
private List<CustomProductItemDto> productList; private List<CustomProductItemDto> productList;
......
...@@ -21,7 +21,7 @@ import java.util.Date; ...@@ -21,7 +21,7 @@ import java.util.Date;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Schema(description = "VO") @Schema(description = "skuItem Dto")
public class CustomProductItemDto implements Serializable { public class CustomProductItemDto implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.jomalls.custom.app.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "商品变更Dto")
public class ProductChangeDto implements Serializable {
@Schema(description = "添加集合", implementation = CustomProductItemDto.class)
private List<CustomProductItemDto> addList;
@Schema(description = "修改集合", implementation = CustomProductItemDto.class)
private List<CustomProductItemDto> updateList;
@Schema(description = "删除集合", implementation = Integer.class)
private List<Integer> removeList;
}
package com.jomalls.custom.app.service; package com.jomalls.custom.app.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.dto.product.CustomProductInfoDto;
import com.jomalls.custom.app.vo.CustomProductInfoPageVO; import com.jomalls.custom.app.vo.CustomProductInfoPageVO;
import com.jomalls.custom.app.vo.CustomProductInfoVO; import com.jomalls.custom.app.vo.CustomProductInfoVO;
...@@ -25,10 +26,10 @@ public interface CustomProductInfoService { ...@@ -25,10 +26,10 @@ public interface CustomProductInfoService {
/** /**
* 根据条件查询分页列表接口 * 根据条件查询分页列表接口
* *
* @param customProductInfoPageVO 分页入参model * @param CustomProductInfoDto 分页入参model
* @return 分页对象 * @return 分页对象
*/ */
IPage<CustomProductInfoVO> pageList(CustomProductInfoPageVO customProductInfoPageVO); IPage<CustomProductInfoVO> pageList(CustomProductInfoDto param);
/** /**
* 根据id查询详情 * 根据id查询详情
......
...@@ -2,6 +2,7 @@ package com.jomalls.custom.app.service.impl; ...@@ -2,6 +2,7 @@ package com.jomalls.custom.app.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.dto.product.CustomProductInfoDto;
import com.jomalls.custom.app.exception.ServiceException; import com.jomalls.custom.app.exception.ServiceException;
import com.jomalls.custom.app.vo.CustomProductInfoPageVO; import com.jomalls.custom.app.vo.CustomProductInfoPageVO;
import com.jomalls.custom.app.vo.CustomProductInfoVO; import com.jomalls.custom.app.vo.CustomProductInfoVO;
...@@ -45,11 +46,11 @@ public class CustomProductInfoServiceImpl implements CustomProductInfoService { ...@@ -45,11 +46,11 @@ public class CustomProductInfoServiceImpl implements CustomProductInfoService {
} }
@Override @Override
public IPage<CustomProductInfoVO> pageList(CustomProductInfoPageVO customProductInfoPageVO) { public IPage<CustomProductInfoVO> pageList(CustomProductInfoDto param) {
CustomAsserts.nonNull(customProductInfoPageVO, "分页查询参数不能为空"); CustomAsserts.nonNull(param, "分页查询参数不能为空");
QueryWrapper<CustomProductInfoEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<CustomProductInfoEntity> queryWrapper = new QueryWrapper<>();
// TODO 根据业务条件组装入参 // TODO 根据业务条件组装入参
IPage<CustomProductInfoEntity> page = customProductInfoDomainService.selectPage(queryWrapper, customProductInfoPageVO); IPage<CustomProductInfoEntity> page = customProductInfoDomainService.selectPage(queryWrapper, param);
return page.convert(e -> BeanMapper.mapper().convert(e, CustomProductInfoVO.class)); return page.convert(e -> BeanMapper.mapper().convert(e, CustomProductInfoVO.class));
} }
......
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
@Slf4j @Slf4j
@RestController @RestController
@Tag(name = "/customProductInfo", description = "Controller") @Tag(name = "/customProductInfo", description = "Controller")
@RequestMapping("/customProductInfo") @RequestMapping("/api/product/info")
public class CustomProductInfoController { public class CustomProductInfoController {
@Autowired @Autowired
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment