feat:
1. modify product-list and product-detail
This commit is contained in:
@@ -4,9 +4,11 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||
import org.springblade.modules.mall.service.IMallProductService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -31,4 +33,14 @@ public class APPMallController {
|
||||
return R.data(mallProductService.apiVoList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "详情", description = "传入vo")
|
||||
public R<MallProductDetailApiVO> detail(@Valid MallProductDetailApiVO vo) {
|
||||
return R.data(mallProductService.apiDetailVO(vo.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,18 +11,14 @@ public class MallProductApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String serialNumber;
|
||||
|
||||
private String productName;
|
||||
|
||||
private List<String> mainImageUrls;
|
||||
|
||||
private List<String> detailImageUrls;
|
||||
|
||||
private String thumbImageUrl;
|
||||
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
private Integer sales;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class MallProductDetailApiVO implements Serializable {
|
||||
|
||||
@NotNull(message = "无效商品")
|
||||
private Long id;
|
||||
|
||||
private String serialNumber;
|
||||
|
||||
private String productName;
|
||||
|
||||
private List<String> mainImageUrls;
|
||||
|
||||
private List<String> detailImageUrls;
|
||||
|
||||
private String thumbImageUrl;
|
||||
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
private Integer sales;
|
||||
|
||||
private Integer stock;
|
||||
|
||||
private List<MallProductEntity.Spec> specs;
|
||||
|
||||
private List<String> tags;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user