增加 user 端的商品分类接口
增加 user 端的商品 spu 接口
This commit is contained in:
@@ -6,15 +6,18 @@ import cn.iocoder.mall.product.api.ProductAttrService;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrPageBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductAttrAddDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductAttrPageDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductAttrUpdateDTO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrValueBO;
|
||||
import cn.iocoder.mall.product.api.dto.*;
|
||||
import cn.iocoder.mall.product.application.convert.ProductAttrConvert;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO;
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,6 +31,7 @@ public class AdminsProductAttrController {
|
||||
private ProductAttrService productAttrService;
|
||||
|
||||
@GetMapping("/attr/page")
|
||||
@ApiOperation("获得规格分页")
|
||||
public CommonResult<AdminsProductAttrPageVO> attrPage(@RequestParam(value = "name", required = false) String name,
|
||||
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
@@ -40,6 +44,7 @@ public class AdminsProductAttrController {
|
||||
}
|
||||
|
||||
@GetMapping("/attr/tree")
|
||||
@ApiOperation(value = "获得规格树结构", notes = "该接口返回的信息更为精简。一般用于前端缓存数据字典到本地。")
|
||||
public CommonResult<List<AdminsProductAttrSimpleVO>> tree() {
|
||||
// 查询全列表
|
||||
CommonResult<List<ProductAttrSimpleBO>> result = productAttrService.getProductAttrList();
|
||||
@@ -48,6 +53,10 @@ public class AdminsProductAttrController {
|
||||
}
|
||||
|
||||
@PostMapping("/attr/add")
|
||||
@ApiOperation(value = "创建商品规格")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "规格名", required = true, example = "颜色")
|
||||
})
|
||||
public CommonResult<AdminsProductAttrVO> addAttr(@RequestParam("name") String name) {
|
||||
// 创建 ProductAttrAddDTO 对象
|
||||
ProductAttrAddDTO productAttrAddDTO = new ProductAttrAddDTO().setName(name);
|
||||
@@ -58,6 +67,11 @@ public class AdminsProductAttrController {
|
||||
}
|
||||
|
||||
@PostMapping("/attr/update")
|
||||
@ApiOperation(value = "修改商品规格")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "规格编号", required = true, example = "1"),
|
||||
@ApiImplicitParam(name = "name", value = "规格名", required = true, example = "颜色")
|
||||
})
|
||||
public CommonResult<Boolean> updateAttr(@RequestParam("id") Integer id,
|
||||
@RequestParam("name") String name) {
|
||||
// 创建 ProductAttrUpdateDTO 对象
|
||||
@@ -67,6 +81,11 @@ public class AdminsProductAttrController {
|
||||
}
|
||||
|
||||
@PostMapping("/attr/update_status")
|
||||
@ApiOperation(value = "修改商品规格状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "规格编号", required = true, example = "100"),
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true, example = "1")
|
||||
})
|
||||
public CommonResult<Boolean> updateAttrStatus(@RequestParam("id") Integer id,
|
||||
@RequestParam("status") Integer status) {
|
||||
return productAttrService.updateProductAttrStatus(AdminSecurityContextHolder.getContext().getAdminId(), id, status);
|
||||
@@ -75,18 +94,43 @@ public class AdminsProductAttrController {
|
||||
// TODO 芋艿 暂时不考虑 delete Attr 。因为关联逻辑比较多
|
||||
|
||||
@PostMapping("/attr_value/add")
|
||||
public CommonResult addAttrValue() {
|
||||
return null;
|
||||
@ApiOperation(value = "创建商品规格值")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "attrId", value = "规格编号", required = true, example = "100"),
|
||||
@ApiImplicitParam(name = "name", value = "规格值", required = true, example = "蓝色")
|
||||
})
|
||||
public CommonResult<AdminsProductAttrValueVO> addAttrValue(@RequestParam("attrId") Integer attrId,
|
||||
@RequestParam("name") String name) {
|
||||
// 创建 ProductAttrValueAddDTO 对象
|
||||
ProductAttrValueAddDTO productAttrValueAddDTO = new ProductAttrValueAddDTO().setAttrId(attrId).setName(name);
|
||||
// 添加
|
||||
CommonResult<ProductAttrValueBO> result = productAttrService.addProductAttrValue(AdminSecurityContextHolder.getContext().getAdminId(), productAttrValueAddDTO);
|
||||
// 返回结果
|
||||
return ProductAttrConvert.INSTANCE.convert4(result);
|
||||
}
|
||||
|
||||
@PostMapping("/attr_value/update")
|
||||
public CommonResult<Boolean> updateAttrValue() {
|
||||
return null;
|
||||
@ApiOperation(value = "修改商品规格值")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "规格值编号", required = true, example = "100"),
|
||||
@ApiImplicitParam(name = "name", value = "规格值", required = true, example = "蓝色")
|
||||
})
|
||||
public CommonResult<Boolean> updateAttrValue(@RequestParam("id") Integer id,
|
||||
@RequestParam("name") String name) {
|
||||
// 创建 ProductAttrValueUpdateDTO 对象
|
||||
ProductAttrValueUpdateDTO productAttrValueUpdateDTO = new ProductAttrValueUpdateDTO().setId(id).setName(name);
|
||||
// 更新
|
||||
return productAttrService.updateProductAttrValue(AdminSecurityContextHolder.getContext().getAdminId(), productAttrValueUpdateDTO);
|
||||
}
|
||||
|
||||
@PostMapping("/attr_value/update_status")
|
||||
public CommonResult<Boolean> updateAttrValueStatus() {
|
||||
return null;
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "规格编号", required = true, example = "100"),
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true, example = "1")
|
||||
})
|
||||
public CommonResult<Boolean> updateAttrValueStatus(@RequestParam("id") Integer id,
|
||||
@RequestParam("status") Integer status) {
|
||||
return productAttrService.updateProductAttrValueStatus(AdminSecurityContextHolder.getContext().getAdminId(), id, status);
|
||||
}
|
||||
|
||||
// TODO 芋艿 暂时不考虑 delete Attr Value 。因为关联逻辑比较多
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package cn.iocoder.mall.product.application.controller.users;
|
||||
|
||||
import cn.iocoder.mall.product.api.ProductSpuService;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
||||
import cn.iocoder.mall.product.application.vo.ProductSpuListVO;
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("user/product/spu")
|
||||
public class ProductSpuController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
private ProductSpuService productSpuService;
|
||||
|
||||
// TODO 详情
|
||||
@GetMapping("/info")
|
||||
public ProductSpuBO info(@RequestParam("id") Integer id) {
|
||||
// return productSpuService.getProductSpu(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO 分页
|
||||
@GetMapping("/list")
|
||||
public ProductSpuListVO list() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
@RestController("productCategoryController_users")
|
||||
@RequestMapping("users/product/category")
|
||||
@Api("商品分类")
|
||||
public class ProductCategoryController {
|
||||
public class UsersProductCategoryController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
private ProductCategoryService productCategoryService;
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.mall.product.application.controller.users;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.product.api.ProductSpuService;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuPageBO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductSpuPageDTO;
|
||||
import cn.iocoder.mall.product.application.convert.ProductSpuConvert;
|
||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuDetailVO;
|
||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuPageVO;
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("users/spu")
|
||||
@Api("商品 SPU + SKU")
|
||||
public class UsersProductSpuController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
private ProductSpuService productSpuService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@ApiOperation("商品 SPU 明细")
|
||||
@ApiImplicitParam(name = "id", value = "SPU 编号", required = true, example = "100")
|
||||
public CommonResult<UsersProductSpuDetailVO> info(@RequestParam("id") Integer id) {
|
||||
return ProductSpuConvert.INSTANCE.convert4(productSpuService.getProductSpu(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("商品 SPU 分页列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "cid", value = "分类编号", example = "1"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码,从 0 开始", example = "0"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, example = "10"),
|
||||
})
|
||||
public CommonResult<UsersProductSpuPageVO> page(@RequestParam(value = "cid", required = false) Integer cid,
|
||||
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
// 创建 ProductSpuPageDTO 对象
|
||||
ProductSpuPageDTO productSpuPageDTO = new ProductSpuPageDTO().setCid(cid).setVisible(true)
|
||||
.setPageNo(pageNo).setPageSize(pageSize);
|
||||
// 查询分页
|
||||
CommonResult<ProductSpuPageBO> result = productSpuService.getProductSpuPage(productSpuPageDTO);
|
||||
// 返回结果
|
||||
return ProductSpuConvert.INSTANCE.convert3(result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,9 +4,11 @@ import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrPageBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductAttrValueBO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -30,4 +32,7 @@ public interface ProductAttrConvert {
|
||||
@Mappings({})
|
||||
CommonResult<AdminsProductAttrVO> convert3(CommonResult<ProductAttrBO> productAttrBO);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<AdminsProductAttrValueVO> convert4(CommonResult<ProductAttrValueBO> productAttrValueBO);
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuPageBO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO;
|
||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO;
|
||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuDetailVO;
|
||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuPageVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -23,4 +25,10 @@ public interface ProductSpuConvert {
|
||||
@Mappings({})
|
||||
CommonResult<AdminsProductSpuPageVO> convert2(CommonResult<ProductSpuPageBO> result);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<UsersProductSpuPageVO> convert3(CommonResult<ProductSpuPageBO> result);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<UsersProductSpuDetailVO> convert4(CommonResult<ProductSpuDetailBO> result);
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package cn.iocoder.mall.product.application.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProductSpuListVO {
|
||||
|
||||
/**
|
||||
* SPU 数组
|
||||
*/
|
||||
private List<ProductSpuVO> list;
|
||||
/**
|
||||
* 是否还有下一页
|
||||
*/
|
||||
private Boolean hasNext;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package cn.iocoder.mall.product.application.vo;
|
||||
|
||||
public class ProductSpuVO {
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.mall.product.application.vo.admins;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel(value = "商品规格值 VO")
|
||||
public class AdminsProductAttrValueVO {
|
||||
|
||||
@ApiModelProperty(value = "规格值编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "规格编号", required = true, example = "1")
|
||||
private Integer attrId;
|
||||
@ApiModelProperty(value = "规格名", required = true, example = "颜色")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1")
|
||||
private Integer status;
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳")
|
||||
private Date createTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public AdminsProductAttrValueVO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public AdminsProductAttrValueVO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public AdminsProductAttrValueVO setStatus(Integer status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public AdminsProductAttrValueVO setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getAttrId() {
|
||||
return attrId;
|
||||
}
|
||||
|
||||
public AdminsProductAttrValueVO setAttrId(Integer attrId) {
|
||||
this.attrId = attrId;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,6 @@ public class AdminsProductSkuDetailVO {
|
||||
@ApiModelProperty(value = "库存数量", required = true, example = "100")
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.mall.product.application.vo.users;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel(value = "商品规格属性和值对 VO")
|
||||
public class UsersProductAttrAndValuePairVO {
|
||||
|
||||
@ApiModelProperty(value = "规格编号", required = true, example = "1")
|
||||
private Integer attrId;
|
||||
@ApiModelProperty(value = "规格名", required = true, example = "颜色")
|
||||
private String attrName;
|
||||
@ApiModelProperty(value = "规格值", required = true, example = "10")
|
||||
private Integer attrValueId;
|
||||
@ApiModelProperty(value = "规格值名", required = true, example = "红色")
|
||||
private String attrValueName;
|
||||
|
||||
public Integer getAttrId() {
|
||||
return attrId;
|
||||
}
|
||||
|
||||
public UsersProductAttrAndValuePairVO setAttrId(Integer attrId) {
|
||||
this.attrId = attrId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAttrName() {
|
||||
return attrName;
|
||||
}
|
||||
|
||||
public UsersProductAttrAndValuePairVO setAttrName(String attrName) {
|
||||
this.attrName = attrName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getAttrValueId() {
|
||||
return attrValueId;
|
||||
}
|
||||
|
||||
public UsersProductAttrAndValuePairVO setAttrValueId(Integer attrValueId) {
|
||||
this.attrValueId = attrValueId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAttrValueName() {
|
||||
return attrValueName;
|
||||
}
|
||||
|
||||
public UsersProductAttrAndValuePairVO setAttrValueName(String attrValueName) {
|
||||
this.attrValueName = attrValueName;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.iocoder.mall.product.application.vo.users;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品 Sku 明细 BO
|
||||
*/
|
||||
public class UsersProductSkuDetailVO {
|
||||
|
||||
@ApiModelProperty(value = "sku 编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "SPU 编号", required = true, example = "1")
|
||||
private Integer spuId;
|
||||
@ApiModelProperty(value = "图片地址", required = true, example = "http://www.iocoder.cn")
|
||||
private String picURL;
|
||||
@ApiModelProperty(value = "规格值数组", required = true)
|
||||
private List<UsersProductAttrAndValuePairVO> attrs;
|
||||
@ApiModelProperty(value = "价格,单位:分", required = true, example = "100")
|
||||
private Integer price;
|
||||
@ApiModelProperty(value = "库存数量", required = true, example = "100")
|
||||
private Integer quantity;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSpuId() {
|
||||
return spuId;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setSpuId(Integer spuId) {
|
||||
this.spuId = spuId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPicURL() {
|
||||
return picURL;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setPicURL(String picURL) {
|
||||
this.picURL = picURL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<UsersProductAttrAndValuePairVO> getAttrs() {
|
||||
return attrs;
|
||||
}
|
||||
|
||||
public UsersProductSkuDetailVO setAttrs(List<UsersProductAttrAndValuePairVO> attrs) {
|
||||
this.attrs = attrs;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.mall.product.application.vo.users;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "商品 SPU 详细 VO", description = "包括 SKU 信息 VO")
|
||||
public class UsersProductSpuDetailVO {
|
||||
|
||||
@ApiModelProperty(value = "SPU 编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
|
||||
// ========== 基本信息 =========
|
||||
@ApiModelProperty(value = "SPU 名字", required = true, example = "厮大牛逼")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "卖点", required = true, example = "各种 MQ 骚操作")
|
||||
private String sellPoint;
|
||||
@ApiModelProperty(value = "描述", required = true, example = "你就说强不强")
|
||||
private String description;
|
||||
@ApiModelProperty(value = "分类编号", required = true, example = "反正我是信了")
|
||||
private Integer cid;
|
||||
@ApiModelProperty(value = "商品主图地址的数组", required = true, example = "http://www.iocoder.cn")
|
||||
private List<String> picUrls;
|
||||
|
||||
// ========== SKU =========
|
||||
|
||||
/**
|
||||
* SKU 数组
|
||||
*/
|
||||
private List<UsersProductSkuDetailVO> skus;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSellPoint() {
|
||||
return sellPoint;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setSellPoint(String sellPoint) {
|
||||
this.sellPoint = sellPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPicUrls() {
|
||||
return picUrls;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setPicUrls(List<String> picUrls) {
|
||||
this.picUrls = picUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<UsersProductSkuDetailVO> getSkus() {
|
||||
return skus;
|
||||
}
|
||||
|
||||
public UsersProductSpuDetailVO setSkus(List<UsersProductSkuDetailVO> skus) {
|
||||
this.skus = skus;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.mall.product.application.vo.users;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("商品 SPU 分页 VO")
|
||||
public class UsersProductSpuPageVO {
|
||||
|
||||
@ApiModelProperty(value = "spu 数组", required = true)
|
||||
private List<UsersProductSpuVO> spus;
|
||||
@ApiModelProperty(value = "总数", required = true)
|
||||
private Integer count;
|
||||
|
||||
public List<UsersProductSpuVO> getSpus() {
|
||||
return spus;
|
||||
}
|
||||
|
||||
public UsersProductSpuPageVO setSpus(List<UsersProductSpuVO> spus) {
|
||||
this.spus = spus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public UsersProductSpuPageVO setCount(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.iocoder.mall.product.application.vo.users;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "商品 SPU VO", description = "不包括 SKU 信息 VO")
|
||||
public class UsersProductSpuVO {
|
||||
|
||||
@ApiModelProperty(value = "SPU 编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
|
||||
// ========== 基本信息 =========
|
||||
@ApiModelProperty(value = "SPU 名字", required = true, example = "厮大牛逼")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "卖点", required = true, example = "各种 MQ 骚操作")
|
||||
private String sellPoint;
|
||||
@ApiModelProperty(value = "分类编号", required = true, example = "反正我是信了")
|
||||
private Integer cid;
|
||||
@ApiModelProperty(value = "商品主图地址的数组", required = true, example = "http://www.iocoder.cn")
|
||||
private List<String> picUrls;
|
||||
|
||||
// ========== Sku 相关字段 =========
|
||||
/**
|
||||
* 价格
|
||||
*
|
||||
* 目前的计算方式是,以 Sku 最小价格为准
|
||||
*/
|
||||
private Integer price;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSellPoint() {
|
||||
return sellPoint;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setSellPoint(String sellPoint) {
|
||||
this.sellPoint = sellPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPicUrls() {
|
||||
return picUrls;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setPicUrls(List<String> picUrls) {
|
||||
this.picUrls = picUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public UsersProductSpuVO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user