refactor: springdoc 替换 springfox
This commit is contained in:
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
|
||||
import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
import cn.iocoder.yudao.module.product.service.brand.ProductBrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 商品品牌")
|
||||
@Tag(name = "管理后台 - 商品品牌")
|
||||
@RestController
|
||||
@RequestMapping("/product/brand")
|
||||
@Validated
|
||||
@@ -30,14 +30,14 @@ public class ProductBrandController {
|
||||
private ProductBrandService brandService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建品牌")
|
||||
@Operation(summary = "创建品牌")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:create')")
|
||||
public CommonResult<Long> createBrand(@Valid @RequestBody ProductBrandCreateReqVO createReqVO) {
|
||||
return success(brandService.createBrand(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新品牌")
|
||||
@Operation(summary = "更新品牌")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:update')")
|
||||
public CommonResult<Boolean> updateBrand(@Valid @RequestBody ProductBrandUpdateReqVO updateReqVO) {
|
||||
brandService.updateBrand(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class ProductBrandController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除品牌")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除品牌")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:delete')")
|
||||
public CommonResult<Boolean> deleteBrand(@RequestParam("id") Long id) {
|
||||
brandService.deleteBrand(id);
|
||||
@@ -54,8 +54,8 @@ public class ProductBrandController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得品牌")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得品牌")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:query')")
|
||||
public CommonResult<ProductBrandRespVO> getBrand(@RequestParam("id") Long id) {
|
||||
ProductBrandDO brand = brandService.getBrand(id);
|
||||
@@ -63,7 +63,7 @@ public class ProductBrandController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得品牌分页")
|
||||
@Operation(summary = "获得品牌分页")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:query')")
|
||||
public CommonResult<PageResult<ProductBrandRespVO>> getBrandPage(@Valid ProductBrandPageReqVO pageVO) {
|
||||
PageResult<ProductBrandDO> pageResult = brandService.getBrandPage(pageVO);
|
||||
@@ -71,7 +71,7 @@ public class ProductBrandController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得品牌列表")
|
||||
@Operation(summary = "获得品牌列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:query')")
|
||||
public CommonResult<List<ProductBrandRespVO>> getBrandList(@Valid ProductBrandListReqVO listVO) {
|
||||
List<ProductBrandDO> list = brandService.getBrandList(listVO);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -12,22 +11,22 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ProductBrandBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "品牌名称", required = true, example = "芋道")
|
||||
@Schema(title = "品牌名称", required = true, example = "芋道")
|
||||
@NotNull(message = "品牌名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "品牌图片", required = true)
|
||||
@Schema(title = "品牌图片", required = true)
|
||||
@NotNull(message = "品牌图片不能为空")
|
||||
private String picUrl;
|
||||
|
||||
@ApiModelProperty(value = "品牌排序", required = true, example = "1")
|
||||
@Schema(title = "品牌排序", required = true, example = "1")
|
||||
@NotNull(message = "品牌排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "品牌描述", example = "描述")
|
||||
@Schema(title = "品牌描述", example = "描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "0")
|
||||
@Schema(title = "状态", required = true, example = "0")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 商品品牌创建 Request VO")
|
||||
@Schema(title = "管理后台 - 商品品牌创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,14 +1,13 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品品牌分页 Request VO")
|
||||
@Schema(title = "管理后台 - 商品品牌分页 Request VO")
|
||||
@Data
|
||||
public class ProductBrandListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "品牌名称", example = "芋道")
|
||||
@Schema(title = "品牌名称", example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,20 +11,20 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 商品品牌分页 Request VO")
|
||||
@Schema(title = "管理后台 - 商品品牌分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductBrandPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "品牌名称", example = "芋道")
|
||||
@Schema(title = "品牌名称", example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", example = "0", notes = "参考 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", example = "0", description = "参考 CommonStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 品牌 Response VO")
|
||||
@Schema(title = "管理后台 - 品牌 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductBrandRespVO extends ProductBrandBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "品牌编号", required = true, example = "1")
|
||||
@Schema(title = "品牌编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 商品品牌更新 Request VO")
|
||||
@Schema(title = "管理后台 - 商品品牌更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductBrandUpdateReqVO extends ProductBrandBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "品牌编号", required = true, example = "1")
|
||||
@Schema(title = "品牌编号", required = true, example = "1")
|
||||
@NotNull(message = "品牌编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCateg
|
||||
import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
|
||||
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 商品分类")
|
||||
@Tag(name = "管理后台 - 商品分类")
|
||||
@RestController
|
||||
@RequestMapping("/product/category")
|
||||
@Validated
|
||||
@@ -32,14 +32,14 @@ public class ProductCategoryController {
|
||||
private ProductCategoryService categoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建商品分类")
|
||||
@Operation(summary = "创建商品分类")
|
||||
@PreAuthorize("@ss.hasPermission('product:category:create')")
|
||||
public CommonResult<Long> createCategory(@Valid @RequestBody ProductCategoryCreateReqVO createReqVO) {
|
||||
return success(categoryService.createCategory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新商品分类")
|
||||
@Operation(summary = "更新商品分类")
|
||||
@PreAuthorize("@ss.hasPermission('product:category:update')")
|
||||
public CommonResult<Boolean> updateCategory(@Valid @RequestBody ProductCategoryUpdateReqVO updateReqVO) {
|
||||
categoryService.updateCategory(updateReqVO);
|
||||
@@ -47,8 +47,8 @@ public class ProductCategoryController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除商品分类")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除商品分类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('product:category:delete')")
|
||||
public CommonResult<Boolean> deleteCategory(@RequestParam("id") Long id) {
|
||||
categoryService.deleteCategory(id);
|
||||
@@ -56,8 +56,8 @@ public class ProductCategoryController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得商品分类")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得商品分类")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:category:query')")
|
||||
public CommonResult<ProductCategoryRespVO> getCategory(@RequestParam("id") Long id) {
|
||||
ProductCategoryDO category = categoryService.getCategory(id);
|
||||
@@ -65,7 +65,7 @@ public class ProductCategoryController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得商品分类列表")
|
||||
@Operation(summary = "获得商品分类列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:category:query')")
|
||||
public CommonResult<List<ProductCategoryRespVO>> getCategoryList(@Valid ProductCategoryListReqVO treeListReqVO) {
|
||||
List<ProductCategoryDO> list = categoryService.getEnableCategoryList(treeListReqVO);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.category.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -13,25 +12,25 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ProductCategoryBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "父分类编号", required = true, example = "1")
|
||||
@Schema(title = "父分类编号", required = true, example = "1")
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "分类名称", required = true, example = "办公文具")
|
||||
@Schema(title = "分类名称", required = true, example = "办公文具")
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "分类图片", required = true)
|
||||
@Schema(title = "分类图片", required = true)
|
||||
@NotBlank(message = "分类图片不能为空")
|
||||
private String picUrl;
|
||||
|
||||
@ApiModelProperty(value = "分类排序", required = true, example = "1")
|
||||
@Schema(title = "分类排序", required = true, example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "分类描述", required = true, example = "描述")
|
||||
@Schema(title = "分类描述", required = true, example = "描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "开启状态", required = true, example = "0")
|
||||
@Schema(title = "开启状态", required = true, example = "0")
|
||||
@NotNull(message = "开启状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.category.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 商品分类创建 Request VO")
|
||||
@Schema(title = "管理后台 - 商品分类创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,14 +1,13 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.category.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品分类列表查询 Request VO")
|
||||
@Schema(title = "管理后台 - 商品分类列表查询 Request VO")
|
||||
@Data
|
||||
public class ProductCategoryListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "分类名称", example = "办公文具")
|
||||
@Schema(title = "分类名称", example = "办公文具")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.category.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 商品分类 Response VO")
|
||||
@Schema(title = "管理后台 - 商品分类 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductCategoryRespVO extends ProductCategoryBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "分类编号", required = true, example = "2")
|
||||
@Schema(title = "分类编号", required = true, example = "2")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.category.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 商品分类更新 Request VO")
|
||||
@Schema(title = "管理后台 - 商品分类更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductCategoryUpdateReqVO extends ProductCategoryBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "分类编号", required = true, example = "2")
|
||||
@Schema(title = "分类编号", required = true, example = "2")
|
||||
@NotNull(message = "分类编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*;
|
||||
import cn.iocoder.yudao.module.product.service.property.ProductPropertyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 规格名称")
|
||||
@Tag(name = "管理后台 - 规格名称")
|
||||
@RestController
|
||||
@RequestMapping("/product/property")
|
||||
@Validated
|
||||
@@ -28,14 +28,14 @@ public class ProductPropertyController {
|
||||
private ProductPropertyService productPropertyService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建规格名称")
|
||||
@Operation(summary = "创建规格名称")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:create')")
|
||||
public CommonResult<Long> createProperty(@Valid @RequestBody ProductPropertyCreateReqVO createReqVO) {
|
||||
return success(productPropertyService.createProperty(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新规格名称")
|
||||
@Operation(summary = "更新规格名称")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:update')")
|
||||
public CommonResult<Boolean> updateProperty(@Valid @RequestBody ProductPropertyUpdateReqVO updateReqVO) {
|
||||
productPropertyService.updateProperty(updateReqVO);
|
||||
@@ -43,8 +43,8 @@ public class ProductPropertyController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除规格名称")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除规格名称")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('product:property:delete')")
|
||||
public CommonResult<Boolean> deleteProperty(@RequestParam("id") Long id) {
|
||||
productPropertyService.deleteProperty(id);
|
||||
@@ -52,29 +52,29 @@ public class ProductPropertyController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得规格名称")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得规格名称")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<ProductPropertyRespVO> getProperty(@RequestParam("id") Long id) {
|
||||
return success(productPropertyService.getProperty(id));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得规格名称列表")
|
||||
@Operation(summary = "获得规格名称列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<List<ProductPropertyRespVO>> getPropertyList(@Valid ProductPropertyListReqVO listReqVO) {
|
||||
return success(productPropertyService.getPropertyList(listReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得规格名称分页")
|
||||
@Operation(summary = "获得规格名称分页")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<PageResult<ProductPropertyRespVO>> getPropertyPage(@Valid ProductPropertyPageReqVO pageVO) {
|
||||
return success(productPropertyService.getPropertyPage(pageVO));
|
||||
}
|
||||
|
||||
@GetMapping("/listAndValue")
|
||||
@ApiOperation("获得规格名称列表")
|
||||
@Operation(summary = "获得规格名称列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<List<ProductPropertyAndValueRespVO>> getPropertyAndValueList(@Valid ProductPropertyListReqVO listReqVO) {
|
||||
return success(productPropertyService.getPropertyAndValueList(listReqVO));
|
||||
|
@@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.Produc
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,7 +20,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 规格值名称")
|
||||
@Tag(name = "管理后台 - 规格值名称")
|
||||
@RestController
|
||||
@RequestMapping("/product/property/value")
|
||||
@Validated
|
||||
@@ -30,14 +30,14 @@ public class ProductPropertyValueController {
|
||||
private ProductPropertyValueService productPropertyValueService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建规格名称")
|
||||
@Operation(summary = "创建规格名称")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:create')")
|
||||
public CommonResult<Long> createProperty(@Valid @RequestBody ProductPropertyValueCreateReqVO createReqVO) {
|
||||
return success(productPropertyValueService.createPropertyValue(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新规格名称")
|
||||
@Operation(summary = "更新规格名称")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:update')")
|
||||
public CommonResult<Boolean> updateProperty(@Valid @RequestBody ProductPropertyValueUpdateReqVO updateReqVO) {
|
||||
productPropertyValueService.updatePropertyValue(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class ProductPropertyValueController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除规格名称")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除规格名称")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('product:property:delete')")
|
||||
public CommonResult<Boolean> deleteProperty(@RequestParam("id") Long id) {
|
||||
productPropertyValueService.deletePropertyValue(id);
|
||||
@@ -54,15 +54,15 @@ public class ProductPropertyValueController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得规格名称")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得规格名称")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<ProductPropertyValueRespVO> getProperty(@RequestParam("id") Long id) {
|
||||
return success(productPropertyValueService.getPropertyValue(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得规格名称分页")
|
||||
@Operation(summary = "获得规格名称分页")
|
||||
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
||||
public CommonResult<PageResult<ProductPropertyValueRespVO>> getPropertyValuePage(@Valid ProductPropertyValuePageReqVO pageVO) {
|
||||
return success(productPropertyValueService.getPropertyValueListPage(pageVO));
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@@ -13,22 +12,22 @@ import java.util.List;
|
||||
* @CreateDate: 2022/7/5 21:29
|
||||
* @Version: 1.0.0
|
||||
*/
|
||||
@ApiModel("管理后台 - 规格名称详情展示 Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称详情展示 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyViewRespVO {
|
||||
|
||||
@ApiModelProperty(value = "规格名称id", example = "1")
|
||||
@Schema(title = "规格名称id", example = "1")
|
||||
public Long propertyId;
|
||||
|
||||
@ApiModelProperty(value = "规格名称", example = "内存")
|
||||
@Schema(title = "规格名称", example = "内存")
|
||||
public String name;
|
||||
|
||||
@ApiModelProperty(value = "规格属性值集合", example = "[{\"v1\":11,\"v2\":\"64G\"},{\"v1\":10,\"v2\":\"32G\"}]")
|
||||
@Schema(title = "规格属性值集合", example = "[{\"v1\":11,\"v2\":\"64G\"},{\"v1\":10,\"v2\":\"32G\"}]")
|
||||
public List<Tuple2> propertyValues;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "规格属性值元组")
|
||||
@Schema(title = "规格属性值元组")
|
||||
public static class Tuple2 {
|
||||
private final long id;
|
||||
private final String name;
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -10,16 +9,16 @@ import lombok.ToString;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 规格 + 规格值 Response VO")
|
||||
@Schema(title = "管理后台 - 规格 + 规格值 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyAndValueRespVO extends ProductPropertyBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "规格的编号", required = true, example = "1024")
|
||||
@Schema(title = "规格的编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -13,14 +12,14 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ProductPropertyBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "规格名称", required = true, example = "颜色")
|
||||
@Schema(title = "规格名称", required = true, example = "颜色")
|
||||
@NotBlank(message = "规格名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "颜色")
|
||||
@Schema(title = "备注", example = "颜色")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
|
@@ -1,11 +1,10 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 规格名称创建 Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,19 +1,18 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 规格名称 List Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称 List Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "规格名称", example = "颜色")
|
||||
@Schema(title = "规格名称", example = "颜色")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,20 +11,20 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 规格名称分页 Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "规格名称", example = "颜色")
|
||||
@Schema(title = "规格名称", example = "颜色")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 规格 + 规格值 Response VO")
|
||||
@Schema(title = "管理后台 - 规格 + 规格值 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyRespVO extends ProductPropertyBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "规格的编号", required = true, example = "1024")
|
||||
@Schema(title = "规格的编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,18 +1,15 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.property;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 规格名称更新 Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1")
|
||||
@Schema(title = "主键", required = true, example = "1")
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.value;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -13,19 +12,19 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ProductPropertyValueBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "规格编号", required = true, example = "1024")
|
||||
@Schema(title = "规格编号", required = true, example = "1024")
|
||||
@NotNull(message = "规格编号不能为空")
|
||||
private Long propertyId;
|
||||
|
||||
@ApiModelProperty(value = "规格值名字", required = true, example = "红色")
|
||||
@Schema(title = "规格值名字", required = true, example = "红色")
|
||||
@NotEmpty(message = "规格值名字不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "颜色")
|
||||
@Schema(title = "备注", example = "颜色")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.value;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 规格值创建 Request VO")
|
||||
@Schema(title = "管理后台 - 规格值创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.value;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -13,19 +12,19 @@ import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 规格名称值分页 Request VO")
|
||||
@Schema(title = "管理后台 - 规格名称值分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyValuePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "规格id", example = "1024")
|
||||
@Schema(title = "规格id", example = "1024")
|
||||
private String propertyId;
|
||||
|
||||
@ApiModelProperty(value = "规格值", example = "红色")
|
||||
@Schema(title = "规格值", example = "红色")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.value;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 规格值 Response VO")
|
||||
@Schema(title = "管理后台 - 规格值 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "10")
|
||||
@Schema(title = "主键", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.property.vo.value;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 规格值更新 Request VO")
|
||||
@Schema(title = "管理后台 - 规格值更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1024")
|
||||
@Schema(title = "主键", required = true, example = "1024")
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
|
||||
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
|
||||
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Api(tags = "管理后台 - 商品 sku")
|
||||
@Tag(name = "管理后台 - 商品 sku")
|
||||
@RestController
|
||||
@RequestMapping("/product/sku")
|
||||
@Validated
|
||||
@@ -36,7 +36,7 @@ public class ProductSkuController {
|
||||
private ProductSpuService productSpuService;
|
||||
|
||||
@GetMapping("/get-option-list")
|
||||
@ApiOperation("获得商品 SKU 选项的列表")
|
||||
@Operation(summary = "获得商品 SKU 选项的列表")
|
||||
// @PreAuthorize("@ss.hasPermission('product:sku:query')")
|
||||
public CommonResult<List<ProductSkuOptionRespVO>> getSkuOptionList() {
|
||||
// 获得 SKU 列表
|
||||
|
@@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -16,54 +15,54 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class ProductSkuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 名字", required = true, example = "芋道")
|
||||
@Schema(title = "商品 SKU 名字", required = true, example = "芋道")
|
||||
@NotEmpty(message = "商品 SKU 名字不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "销售价格,单位:分", required = true, example = "1024", notes = "单位:分")
|
||||
@Schema(title = "销售价格,单位:分", required = true, example = "1024", description = "单位:分")
|
||||
@NotNull(message = "销售价格,单位:分不能为空")
|
||||
private Integer price;
|
||||
|
||||
@ApiModelProperty(value = "市场价", example = "1024", notes = "单位:分")
|
||||
@Schema(title = "市场价", example = "1024", description = "单位:分")
|
||||
private Integer marketPrice;
|
||||
|
||||
@ApiModelProperty(value = "成本价", example = "1024", notes = "单位:分")
|
||||
@Schema(title = "成本价", example = "1024", description = "单位:分")
|
||||
private Integer costPrice;
|
||||
|
||||
@ApiModelProperty(value = "条形码", example = "haha")
|
||||
@Schema(title = "条形码", example = "haha")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty(value = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png")
|
||||
@Schema(title = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png")
|
||||
@NotNull(message = "图片地址不能为空")
|
||||
private String picUrl;
|
||||
|
||||
@ApiModelProperty(value = "SKU 状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "SKU 状态", required = true, example = "1", description = "参见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "SKU 状态不能为空")
|
||||
@InEnum(CommonStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "库存", required = true, example = "1")
|
||||
@Schema(title = "库存", required = true, example = "1")
|
||||
@NotNull(message = "库存不能为空")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "预警预存", example = "1")
|
||||
@Schema(title = "预警预存", example = "1")
|
||||
private Integer warnStock;
|
||||
|
||||
@ApiModelProperty(value = "商品重量", example = "1", notes = "单位:kg 千克")
|
||||
@Schema(title = "商品重量", example = "1", description = "单位:kg 千克")
|
||||
private Double weight;
|
||||
|
||||
@ApiModelProperty(value = "商品体积", example = "1024", notes = "单位:m^3 平米")
|
||||
@Schema(title = "商品体积", example = "1024", description = "单位:m^3 平米")
|
||||
private Double volume;
|
||||
|
||||
@ApiModel("规格值")
|
||||
@Schema(title = "规格值")
|
||||
@Data
|
||||
public static class Property {
|
||||
|
||||
@ApiModelProperty(value = "属性编号", required = true, example = "1")
|
||||
@Schema(title = "属性编号", required = true, example = "1")
|
||||
@NotNull(message = "属性编号不能为空")
|
||||
private Long propertyId;
|
||||
|
||||
@ApiModelProperty(value = "属性值编号", required = true, example = "1024")
|
||||
@Schema(title = "属性值编号", required = true, example = "1024")
|
||||
@NotNull(message = "属性值编号不能为空")
|
||||
private Long valueId;
|
||||
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SKU 创建/更新 Request VO")
|
||||
@Schema(title = "管理后台 - 商品 SKU 创建/更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSkuCreateOrUpdateReqVO extends ProductSkuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 编号", example = "1")
|
||||
@Schema(title = "商品 SKU 编号", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@@ -1,31 +1,30 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品 SKU 选项 Response VO", description = "用于前端 SELECT 选项")
|
||||
@Schema(title = "管理后台 - 商品 SKU 选项 Response VO", description = "用于前端 SELECT 选项")
|
||||
@Data
|
||||
public class ProductSkuOptionRespVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1024")
|
||||
@Schema(title = "主键", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 名字", example = "红色")
|
||||
@Schema(title = "商品 SKU 名字", example = "红色")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "销售价格", required = true, example = "100", notes = "单位:分")
|
||||
@Schema(title = "销售价格", required = true, example = "100", description = "单位:分")
|
||||
private String price;
|
||||
|
||||
@ApiModelProperty(value = "库存", required = true, example = "100")
|
||||
@Schema(title = "库存", required = true, example = "100")
|
||||
private Integer stock;
|
||||
|
||||
// ========== 商品 SPU 信息 ==========
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1")
|
||||
@Schema(title = "商品 SPU 编号", required = true, example = "1")
|
||||
private Long spuId;
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 名字", required = true, example = "iPhone 11")
|
||||
@Schema(title = "商品 SPU 名字", required = true, example = "iPhone 11")
|
||||
private String spuName;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,16 +8,16 @@ import lombok.ToString;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SKU Response VO")
|
||||
@Schema(title = "管理后台 - 商品 SKU Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSkuRespVO extends ProductSkuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1024")
|
||||
@Schema(title = "主键", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*;
|
||||
import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
|
||||
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 商品 SPU")
|
||||
@Tag(name = "管理后台 - 商品 SPU")
|
||||
@RestController
|
||||
@RequestMapping("/product/spu")
|
||||
@Validated
|
||||
@@ -30,14 +30,14 @@ public class ProductSpuController {
|
||||
private ProductSpuService spuService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建商品 SPU")
|
||||
@Operation(summary = "创建商品 SPU")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:create')")
|
||||
public CommonResult<Long> createProductSpu(@Valid @RequestBody ProductSpuCreateReqVO createReqVO) {
|
||||
return success(spuService.createSpu(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新商品 SPU")
|
||||
@Operation(summary = "更新商品 SPU")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:update')")
|
||||
public CommonResult<Boolean> updateSpu(@Valid @RequestBody ProductSpuUpdateReqVO updateReqVO) {
|
||||
spuService.updateSpu(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class ProductSpuController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除商品 SPU")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除商品 SPU")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:delete')")
|
||||
public CommonResult<Boolean> deleteSpu(@RequestParam("id") Long id) {
|
||||
spuService.deleteSpu(id);
|
||||
@@ -55,16 +55,16 @@ public class ProductSpuController {
|
||||
|
||||
// TODO 芋艿:修改接口
|
||||
@GetMapping("/get/detail")
|
||||
@ApiOperation("获得商品 SPU")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得商品 SPU")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:query')")
|
||||
public CommonResult<ProductSpuDetailRespVO> getSpuDetail(@RequestParam("id") Long id) {
|
||||
return success(spuService.getSpuDetail(id));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得商品 SPU")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得商品 SPU")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:query')")
|
||||
public CommonResult<ProductSpuRespVO> getSpu(@RequestParam("id") Long id) {
|
||||
return success(spuService.getSpu(id));
|
||||
@@ -72,8 +72,8 @@ public class ProductSpuController {
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得商品 SPU 列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@Operation(summary = "获得商品 SPU 列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:query')")
|
||||
public CommonResult<List<ProductSpuRespVO>> getSpuList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ProductSpuDO> list = spuService.getSpuList(ids);
|
||||
@@ -81,7 +81,7 @@ public class ProductSpuController {
|
||||
}
|
||||
|
||||
@GetMapping("/get-simple-list")
|
||||
@ApiOperation("获得商品 SPU 精简列表")
|
||||
@Operation(summary = "获得商品 SPU 精简列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:query')")
|
||||
public CommonResult<List<ProductSpuSimpleRespVO>> getSpuSimpleList() {
|
||||
List<ProductSpuDO> list = spuService.getSpuList();
|
||||
@@ -89,7 +89,7 @@ public class ProductSpuController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得商品 SPU 分页")
|
||||
@Operation(summary = "获得商品 SPU 分页")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:query')")
|
||||
public CommonResult<PageResult<ProductSpuRespVO>> getSpuPage(@Valid ProductSpuPageReqVO pageVO) {
|
||||
return success(spuService.getSpuPage(pageVO));
|
||||
|
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuSpecTypeEnum;
|
||||
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -17,75 +17,75 @@ import java.util.List;
|
||||
@Data
|
||||
public class ProductSpuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "商品名称", required = true, example = "芋道")
|
||||
@Schema(title = "商品名称", required = true, example = "芋道")
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商品编码", example = "yudaoyuanma")
|
||||
@Schema(title = "商品编码", example = "yudaoyuanma")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "促销语", example = "好吃!")
|
||||
@Schema(title = "促销语", example = "好吃!")
|
||||
private String sellPoint;
|
||||
|
||||
@ApiModelProperty(value = "商品详情", required = true, example = "我是商品描述")
|
||||
@Schema(title = "商品详情", required = true, example = "我是商品描述")
|
||||
@NotNull(message = "商品详情不能为空")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "商品分类编号", required = true, example = "1")
|
||||
@Schema(title = "商品分类编号", required = true, example = "1")
|
||||
@NotNull(message = "商品分类编号不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty(value = "商品品牌编号", example = "1")
|
||||
@Schema(title = "商品品牌编号", example = "1")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty(value = "商品图片的数组", required = true)
|
||||
@Schema(title = "商品图片的数组", required = true)
|
||||
@NotNull(message = "商品图片的数组不能为空")
|
||||
private List<String> picUrls;
|
||||
|
||||
@ApiModelProperty(value = "商品视频", required = true)
|
||||
@Schema(title = "商品视频", required = true)
|
||||
private String videoUrl;
|
||||
|
||||
@ApiModelProperty(value = "排序字段", required = true, example = "1")
|
||||
@Schema(title = "排序字段", required = true, example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "商品状态", required = true, example = "1", notes = "参见 ProductSpuStatusEnum 枚举类")
|
||||
@Schema(title = "商品状态", required = true, example = "1", description = "参见 ProductSpuStatusEnum 枚举类")
|
||||
@NotNull(message = "商品状态不能为空")
|
||||
@InEnum(ProductSpuStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
// ========== SKU 相关字段 =========
|
||||
|
||||
@ApiModelProperty(value = "规格类型", required = true, example = "1", notes = "参见 ProductSpuSpecTypeEnum 枚举类")
|
||||
@Schema(title = "规格类型", required = true, example = "1", description = "参见 ProductSpuSpecTypeEnum 枚举类")
|
||||
@NotNull(message = "规格类型不能为空")
|
||||
@InEnum(ProductSpuSpecTypeEnum.class)
|
||||
private Integer specType;
|
||||
|
||||
@ApiModelProperty(value = "是否展示库存", required = true, example = "true")
|
||||
@Schema(title = "是否展示库存", required = true, example = "true")
|
||||
@NotNull(message = "是否展示库存不能为空")
|
||||
private Boolean showStock;
|
||||
|
||||
@ApiModelProperty(value = "库存", required = true, example = "true")
|
||||
@Schema(title = "库存", required = true, example = "true")
|
||||
private Integer totalStock;
|
||||
|
||||
@ApiModelProperty(value = "市场价", example = "1024")
|
||||
@Schema(title = "市场价", example = "1024")
|
||||
private Integer marketPrice;
|
||||
|
||||
@ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024")
|
||||
@Schema(title = " 最小价格,单位使用:分", required = true, example = "1024")
|
||||
private Integer minPrice;
|
||||
|
||||
@ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024")
|
||||
@Schema(title = "最大价格,单位使用:分", required = true, example = "1024")
|
||||
private Integer maxPrice;
|
||||
|
||||
// ========== 统计相关字段 =========
|
||||
|
||||
@ApiModelProperty(value = "商品销量", example = "1024")
|
||||
@Schema(title = "商品销量", example = "1024")
|
||||
private Integer salesCount;
|
||||
|
||||
@ApiModelProperty(value = "虚拟销量", required = true, example = "1024")
|
||||
@Schema(title = "虚拟销量", required = true, example = "1024")
|
||||
@NotNull(message = "虚拟销量不能为空")
|
||||
private Integer virtualSalesCount;
|
||||
|
||||
@ApiModelProperty(value = "点击量", example = "1024")
|
||||
@Schema(title = "点击量", example = "1024")
|
||||
private Integer clickCount;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,7 +9,7 @@ import lombok.ToString;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SPU 创建 Request VO")
|
||||
@Schema(title = "管理后台 - 商品 SPU 创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyViewRespVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -11,16 +10,16 @@ import lombok.ToString;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品 SPU 详细 Response VO", description = "包括关联的 SKU 等信息")
|
||||
@Schema(title = "管理后台 - 商品 SPU 详细 Response VO", description = "包括关联的 SKU 等信息")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSpuDetailRespVO extends ProductSpuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1")
|
||||
@Schema(title = "主键", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
@@ -28,7 +27,7 @@ public class ProductSpuDetailRespVO extends ProductSpuBaseVO {
|
||||
*/
|
||||
private List<Sku> skus;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品 SKU 详细 Response VO")
|
||||
@Schema(title = "管理后台 - 商品 SKU 详细 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@@ -41,25 +40,25 @@ public class ProductSpuDetailRespVO extends ProductSpuBaseVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品规格的详细 Response VO")
|
||||
@Schema(title = "管理后台 - 商品规格的详细 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public static class Property extends ProductSkuBaseVO.Property {
|
||||
|
||||
@ApiModelProperty(value = "规格的名字", required = true, example = "颜色")
|
||||
@Schema(title = "规格的名字", required = true, example = "颜色")
|
||||
private String propertyName;
|
||||
|
||||
@ApiModelProperty(value = "规格值的名字", required = true, example = "蓝色")
|
||||
@Schema(title = "规格值的名字", required = true, example = "蓝色")
|
||||
private String valueName;
|
||||
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "分类 id 数组,一直递归到一级父节点", example = "4")
|
||||
@Schema(title = "分类 id 数组,一直递归到一级父节点", example = "4")
|
||||
private Long categoryId;
|
||||
|
||||
// TODO @芋艿:在瞅瞅~
|
||||
@ApiModelProperty(value = "规格属性修改和详情展示组合", example = "[{\"propertyId\":2,\"name\":\"内存\",\"propertyValues\":[{\"v1\":11,\"v2\":\"64G\"},{\"v1\":10,\"v2\":\"32G\"}]},{\"propertyId\":3,\"name\":\"尺寸\",\"propertyValues\":[{\"v1\":16,\"v2\":\"6.1\"},{\"v1\":15,\"v2\":\"5.7\"}]}]")
|
||||
@Schema(title = "规格属性修改和详情展示组合", example = "[{\"propertyId\":2,\"name\":\"内存\",\"propertyValues\":[{\"v1\":11,\"v2\":\"64G\"},{\"v1\":10,\"v2\":\"32G\"}]},{\"propertyId\":3,\"name\":\"尺寸\",\"propertyValues\":[{\"v1\":16,\"v2\":\"6.1\"},{\"v1\":15,\"v2\":\"5.7\"}]}]")
|
||||
private List<ProductPropertyViewRespVO> productPropertyViews;
|
||||
|
||||
}
|
||||
|
@@ -1,46 +1,45 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SPU 分页 Request VO")
|
||||
@Schema(title = "管理后台 - 商品 SPU 分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSpuPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "商品名称", example = "yutou")
|
||||
@Schema(title = "商品名称", example = "yutou")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商品编码", example = "yudaoyuanma")
|
||||
@Schema(title = "商品编码", example = "yudaoyuanma")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "分类id", example = "1")
|
||||
@Schema(title = "分类id", example = "1")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty(value = "商品品牌编号", example = "1")
|
||||
@Schema(title = "商品品牌编号", example = "1")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态", example = "1", notes = "参见 ProductSpuStatusEnum 枚举值")
|
||||
@Schema(title = "上下架状态", example = "1", description = "参见 ProductSpuStatusEnum 枚举值")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "销量最小值", example = "1")
|
||||
@Schema(title = "销量最小值", example = "1")
|
||||
private Integer salesCountMin;
|
||||
|
||||
@ApiModelProperty(value = "销量最大值", example = "1024")
|
||||
@Schema(title = "销量最大值", example = "1024")
|
||||
private Integer salesCountMax;
|
||||
|
||||
@ApiModelProperty(value = "市场价最小值", example = "1")
|
||||
@Schema(title = "市场价最小值", example = "1")
|
||||
private Integer marketPriceMin;
|
||||
|
||||
@ApiModelProperty(value = "市场价最大值", example = "1024")
|
||||
@Schema(title = "市场价最大值", example = "1024")
|
||||
private Integer marketPriceMax;
|
||||
|
||||
@ApiModelProperty(value = "是否库存告警", example = "true")
|
||||
@Schema(title = "是否库存告警", example = "true")
|
||||
private Boolean alarmStock;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,16 +8,16 @@ import lombok.ToString;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SPU Response VO")
|
||||
@Schema(title = "管理后台 - 商品 SPU Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSpuRespVO extends ProductSpuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1")
|
||||
@Schema(title = "主键", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,27 +1,26 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SPU 精简 Response VO")
|
||||
@Schema(title = "管理后台 - 商品 SPU 精简 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSpuSimpleRespVO extends ProductSpuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1")
|
||||
@Schema(title = "主键", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "商品名称", required = true, example = "芋道")
|
||||
@Schema(title = "商品名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024")
|
||||
@Schema(title = " 最小价格,单位使用:分", required = true, example = "1024")
|
||||
private Integer minPrice;
|
||||
|
||||
@ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024")
|
||||
@Schema(title = "最大价格,单位使用:分", required = true, example = "1024")
|
||||
private Integer maxPrice;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -11,13 +10,13 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 商品 SPU 更新 Request VO")
|
||||
@Schema(title = "管理后台 - 商品 SPU 更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProductSpuUpdateReqVO extends ProductSpuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "商品编号", required = true, example = "1")
|
||||
@Schema(title = "商品编号", required = true, example = "1")
|
||||
@NotNull(message = "商品编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.product.controller.app.category.vo.AppCategoryRes
|
||||
import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
|
||||
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "用户 APP - 商品分类")
|
||||
@Tag(name = "用户 APP - 商品分类")
|
||||
@RestController
|
||||
@RequestMapping("/product/category")
|
||||
@Validated
|
||||
@@ -28,7 +28,7 @@ public class AppCategoryController {
|
||||
private ProductCategoryService categoryService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得商品分类列表")
|
||||
@Operation(summary = "获得商品分类列表")
|
||||
public CommonResult<List<AppCategoryRespVO>> getProductCategoryList() {
|
||||
List<ProductCategoryDO> list = categoryService.getEnableCategoryList();
|
||||
list.sort(Comparator.comparing(ProductCategoryDO::getSort));
|
||||
|
@@ -1,28 +1,27 @@
|
||||
package cn.iocoder.yudao.module.product.controller.app.category.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "用户 APP - 商品分类 Response VO")
|
||||
@Schema(title = "用户 APP - 商品分类 Response VO")
|
||||
public class AppCategoryRespVO {
|
||||
|
||||
@ApiModelProperty(value = "分类编号", required = true, example = "2")
|
||||
@Schema(title = "分类编号", required = true, example = "2")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "父分类编号", required = true, example = "1")
|
||||
@Schema(title = "父分类编号", required = true, example = "1")
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "分类名称", required = true, example = "办公文具")
|
||||
@Schema(title = "分类名称", required = true, example = "办公文具")
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "分类图片", required = true)
|
||||
@Schema(title = "分类图片", required = true)
|
||||
@NotBlank(message = "分类图片不能为空")
|
||||
private String picUrl;
|
||||
|
||||
|
@@ -7,8 +7,8 @@ import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppSpuPageReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppSpuPageRespVO;
|
||||
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppSpuRespVO;
|
||||
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -20,7 +20,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "用户 APP - 商品spu")
|
||||
@Tag(name = "用户 APP - 商品spu")
|
||||
@RestController
|
||||
@RequestMapping("/product/spu")
|
||||
@Validated
|
||||
@@ -30,13 +30,13 @@ public class AppProductSpuController {
|
||||
private ProductSpuService spuService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得商品spu分页")
|
||||
@Operation(summary = "获得商品spu分页")
|
||||
public CommonResult<PageResult<AppSpuPageRespVO>> getSpuPage(@Valid AppSpuPageReqVO pageVO) {
|
||||
return success(spuService.getSpuPage(pageVO));
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
@ApiOperation("获取商品 - 通过商品id")
|
||||
@Operation(summary = "获取商品 - 通过商品id")
|
||||
public CommonResult<AppSpuRespVO> getSpu(@RequestParam("spuId") Long spuId) {
|
||||
AppSpuRespVO appSpuRespVO = BeanUtil.toBean(spuService.getSpu(spuId), AppSpuRespVO.class);
|
||||
return success(appSpuRespVO);
|
||||
|
@@ -1,18 +1,17 @@
|
||||
package cn.iocoder.yudao.module.product.controller.app.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("App - 商品spu分页 Request VO")
|
||||
@Schema(title = "App - 商品spu分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppSpuPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
@Schema(title = "分类id")
|
||||
private Long categoryId;
|
||||
}
|
||||
|
@@ -1,52 +1,51 @@
|
||||
package cn.iocoder.yudao.module.product.controller.app.spu.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("App - 商品spu分页 Request VO")
|
||||
@Schema(title = "App - 商品spu分页 Request VO")
|
||||
@Data
|
||||
public class AppSpuPageRespVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1")
|
||||
@Schema(title = "主键", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@Schema(title = "商品名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "卖点", required = true)
|
||||
@Schema(title = "卖点", required = true)
|
||||
@NotNull(message = "卖点不能为空")
|
||||
private String sellPoint;
|
||||
|
||||
@ApiModelProperty(value = "描述", required = true)
|
||||
@Schema(title = "描述", required = true)
|
||||
@NotNull(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "分类id", required = true)
|
||||
@Schema(title = "分类id", required = true)
|
||||
@NotNull(message = "分类id不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张", required = true)
|
||||
@Schema(title = "商品主图地址,* 数组,以逗号分隔,最多上传15张", required = true)
|
||||
@NotNull(message = "商品主图地址,* 数组,以逗号分隔,最多上传15张不能为空")
|
||||
private List<String> picUrls;
|
||||
|
||||
@ApiModelProperty(value = "排序字段", required = true)
|
||||
@Schema(title = "排序字段", required = true)
|
||||
@NotNull(message = "排序字段不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "点赞初始人数")
|
||||
@Schema(title = "点赞初始人数")
|
||||
private Integer likeCount;
|
||||
|
||||
@ApiModelProperty(value = "价格 单位使用:分")
|
||||
@Schema(title = "价格 单位使用:分")
|
||||
private Integer price;
|
||||
|
||||
@ApiModelProperty(value = "库存数量")
|
||||
@Schema(title = "库存数量")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)")
|
||||
@Schema(title = "上下架状态: 0 上架(开启) 1 下架(禁用)")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.controller.app.spu.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuRespVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -12,7 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||
*
|
||||
* @author LuoWenFeng
|
||||
*/
|
||||
@ApiModel("App - 商品spu Response VO")
|
||||
@Schema(title = "App - 商品spu Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppSpuRespVO extends ProductSpuRespVO {
|
||||
|
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.convert.banner.BannerConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.banner.BannerService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -18,7 +18,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - Banner 管理")
|
||||
@Tag(name = "管理后台 - Banner 管理")
|
||||
@RestController
|
||||
@RequestMapping("/market/banner")
|
||||
@Validated
|
||||
@@ -28,14 +28,14 @@ public class BannerController {
|
||||
private BannerService bannerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建 Banner")
|
||||
@Operation(summary = "创建 Banner")
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:create')")
|
||||
public CommonResult<Long> createBanner(@Valid @RequestBody BannerCreateReqVO createReqVO) {
|
||||
return success(bannerService.createBanner(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新 Banner")
|
||||
@Operation(summary = "更新 Banner")
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:update')")
|
||||
public CommonResult<Boolean> updateBanner(@Valid @RequestBody BannerUpdateReqVO updateReqVO) {
|
||||
bannerService.updateBanner(updateReqVO);
|
||||
@@ -43,8 +43,8 @@ public class BannerController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除 Banner")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除 Banner")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:delete')")
|
||||
public CommonResult<Boolean> deleteBanner(@RequestParam("id") Long id) {
|
||||
bannerService.deleteBanner(id);
|
||||
@@ -52,8 +52,8 @@ public class BannerController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得 Banner")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得 Banner")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
||||
public CommonResult<BannerRespVO> getBanner(@RequestParam("id") Long id) {
|
||||
BannerDO banner = bannerService.getBanner(id);
|
||||
@@ -61,7 +61,7 @@ public class BannerController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得 Banner 分页")
|
||||
@Operation(summary = "获得 Banner 分页")
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
||||
public CommonResult<PageResult<BannerRespVO>> getBannerPage(@Valid BannerPageReqVO pageVO) {
|
||||
PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO);
|
||||
|
@@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -15,28 +15,28 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class BannerBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标题", required = true)
|
||||
@Schema(title = "标题", required = true)
|
||||
@NotNull(message = "标题不能为空")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "跳转链接", required = true)
|
||||
@Schema(title = "跳转链接", required = true)
|
||||
@NotNull(message = "跳转链接不能为空")
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "图片地址", required = true)
|
||||
@Schema(title = "图片地址", required = true)
|
||||
@NotNull(message = "图片地址不能为空")
|
||||
private String picUrl;
|
||||
|
||||
@ApiModelProperty(value = "排序", required = true)
|
||||
@Schema(title = "排序", required = true)
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true)
|
||||
@Schema(title = "状态", required = true)
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(CommonStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(title = "备注")
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -8,7 +7,7 @@ import lombok.ToString;
|
||||
/**
|
||||
* @author xia
|
||||
*/
|
||||
@ApiModel("管理后台 - Banner 创建 Request VO")
|
||||
@Schema(title = "管理后台 - Banner 创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -3,8 +3,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -17,22 +16,22 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
/**
|
||||
* @author xia
|
||||
*/
|
||||
@ApiModel("管理后台 - Banner 分页 Request VO")
|
||||
@Schema(title = "管理后台 - Banner 分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BannerPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
@Schema(title = "标题")
|
||||
private String title;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Schema(title = "状态")
|
||||
@InEnum(CommonStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@@ -11,16 +10,16 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* @author xia
|
||||
*/
|
||||
@ApiModel("管理后台 - Banner Response VO")
|
||||
@Schema(title = "管理后台 - Banner Response VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class BannerRespVO extends BannerBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "banner编号", required = true)
|
||||
@Schema(title = "banner编号", required = true)
|
||||
@NotNull(message = "banner编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -11,13 +10,13 @@ import javax.validation.constraints.NotNull;
|
||||
/**
|
||||
* @author xia
|
||||
*/
|
||||
@ApiModel("管理后台 - Banner更新 Request VO")
|
||||
@Schema(title = "管理后台 - Banner更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BannerUpdateReqVO extends BannerBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "banner 编号", required = true)
|
||||
@Schema(title = "banner 编号", required = true)
|
||||
@NotNull(message = "banner 编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon.Coupo
|
||||
import cn.iocoder.yudao.module.promotion.convert.coupon.CouponConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.coupon.CouponService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -26,7 +26,7 @@ import java.util.Set;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Api(tags = "管理后台 - 优惠劵")
|
||||
@Tag(name = "管理后台 - 优惠劵")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/coupon")
|
||||
@Validated
|
||||
@@ -38,8 +38,8 @@ public class CouponController {
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
// @GetMapping("/get")
|
||||
// @ApiOperation("获得优惠劵")
|
||||
// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @Operation(summary = "获得优惠劵")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('promotion:coupon:query')")
|
||||
// public CommonResult<CouponRespVO> getCoupon(@RequestParam("id") Long id) {
|
||||
// CouponDO coupon = couponService.getCoupon(id);
|
||||
@@ -47,8 +47,8 @@ public class CouponController {
|
||||
// }
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("回收优惠劵")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "回收优惠劵")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon:delete')")
|
||||
public CommonResult<Boolean> deleteCoupon(@RequestParam("id") Long id) {
|
||||
couponService.deleteCoupon(id);
|
||||
@@ -56,7 +56,7 @@ public class CouponController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得优惠劵分页")
|
||||
@Operation(summary = "获得优惠劵分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon:query')")
|
||||
public CommonResult<PageResult<CouponPageItemRespVO>> getCouponPage(@Valid CouponPageReqVO pageVO) {
|
||||
PageResult<CouponDO> pageResult = couponService.getCouponPage(pageVO);
|
||||
|
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.*;
|
||||
import cn.iocoder.yudao.module.promotion.convert.coupon.CouponTemplateConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.coupon.CouponTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -18,7 +18,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 优惠劵模板")
|
||||
@Tag(name = "管理后台 - 优惠劵模板")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/coupon-template")
|
||||
@Validated
|
||||
@@ -28,14 +28,14 @@ public class CouponTemplateController {
|
||||
private CouponTemplateService couponTemplateService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建优惠劵模板")
|
||||
@Operation(summary = "创建优惠劵模板")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:create')")
|
||||
public CommonResult<Long> createCouponTemplate(@Valid @RequestBody CouponTemplateCreateReqVO createReqVO) {
|
||||
return success(couponTemplateService.createCouponTemplate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新优惠劵模板")
|
||||
@Operation(summary = "更新优惠劵模板")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:update')")
|
||||
public CommonResult<Boolean> updateCouponTemplate(@Valid @RequestBody CouponTemplateUpdateReqVO updateReqVO) {
|
||||
couponTemplateService.updateCouponTemplate(updateReqVO);
|
||||
@@ -43,7 +43,7 @@ public class CouponTemplateController {
|
||||
}
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@ApiOperation("更新优惠劵模板状态")
|
||||
@Operation(summary = "更新优惠劵模板状态")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:update')")
|
||||
public CommonResult<Boolean> updateCouponTemplateStatus(@Valid @RequestBody CouponTemplateUpdateStatusReqVO reqVO) {
|
||||
couponTemplateService.updateCouponTemplateStatus(reqVO.getId(), reqVO.getStatus());
|
||||
@@ -51,8 +51,8 @@ public class CouponTemplateController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除优惠劵模板")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除优惠劵模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:delete')")
|
||||
public CommonResult<Boolean> deleteCouponTemplate(@RequestParam("id") Long id) {
|
||||
couponTemplateService.deleteCouponTemplate(id);
|
||||
@@ -60,8 +60,8 @@ public class CouponTemplateController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得优惠劵模板")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得优惠劵模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:query')")
|
||||
public CommonResult<CouponTemplateRespVO> getCouponTemplate(@RequestParam("id") Long id) {
|
||||
CouponTemplateDO couponTemplate = couponTemplateService.getCouponTemplate(id);
|
||||
@@ -69,7 +69,7 @@ public class CouponTemplateController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得优惠劵模板分页")
|
||||
@Operation(summary = "获得优惠劵模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:query')")
|
||||
public CommonResult<PageResult<CouponTemplateRespVO>> getCouponTemplatePage(@Valid CouponTemplatePageReqVO pageVO) {
|
||||
PageResult<CouponTemplateDO> pageResult = couponTemplateService.getCouponTemplatePage(pageVO);
|
||||
|
@@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -24,76 +24,76 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE
|
||||
public class CouponBaseVO {
|
||||
|
||||
// ========== 基本信息 BEGIN ==========
|
||||
@ApiModelProperty(value = "优惠劵模板编号", required = true, example = "1024")
|
||||
@Schema(title = "优惠劵模板编号", required = true, example = "1024")
|
||||
@NotNull(message = "优惠劵模板编号不能为空")
|
||||
private Integer templateId;
|
||||
|
||||
@ApiModelProperty(value = "优惠劵名", required = true, example = "春节送送送")
|
||||
@Schema(title = "优惠劵名", required = true, example = "春节送送送")
|
||||
@NotNull(message = "优惠劵名不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "优惠码状态", required = true, example = "1", notes = "参见 CouponStatusEnum 枚举")
|
||||
@Schema(title = "优惠码状态", required = true, example = "1", description = "参见 CouponStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
// ========== 基本信息 END ==========
|
||||
|
||||
// ========== 领取情况 BEGIN ==========
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1")
|
||||
@Schema(title = "用户编号", required = true, example = "1")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "领取方式", required = true, example = "1", notes = "参见 CouponTakeTypeEnum 枚举类")
|
||||
@Schema(title = "领取方式", required = true, example = "1", description = "参见 CouponTakeTypeEnum 枚举类")
|
||||
@NotNull(message = "领取方式不能为空")
|
||||
private Integer takeType;
|
||||
// ========== 领取情况 END ==========
|
||||
|
||||
// ========== 使用规则 BEGIN ==========
|
||||
@ApiModelProperty(value = "是否设置满多少金额可用", required = true, example = "100", notes = "单位:分;0 - 不限制")
|
||||
@Schema(title = "是否设置满多少金额可用", required = true, example = "100", description = "单位:分;0 - 不限制")
|
||||
@NotNull(message = "是否设置满多少金额可用不能为空")
|
||||
private Integer usePrice;
|
||||
|
||||
@ApiModelProperty(value = "固定日期 - 生效开始时间")
|
||||
@Schema(title = "固定日期 - 生效开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime validStartTime;
|
||||
|
||||
@ApiModelProperty(value = "固定日期 - 生效结束时间")
|
||||
@Schema(title = "固定日期 - 生效结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime validEndTime;
|
||||
|
||||
@ApiModelProperty(value = "商品范围", required = true, example = "1", notes = "参见 PromotionProductScopeEnum 枚举类")
|
||||
@Schema(title = "商品范围", required = true, example = "1", description = "参见 PromotionProductScopeEnum 枚举类")
|
||||
@NotNull(message = "商品范围不能为空")
|
||||
@InEnum(PromotionProductScopeEnum.class)
|
||||
private Integer productScope;
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,3")
|
||||
@Schema(title = "商品 SPU 编号的数组", example = "1,3")
|
||||
private List<Long> productSpuIds;
|
||||
// ========== 使用规则 END ==========
|
||||
|
||||
// ========== 使用效果 BEGIN ==========
|
||||
@ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@Schema(title = "优惠类型", required = true, example = "1", description = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@NotNull(message = "优惠类型不能为空")
|
||||
@InEnum(PromotionDiscountTypeEnum.class)
|
||||
private Integer discountType;
|
||||
|
||||
@ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80")
|
||||
@Schema(title = "折扣百分比", example = "80", description = "例如说,80% 为 80")
|
||||
private Integer discountPercent;
|
||||
|
||||
@ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分")
|
||||
@Schema(title = "优惠金额", example = "10", description = "单位:分")
|
||||
@Min(value = 0, message = "优惠金额需要大于等于 0")
|
||||
private Integer discountPrice;
|
||||
|
||||
@ApiModelProperty(value = "折扣上限", example = "100", notes = "单位:分,仅在 discountType 为 PERCENT 使用")
|
||||
@Schema(title = "折扣上限", example = "100", description = "单位:分,仅在 discountType 为 PERCENT 使用")
|
||||
private Integer discountLimitPrice;
|
||||
// ========== 使用效果 END ==========
|
||||
|
||||
// ========== 使用情况 BEGIN ==========
|
||||
|
||||
@ApiModelProperty(value = "使用订单号", example = "4096")
|
||||
@Schema(title = "使用订单号", example = "4096")
|
||||
private Long useOrderId;
|
||||
|
||||
@ApiModelProperty(value = "使用时间")
|
||||
@Schema(title = "使用时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime useTime;
|
||||
|
@@ -1,18 +1,17 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵分页的每一项 Response VO")
|
||||
@Schema(title = "管理后台 - 优惠劵分页的每一项 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponPageItemRespVO extends CouponRespVO {
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", example = "老芋艿")
|
||||
@Schema(title = "用户昵称", example = "老芋艿")
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,23 +11,23 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵分页 Request VO")
|
||||
@Schema(title = "管理后台 - 优惠劵分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "优惠劵模板编号", example = "2048")
|
||||
@Schema(title = "优惠劵模板编号", example = "2048")
|
||||
private Long templateId;
|
||||
|
||||
@ApiModelProperty(value = "优惠码状态", example = "1", notes = "参见 CouponStatusEnum 枚举")
|
||||
@Schema(title = "优惠码状态", example = "1", description = "参见 CouponStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", example = "芋艿", notes = "模糊匹配")
|
||||
@Schema(title = "用户昵称", example = "芋艿", description = "模糊匹配")
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵 Response VO")
|
||||
@Schema(title = "管理后台 - 优惠劵 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponRespVO extends CouponBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "优惠劵编号", required = true, example = "1024")
|
||||
@Schema(title = "优惠劵编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTemplateValidityTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -29,70 +29,70 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE
|
||||
@Data
|
||||
public class CouponTemplateBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "优惠劵名", required = true, example = "春节送送送")
|
||||
@Schema(title = "优惠劵名", required = true, example = "春节送送送")
|
||||
@NotNull(message = "优惠劵名不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "发行总量", required = true, example = "1024", notes = "-1 - 则表示不限制发放数量")
|
||||
@Schema(title = "发行总量", required = true, example = "1024", description = "-1 - 则表示不限制发放数量")
|
||||
@NotNull(message = "发行总量不能为空")
|
||||
private Integer totalCount;
|
||||
|
||||
@ApiModelProperty(value = "每人限领个数", required = true, example = "66", notes = "-1 - 则表示不限制")
|
||||
@Schema(title = "每人限领个数", required = true, example = "66", description = "-1 - 则表示不限制")
|
||||
@NotNull(message = "每人限领个数不能为空")
|
||||
private Integer takeLimitCount;
|
||||
|
||||
@ApiModelProperty(value = "领取方式", required = true, example = "1", notes = "参见 CouponTakeTypeEnum 枚举类")
|
||||
@Schema(title = "领取方式", required = true, example = "1", description = "参见 CouponTakeTypeEnum 枚举类")
|
||||
@NotNull(message = "领取方式不能为空")
|
||||
private Integer takeType;
|
||||
|
||||
@ApiModelProperty(value = "是否设置满多少金额可用", required = true, example = "100", notes = "单位:分;0 - 不限制")
|
||||
@Schema(title = "是否设置满多少金额可用", required = true, example = "100", description = "单位:分;0 - 不限制")
|
||||
@NotNull(message = "是否设置满多少金额可用不能为空")
|
||||
private Integer usePrice;
|
||||
|
||||
@ApiModelProperty(value = "商品范围", required = true, example = "1", notes = "参见 PromotionProductScopeEnum 枚举类")
|
||||
@Schema(title = "商品范围", required = true, example = "1", description = "参见 PromotionProductScopeEnum 枚举类")
|
||||
@NotNull(message = "商品范围不能为空")
|
||||
@InEnum(PromotionProductScopeEnum.class)
|
||||
private Integer productScope;
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,3")
|
||||
@Schema(title = "商品 SPU 编号的数组", example = "1,3")
|
||||
private List<Long> productSpuIds;
|
||||
|
||||
@ApiModelProperty(value = "生效日期类型", required = true, example = "1")
|
||||
@Schema(title = "生效日期类型", required = true, example = "1")
|
||||
@NotNull(message = "生效日期类型不能为空")
|
||||
@InEnum(CouponTemplateValidityTypeEnum.class)
|
||||
private Integer validityType;
|
||||
|
||||
@ApiModelProperty(value = "固定日期 - 生效开始时间")
|
||||
@Schema(title = "固定日期 - 生效开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime validStartTime;
|
||||
|
||||
@ApiModelProperty(value = "固定日期 - 生效结束时间")
|
||||
@Schema(title = "固定日期 - 生效结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime validEndTime;
|
||||
|
||||
@ApiModelProperty(value = "领取日期 - 开始天数")
|
||||
@Schema(title = "领取日期 - 开始天数")
|
||||
@Min(value = 0L, message = "开始天数必须大于 0")
|
||||
private Integer fixedStartTerm;
|
||||
|
||||
@ApiModelProperty(value = "领取日期 - 结束天数")
|
||||
@Schema(title = "领取日期 - 结束天数")
|
||||
@Min(value = 1L, message = "开始天数必须大于 1")
|
||||
private Integer fixedEndTerm;
|
||||
|
||||
@ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@Schema(title = "优惠类型", required = true, example = "1", description = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@NotNull(message = "优惠类型不能为空")
|
||||
@InEnum(PromotionDiscountTypeEnum.class)
|
||||
private Integer discountType;
|
||||
|
||||
@ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80")
|
||||
@Schema(title = "折扣百分比", example = "80", description = "例如说,80% 为 80")
|
||||
private Integer discountPercent;
|
||||
|
||||
@ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分")
|
||||
@Schema(title = "优惠金额", example = "10", description = "单位:分")
|
||||
@Min(value = 0, message = "优惠金额需要大于等于 0")
|
||||
private Integer discountPrice;
|
||||
|
||||
@ApiModelProperty(value = "折扣上限", example = "100", notes = "单位:分,仅在 discountType 为 PERCENT 使用")
|
||||
@Schema(title = "折扣上限", example = "100", description = "单位:分,仅在 discountType 为 PERCENT 使用")
|
||||
private Integer discountLimitPrice;
|
||||
|
||||
@AssertTrue(message = "商品 SPU 编号的数组不能为空")
|
||||
|
@@ -1,11 +1,10 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵模板创建 Request VO")
|
||||
@Schema(title = "管理后台 - 优惠劵模板创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,22 +11,22 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵模板分页 Request VO")
|
||||
@Schema(title = "管理后台 - 优惠劵模板分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponTemplatePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "优惠劵名", example = "你好")
|
||||
@Schema(title = "优惠劵名", example = "你好")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
@Schema(title = "状态", example = "1", description = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "优惠类型", example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@Schema(title = "优惠类型", example = "1", description = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
private Integer discountType;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
@@ -2,34 +2,33 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵模板 Response VO")
|
||||
@Schema(title = "管理后台 - 优惠劵模板 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponTemplateRespVO extends CouponTemplateBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "模板编号", required = true, example = "1024")
|
||||
@Schema(title = "模板编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1")
|
||||
@Schema(title = "状态", required = true, example = "1")
|
||||
@InEnum(CommonStatusEnum.class)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "领取优惠券的数量", required = true, example = "1024")
|
||||
@Schema(title = "领取优惠券的数量", required = true, example = "1024")
|
||||
private Integer takeCount;
|
||||
|
||||
@ApiModelProperty(value = "使用优惠券的次数", required = true, example = "2048")
|
||||
@Schema(title = "使用优惠券的次数", required = true, example = "2048")
|
||||
private Integer useCount;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵模板更新 Request VO")
|
||||
@Schema(title = "管理后台 - 优惠劵模板更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CouponTemplateUpdateReqVO extends CouponTemplateBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "模板编号", required = true, example = "1024")
|
||||
@Schema(title = "模板编号", required = true, example = "1024")
|
||||
@NotNull(message = "模板编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -2,21 +2,20 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 优惠劵模板更新状态 Request VO")
|
||||
@Schema(title = "管理后台 - 优惠劵模板更新状态 Request VO")
|
||||
@Data
|
||||
public class CouponTemplateUpdateStatusReqVO {
|
||||
|
||||
@ApiModelProperty(value = "优惠劵模板编号", required = true, example = "1024")
|
||||
@Schema(title = "优惠劵模板编号", required = true, example = "1024")
|
||||
@NotNull(message = "优惠劵模板编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@Schema(title = "状态", required = true, example = "1", description = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConver
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.discount.DiscountActivityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 限时折扣活动")
|
||||
@Tag(name = "管理后台 - 限时折扣活动")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/discount-activity")
|
||||
@Validated
|
||||
@@ -30,14 +30,14 @@ public class DiscountActivityController {
|
||||
private DiscountActivityService discountActivityService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建限时折扣活动")
|
||||
@Operation(summary = "创建限时折扣活动")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:create')")
|
||||
public CommonResult<Long> createDiscountActivity(@Valid @RequestBody DiscountActivityCreateReqVO createReqVO) {
|
||||
return success(discountActivityService.createDiscountActivity(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新限时折扣活动")
|
||||
@Operation(summary = "更新限时折扣活动")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:update')")
|
||||
public CommonResult<Boolean> updateDiscountActivity(@Valid @RequestBody DiscountActivityUpdateReqVO updateReqVO) {
|
||||
discountActivityService.updateDiscountActivity(updateReqVO);
|
||||
@@ -45,8 +45,8 @@ public class DiscountActivityController {
|
||||
}
|
||||
|
||||
@PutMapping("/close")
|
||||
@ApiOperation("关闭限时折扣活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "关闭限时折扣活动")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:close')")
|
||||
public CommonResult<Boolean> closeRewardActivity(@RequestParam("id") Long id) {
|
||||
discountActivityService.closeRewardActivity(id);
|
||||
@@ -54,8 +54,8 @@ public class DiscountActivityController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除限时折扣活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除限时折扣活动")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:delete')")
|
||||
public CommonResult<Boolean> deleteDiscountActivity(@RequestParam("id") Long id) {
|
||||
discountActivityService.deleteDiscountActivity(id);
|
||||
@@ -63,8 +63,8 @@ public class DiscountActivityController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得限时折扣活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得限时折扣活动")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')")
|
||||
public CommonResult<DiscountActivityDetailRespVO> getDiscountActivity(@RequestParam("id") Long id) {
|
||||
DiscountActivityDO discountActivity = discountActivityService.getDiscountActivity(id);
|
||||
@@ -77,7 +77,7 @@ public class DiscountActivityController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得限时折扣活动分页")
|
||||
@Operation(summary = "获得限时折扣活动分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')")
|
||||
public CommonResult<PageResult<DiscountActivityRespVO>> getDiscountActivityPage(@Valid DiscountActivityPageReqVO pageVO) {
|
||||
PageResult<DiscountActivityDO> pageResult = discountActivityService.getDiscountActivityPage(pageVO);
|
||||
|
@@ -4,8 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -23,44 +22,44 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class DiscountActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动标题", required = true, example = "一个标题")
|
||||
@Schema(title = "活动标题", required = true, example = "一个标题")
|
||||
@NotNull(message = "活动标题不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
@Schema(title = "开始时间", required = true)
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间", required = true)
|
||||
@Schema(title = "结束时间", required = true)
|
||||
@NotNull(message = "结束时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是备注")
|
||||
@Schema(title = "备注", example = "我是备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModel("商品")
|
||||
@Schema(title = "商品")
|
||||
@Data
|
||||
public static class Product {
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1")
|
||||
@Schema(title = "商品 SPU 编号", required = true, example = "1")
|
||||
@NotNull(message = "商品 SPU 编号不能为空")
|
||||
private Long spuId;
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1")
|
||||
@Schema(title = "商品 SKU 编号", required = true, example = "1")
|
||||
@NotNull(message = "商品 SKU 编号不能为空")
|
||||
private Long skuId;
|
||||
|
||||
@ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@Schema(title = "优惠类型", required = true, example = "1", description = "参见 PromotionDiscountTypeEnum 枚举")
|
||||
@NotNull(message = "优惠类型不能为空")
|
||||
@InEnum(PromotionDiscountTypeEnum.class)
|
||||
private Integer discountType;
|
||||
|
||||
@ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80")
|
||||
@Schema(title = "折扣百分比", example = "80", description = "例如说,80% 为 80")
|
||||
private Integer discountPercent;
|
||||
|
||||
@ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分")
|
||||
@Schema(title = "优惠金额", example = "10", description = "单位:分")
|
||||
@Min(value = 0, message = "优惠金额需要大于等于 0")
|
||||
private Integer discountPrice;
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,7 +8,7 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 限时折扣活动创建 Request VO")
|
||||
@Schema(title = "管理后台 - 限时折扣活动创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 限时折扣活动的详细 Response VO")
|
||||
@Schema(title = "管理后台 - 限时折扣活动的详细 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -12,19 +11,19 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 限时折扣活动分页 Request VO")
|
||||
@Schema(title = "管理后台 - 限时折扣活动分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DiscountActivityPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "活动标题", example = "一个标题")
|
||||
@Schema(title = "活动标题", example = "一个标题")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "活动状态", example = "1")
|
||||
@Schema(title = "活动状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(title = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -9,20 +8,20 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 限时折扣活动 Response VO")
|
||||
@Schema(title = "管理后台 - 限时折扣活动 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DiscountActivityRespVO extends DiscountActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动编号", required = true, example = "1024")
|
||||
@Schema(title = "活动编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "活动状态", required = true, example = "1")
|
||||
@Schema(title = "活动状态", required = true, example = "1")
|
||||
@NotNull(message = "活动状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
@@ -11,13 +10,13 @@ import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 限时折扣活动更新 Request VO")
|
||||
@Schema(title = "管理后台 - 限时折扣活动更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DiscountActivityUpdateReqVO extends DiscountActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动编号", required = true, example = "1024")
|
||||
@Schema(title = "活动编号", required = true, example = "1024")
|
||||
@NotNull(message = "活动编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.reward.vo.RewardActivi
|
||||
import cn.iocoder.yudao.module.promotion.convert.reward.RewardActivityConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.reward.RewardActivityDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.reward.RewardActivityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -21,7 +21,7 @@ import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 满减送活动")
|
||||
@Tag(name = "管理后台 - 满减送活动")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/reward-activity")
|
||||
@Validated
|
||||
@@ -31,14 +31,14 @@ public class RewardActivityController {
|
||||
private RewardActivityService rewardActivityService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建满减送活动")
|
||||
@Operation(summary = "创建满减送活动")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:create')")
|
||||
public CommonResult<Long> createRewardActivity(@Valid @RequestBody RewardActivityCreateReqVO createReqVO) {
|
||||
return success(rewardActivityService.createRewardActivity(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新满减送活动")
|
||||
@Operation(summary = "更新满减送活动")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:update')")
|
||||
public CommonResult<Boolean> updateRewardActivity(@Valid @RequestBody RewardActivityUpdateReqVO updateReqVO) {
|
||||
rewardActivityService.updateRewardActivity(updateReqVO);
|
||||
@@ -46,8 +46,8 @@ public class RewardActivityController {
|
||||
}
|
||||
|
||||
@PutMapping("/close")
|
||||
@ApiOperation("关闭满减送活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "关闭满减送活动")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:close')")
|
||||
public CommonResult<Boolean> closeRewardActivity(@RequestParam("id") Long id) {
|
||||
rewardActivityService.closeRewardActivity(id);
|
||||
@@ -55,8 +55,8 @@ public class RewardActivityController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除满减送活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "删除满减送活动")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:delete')")
|
||||
public CommonResult<Boolean> deleteRewardActivity(@RequestParam("id") Long id) {
|
||||
rewardActivityService.deleteRewardActivity(id);
|
||||
@@ -64,8 +64,8 @@ public class RewardActivityController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得满减送活动")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得满减送活动")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:query')")
|
||||
public CommonResult<RewardActivityRespVO> getRewardActivity(@RequestParam("id") Long id) {
|
||||
RewardActivityDO rewardActivity = rewardActivityService.getRewardActivity(id);
|
||||
@@ -73,7 +73,7 @@ public class RewardActivityController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得满减送活动分页")
|
||||
@Operation(summary = "获得满减送活动分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:reward-activity:query')")
|
||||
public CommonResult<PageResult<RewardActivityRespVO>> getRewardActivityPage(@Valid RewardActivityPageReqVO pageVO) {
|
||||
PageResult<RewardActivityDO> pageResult = rewardActivityService.getRewardActivityPage(pageVO);
|
||||
|
@@ -4,8 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionConditionTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -26,35 +25,35 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
public class RewardActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动标题", required = true, example = "满啦满啦")
|
||||
@Schema(title = "活动标题", required = true, example = "满啦满啦")
|
||||
@NotNull(message = "活动标题不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
@Schema(title = "开始时间", required = true)
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间", required = true)
|
||||
@Schema(title = "结束时间", required = true)
|
||||
@NotNull(message = "结束时间不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Future(message = "结束时间必须大于当前时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "biubiubiu")
|
||||
@Schema(title = "备注", example = "biubiubiu")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "条件类型", required = true, example = "1")
|
||||
@Schema(title = "条件类型", required = true, example = "1")
|
||||
@NotNull(message = "条件类型不能为空")
|
||||
@InEnum(value = PromotionConditionTypeEnum.class, message = "条件类型必须是 {value}")
|
||||
private Integer conditionType;
|
||||
|
||||
@ApiModelProperty(value = "商品范围", required = true, example = "1")
|
||||
@Schema(title = "商品范围", required = true, example = "1")
|
||||
@NotNull(message = "商品范围不能为空")
|
||||
@InEnum(value = PromotionConditionTypeEnum.class, message = "商品范围必须是 {value}")
|
||||
private Integer productScope;
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,2,3")
|
||||
@Schema(title = "商品 SPU 编号的数组", example = "1,2,3")
|
||||
private List<Long> productSpuIds;
|
||||
|
||||
/**
|
||||
@@ -63,29 +62,29 @@ public class RewardActivityBaseVO {
|
||||
@Valid // 校验下子对象
|
||||
private List<Rule> rules;
|
||||
|
||||
@ApiModel("优惠规则")
|
||||
@Schema(title = "优惠规则")
|
||||
@Data
|
||||
public static class Rule {
|
||||
|
||||
@ApiModelProperty(value = "优惠门槛", required = true, example = "100", notes = "1. 满 N 元,单位:分; 2. 满 N 件")
|
||||
@Schema(title = "优惠门槛", required = true, example = "100", description = "1. 满 N 元,单位:分; 2. 满 N 件")
|
||||
@Min(value = 1L, message = "优惠门槛必须大于等于 1")
|
||||
private Integer limit;
|
||||
|
||||
@ApiModelProperty(value = "优惠价格", required = true, example = "100", notes = "单位:分")
|
||||
@Schema(title = "优惠价格", required = true, example = "100", description = "单位:分")
|
||||
@Min(value = 1L, message = "优惠价格必须大于等于 1")
|
||||
private Integer discountPrice;
|
||||
|
||||
@ApiModelProperty(value = "是否包邮", required = true, example = "true")
|
||||
@Schema(title = "是否包邮", required = true, example = "true")
|
||||
private Boolean freeDelivery;
|
||||
|
||||
@ApiModelProperty(value = "赠送的积分", required = true, example = "100")
|
||||
@Schema(title = "赠送的积分", required = true, example = "100")
|
||||
@Min(value = 1L, message = "赠送的积分必须大于等于 1")
|
||||
private Integer point;
|
||||
|
||||
@ApiModelProperty(value = "赠送的优惠劵编号的数组", example = "1,2,3")
|
||||
@Schema(title = "赠送的优惠劵编号的数组", example = "1,2,3")
|
||||
private List<Long> couponIds;
|
||||
|
||||
@ApiModelProperty(value = "赠送的优惠卷数量的数组", example = "1,2,3")
|
||||
@Schema(title = "赠送的优惠卷数量的数组", example = "1,2,3")
|
||||
private List<Integer> couponCounts;
|
||||
|
||||
@AssertTrue(message = "优惠劵和数量必须一一对应")
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 满减送活动创建 Request VO")
|
||||
@Schema(title = "管理后台 - 满减送活动创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
@@ -1,19 +1,18 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@ApiModel("管理后台 - 满减送活动分页 Request VO")
|
||||
@Schema(title = "管理后台 - 满减送活动分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RewardActivityPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "活动标题", example = "满啦满啦")
|
||||
@Schema(title = "活动标题", example = "满啦满啦")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "活动状态", example = "1")
|
||||
@Schema(title = "活动状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@@ -1,26 +1,25 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("管理后台 - 满减送活动 Response VO")
|
||||
@Schema(title = "管理后台 - 满减送活动 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RewardActivityRespVO extends RewardActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动编号", required = true, example = "1024")
|
||||
@Schema(title = "活动编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "活动状态", required = true, example = "1")
|
||||
@Schema(title = "活动状态", required = true, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 满减送活动更新 Request VO")
|
||||
@Schema(title = "管理后台 - 满减送活动更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RewardActivityUpdateReqVO extends RewardActivityBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "活动编号", required = true, example = "1024")
|
||||
@Schema(title = "活动编号", required = true, example = "1024")
|
||||
@NotNull(message = "活动编号不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -10,14 +10,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "用户 App - 营销")
|
||||
@Tag(name = "用户 App - 营销")
|
||||
@RestController
|
||||
@RequestMapping("/market/test")
|
||||
@Validated
|
||||
public class AppMarketTestController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获取 market 信息")
|
||||
@Operation(summary = "获取 market 信息")
|
||||
public CommonResult<String> get() {
|
||||
return success("true");
|
||||
}
|
||||
|
@@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerRespVO
|
||||
import cn.iocoder.yudao.module.promotion.convert.banner.BannerConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.banner.BannerService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -23,7 +23,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/market/banner")
|
||||
@Api(tags = "用户APP- 首页Banner")
|
||||
@Tag(name = "用户APP- 首页Banner")
|
||||
@Validated
|
||||
public class AppBannerController {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class AppBannerController {
|
||||
|
||||
// TODO @xia:新建一个 AppBannerRespVO,只返回必要的字段。status 要过滤下。然后 sort 下结果
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得banner列表")
|
||||
@Operation(summary = "获得banner列表")
|
||||
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
||||
public CommonResult<List<BannerRespVO>> getBannerList() {
|
||||
List<BannerDO> list = bannerService.getBannerList();
|
||||
|
@@ -1,23 +1,22 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.base.property;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("用户 App - 规格 + 规格值 Response VO")
|
||||
@Schema(title = "用户 App - 规格 + 规格值 Response VO")
|
||||
@Data
|
||||
public class AppProductPropertyValueDetailRespVO {
|
||||
|
||||
@ApiModelProperty(value = "属性的编号", required = true, example = "1")
|
||||
@Schema(title = "属性的编号", required = true, example = "1")
|
||||
private Long propertyId;
|
||||
|
||||
@ApiModelProperty(value = "属性的名称", required = true, example = "颜色")
|
||||
@Schema(title = "属性的名称", required = true, example = "颜色")
|
||||
private String propertyName;
|
||||
|
||||
@ApiModelProperty(value = "属性值的编号", required = true, example = "1024")
|
||||
@Schema(title = "属性值的编号", required = true, example = "1024")
|
||||
private Long valueId;
|
||||
|
||||
@ApiModelProperty(value = "属性值的名称", required = true, example = "红色")
|
||||
@Schema(title = "属性值的名称", required = true, example = "红色")
|
||||
private String valueName;
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.base.sku;
|
||||
|
||||
import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -14,16 +14,16 @@ import java.util.List;
|
||||
@Data
|
||||
public class AppProductSkuBaseRespVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1024")
|
||||
@Schema(title = "主键", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 名字", required = true, example = "芋道")
|
||||
@Schema(title = "商品 SKU 名字", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "图片地址", example = "https://www.iocoder.cn/xx.png")
|
||||
@Schema(title = "图片地址", example = "https://www.iocoder.cn/xx.png")
|
||||
private String picUrl;
|
||||
|
||||
@ApiModelProperty(value = "库存", required = true, example = "1")
|
||||
@Schema(title = "库存", required = true, example = "1")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.base.spu;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -13,13 +12,13 @@ import java.util.List;
|
||||
@Data
|
||||
public class AppProductSpuBaseRespVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true, example = "1024")
|
||||
@Schema(title = "主键", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "商品 SPU 名字", required = true, example = "芋道")
|
||||
@Schema(title = "商品 SPU 名字", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商品主图地址", example = "https://www.iocoder.cn/xx.png")
|
||||
@Schema(title = "商品主图地址", example = "https://www.iocoder.cn/xx.png")
|
||||
private List<String> picUrls;
|
||||
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemAddC
|
||||
import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemUpdateCountReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemUpdateSelectedReqVO;
|
||||
import cn.iocoder.yudao.module.trade.service.cart.TradeCartService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Api(tags = "用户 App - 购物车")
|
||||
@Tag(name = "用户 App - 购物车")
|
||||
@RestController
|
||||
@RequestMapping("/trade/cart")
|
||||
@RequiredArgsConstructor
|
||||
@@ -34,7 +34,7 @@ public class TradeCartController {
|
||||
private TradeCartService cartService;
|
||||
|
||||
@PostMapping("/add-count")
|
||||
@ApiOperation("添加商品到购物车")
|
||||
@Operation(summary = "添加商品到购物车")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> addCartItemCount(@Valid @RequestBody AppTradeCartItemAddCountReqVO addCountReqVO) {
|
||||
cartService.addCartItemCount(getLoginUserId(), addCountReqVO);
|
||||
@@ -42,7 +42,7 @@ public class TradeCartController {
|
||||
}
|
||||
|
||||
@PutMapping("update-count")
|
||||
@ApiOperation("更新购物车商品数量")
|
||||
@Operation(summary = "更新购物车商品数量")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> updateCartItemQuantity(@Valid @RequestBody AppTradeCartItemUpdateCountReqVO updateCountReqVO) {
|
||||
cartService.updateCartItemCount(getLoginUserId(), updateCountReqVO);
|
||||
@@ -50,7 +50,7 @@ public class TradeCartController {
|
||||
}
|
||||
|
||||
@PutMapping("update-selected")
|
||||
@ApiOperation("更新购物车商品是否选中")
|
||||
@Operation(summary = "更新购物车商品是否选中")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> updateCartItemSelected(@Valid @RequestBody AppTradeCartItemUpdateSelectedReqVO updateSelectedReqVO) {
|
||||
cartService.updateCartItemSelected(getLoginUserId(), updateSelectedReqVO);
|
||||
@@ -59,8 +59,8 @@ public class TradeCartController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除购物车商品")
|
||||
@ApiImplicitParam(name = "skuIds", value = "商品 SKU 编号的数组", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@Operation(summary = "删除购物车商品")
|
||||
@Parameter(name = "skuIds", description = "商品 SKU 编号的数组", required = true, example = "1024,2048")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> deleteCartItem(@RequestParam("skuIds") List<Long> skuIds) {
|
||||
cartService.deleteCartItems(getLoginUserId(), skuIds);
|
||||
@@ -68,14 +68,14 @@ public class TradeCartController {
|
||||
}
|
||||
|
||||
@GetMapping("get-count")
|
||||
@ApiOperation("查询用户在购物车中的商品数量")
|
||||
@Operation(summary = "查询用户在购物车中的商品数量")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Integer> getCartCount() {
|
||||
return success(cartService.getCartCount(getLoginUserId()));
|
||||
}
|
||||
|
||||
@GetMapping("/get-detail")
|
||||
@ApiOperation("查询用户的购物车的详情")
|
||||
@Operation(summary = "查询用户的购物车的详情")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppTradeCartDetailRespVO> getCartDetail() {
|
||||
return success(cartService.getCartDetail(getLoginUserId()));
|
||||
|
@@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.cart.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.trade.controller.app.base.sku.AppProductSkuBaseRespVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "用户 App - 用户的购物车明细 Response VO")
|
||||
@Schema(title = "用户 App - 用户的购物车明细 Response VO")
|
||||
@Data
|
||||
public class AppTradeCartDetailRespVO {
|
||||
|
||||
@@ -21,7 +20,7 @@ public class AppTradeCartDetailRespVO {
|
||||
*/
|
||||
private Order order;
|
||||
|
||||
@ApiModel(value = "商品分组", description = "多个商品,参加同一个活动,从而形成分组")
|
||||
@Schema(title = "商品分组", description = "多个商品,参加同一个活动,从而形成分组")
|
||||
@Data
|
||||
public static class ItemGroup {
|
||||
|
||||
@@ -36,7 +35,7 @@ public class AppTradeCartDetailRespVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel(value = "商品 SKU")
|
||||
@Schema(title = "商品 SKU")
|
||||
@Data
|
||||
public static class Sku extends AppProductSkuBaseRespVO {
|
||||
|
||||
@@ -47,26 +46,26 @@ public class AppTradeCartDetailRespVO {
|
||||
|
||||
// ========== 购物车相关的字段 ==========
|
||||
|
||||
@ApiModelProperty(value = "商品数量", required = true, example = "1")
|
||||
@Schema(title = "商品数量", required = true, example = "1")
|
||||
private Integer count;
|
||||
@ApiModelProperty(value = "是否选中", required = true, example = "true")
|
||||
@Schema(title = "是否选中", required = true, example = "true")
|
||||
private Boolean selected;
|
||||
|
||||
// ========== 价格相关的字段,对应 PriceCalculateRespDTO.OrderItem 的属性 ==========
|
||||
|
||||
// TODO 芋艿:后续可以去除一些无用的字段
|
||||
|
||||
@ApiModelProperty(value = "商品原价(单)", required = true, example = "100")
|
||||
@Schema(title = "商品原价(单)", required = true, example = "100")
|
||||
private Integer originalPrice;
|
||||
@ApiModelProperty(value = "商品原价(总)", required = true, example = "200")
|
||||
@Schema(title = "商品原价(总)", required = true, example = "200")
|
||||
private Integer totalOriginalPrice;
|
||||
@ApiModelProperty(value = "商品级优惠(总)", required = true, example = "300")
|
||||
@Schema(title = "商品级优惠(总)", required = true, example = "300")
|
||||
private Integer totalPromotionPrice;
|
||||
@ApiModelProperty(value = "最终购买金额(总)", required = true, example = "400")
|
||||
@Schema(title = "最终购买金额(总)", required = true, example = "400")
|
||||
private Integer totalPresentPrice;
|
||||
@ApiModelProperty(value = "最终购买金额(单)", required = true, example = "500")
|
||||
@Schema(title = "最终购买金额(单)", required = true, example = "500")
|
||||
private Integer presentPrice;
|
||||
@ApiModelProperty(value = "应付金额(总)", required = true, example = "600")
|
||||
@Schema(title = "应付金额(总)", required = true, example = "600")
|
||||
private Integer totalPayPrice;
|
||||
|
||||
// ========== 营销相关的字段 ==========
|
||||
@@ -77,40 +76,40 @@ public class AppTradeCartDetailRespVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel(value = "订单", description = "对应 PriceCalculateRespDTO.Order 类,用于费用(合计)")
|
||||
@Schema(title = "订单", description = "对应 PriceCalculateRespDTO.Order 类,用于费用(合计)")
|
||||
@Data
|
||||
public static class Order {
|
||||
|
||||
// TODO 芋艿:后续可以去除一些无用的字段
|
||||
|
||||
@ApiModelProperty(value = "商品原价(总)", required = true, example = "100")
|
||||
@Schema(title = "商品原价(总)", required = true, example = "100")
|
||||
private Integer skuOriginalPrice;
|
||||
@ApiModelProperty(value = "商品优惠(总)", required = true, example = "200")
|
||||
@Schema(title = "商品优惠(总)", required = true, example = "200")
|
||||
private Integer skuPromotionPrice;
|
||||
@ApiModelProperty(value = "订单优惠(总)", required = true, example = "300")
|
||||
@Schema(title = "订单优惠(总)", required = true, example = "300")
|
||||
private Integer orderPromotionPrice;
|
||||
@ApiModelProperty(value = "运费金额", required = true, example = "400")
|
||||
@Schema(title = "运费金额", required = true, example = "400")
|
||||
private Integer deliveryPrice;
|
||||
@ApiModelProperty(value = "应付金额(总)", required = true, example = "500")
|
||||
@Schema(title = "应付金额(总)", required = true, example = "500")
|
||||
private Integer payPrice;
|
||||
|
||||
}
|
||||
|
||||
@ApiModel(value = "营销活动", description = "对应 PriceCalculateRespDTO.Promotion 类的属性")
|
||||
@Schema(title = "营销活动", description = "对应 PriceCalculateRespDTO.Promotion 类的属性")
|
||||
@Data
|
||||
public static class Promotion {
|
||||
|
||||
@ApiModelProperty(value = "营销编号", required = true, example = "1024", notes = "营销活动的编号、优惠劵的编号")
|
||||
@Schema(title = "营销编号", required = true, example = "1024", description = "营销活动的编号、优惠劵的编号")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "营销名字", required = true, example = "xx 活动")
|
||||
@Schema(title = "营销名字", required = true, example = "xx 活动")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "营销类型", required = true, example = "1", notes = "参见 PromotionTypeEnum 枚举类")
|
||||
@Schema(title = "营销类型", required = true, example = "1", description = "参见 PromotionTypeEnum 枚举类")
|
||||
private Integer type;
|
||||
|
||||
// ========== 匹配情况 ==========
|
||||
@ApiModelProperty(value = "是否满足优惠条件", required = true, example = "true")
|
||||
@Schema(title = "是否满足优惠条件", required = true, example = "true")
|
||||
private Boolean meet;
|
||||
@ApiModelProperty(value = "满足条件的提示", required = true, example = "圣诞价:省 150.00 元")
|
||||
@Schema(title = "满足条件的提示", required = true, example = "圣诞价:省 150.00 元")
|
||||
private String meetTip;
|
||||
|
||||
}
|
||||
|
@@ -1,21 +1,20 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.cart.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel(value = "用户 App - 购物车添加购物项 Request VO")
|
||||
@Schema(title = "用户 App - 购物车添加购物项 Request VO")
|
||||
@Data
|
||||
public class AppTradeCartItemAddCountReqVO {
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 编号", required = true,example = "1024")
|
||||
@Schema(title = "商品 SKU 编号", required = true,example = "1024")
|
||||
@NotNull(message = "商品 SKU 编号不能为空")
|
||||
private Long skuId;
|
||||
|
||||
@ApiModelProperty(value = "商品数量", required = true, example = "1", notes = "注意,这是新增数量")
|
||||
@Schema(title = "商品数量", required = true, example = "1", description = "注意,这是新增数量")
|
||||
@NotNull(message = "数量不能为空")
|
||||
@Min(message = "数量必须大于 0", value = 1L)
|
||||
private Integer count;
|
||||
|
@@ -1,21 +1,20 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.cart.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel(value = "用户 App - 购物车更新数量 Request VO")
|
||||
@Schema(title = "用户 App - 购物车更新数量 Request VO")
|
||||
@Data
|
||||
public class AppTradeCartItemUpdateCountReqVO {
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1024")
|
||||
@Schema(title = "商品 SKU 编号", required = true, example = "1024")
|
||||
@NotNull(message = "商品 SKU 编号不能为空")
|
||||
private Long skuId;
|
||||
|
||||
@ApiModelProperty(value = "商品数量", required = true, example = "1")
|
||||
@Schema(title = "商品数量", required = true, example = "1")
|
||||
@NotNull(message = "数量不能为空")
|
||||
@Min(message = "数量必须大于 0", value = 1L)
|
||||
private Integer count;
|
||||
|
@@ -1,21 +1,20 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.cart.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
|
||||
@ApiModel(value = "用户 App - 购物车更新是否选中 Request VO")
|
||||
@Schema(title = "用户 App - 购物车更新是否选中 Request VO")
|
||||
@Data
|
||||
public class AppTradeCartItemUpdateSelectedReqVO {
|
||||
|
||||
@ApiModelProperty(value = "商品 SKU 编号列表", required = true, example = "1024,2048")
|
||||
@Schema(title = "商品 SKU 编号列表", required = true, example = "1024,2048")
|
||||
@NotNull(message = "商品 SKU 编号列表不能为空")
|
||||
private Collection<Long> skuIds;
|
||||
|
||||
@ApiModelProperty(value = "是否选中", required = true, example = "true")
|
||||
@Schema(title = "是否选中", required = true, example = "true")
|
||||
@NotNull(message = "是否选中不能为空")
|
||||
private Boolean selected;
|
||||
|
||||
|
@@ -10,9 +10,9 @@ import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderGetCre
|
||||
import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderPageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderRespVO;
|
||||
import cn.iocoder.yudao.module.trade.service.order.TradeOrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Api(tags = "用户 App - 交易订单")
|
||||
@Tag(name = "用户 App - 交易订单")
|
||||
@RestController
|
||||
@RequestMapping("/trade/order")
|
||||
@RequiredArgsConstructor // TODO @LeeYan9: 先统一使用 @Resource 注入哈; 项目只有三层, 依赖注入会存在, 所以使用 @Resource; 也因此, 最好全局保持一致
|
||||
@@ -31,7 +31,7 @@ public class AppTradeOrderController {
|
||||
private final TradeOrderService tradeOrderService;
|
||||
|
||||
@GetMapping("/get-create-info")
|
||||
@ApiOperation("基于商品,确认创建订单")
|
||||
@Operation(summary = "基于商品,确认创建订单")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppTradeOrderGetCreateInfoRespVO> getTradeOrderCreateInfo(AppTradeOrderCreateReqVO createReqVO) {
|
||||
// return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId));
|
||||
@@ -39,7 +39,7 @@ public class AppTradeOrderController {
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建订单")
|
||||
@Operation(summary = "创建订单")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Long> createTradeOrder(@RequestBody AppTradeOrderCreateReqVO createReqVO,
|
||||
HttpServletRequest servletRequest) {
|
||||
@@ -52,15 +52,15 @@ public class AppTradeOrderController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得交易订单")
|
||||
@ApiImplicitParam(name = "tradeOrderId", value = "交易订单编号", required = true, dataTypeClass = Long.class)
|
||||
@Operation(summary = "获得交易订单")
|
||||
@Parameter(name = "tradeOrderId", description = "交易订单编号", required = true)
|
||||
public CommonResult<TradeOrderRespVO> getTradeOrder(@RequestParam("tradeOrderId") Integer tradeOrderId) {
|
||||
// return success(tradeOrderService.getTradeOrder(tradeOrderId));
|
||||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得订单交易分页")
|
||||
@Operation(summary = "获得订单交易分页")
|
||||
public CommonResult<PageResult<TradeOrderRespVO>> pageTradeOrder(TradeOrderPageReqVO pageVO) {
|
||||
// return success(tradeOrderService.pageTradeOrder(UserSecurityContextHolder.getUserId(), pageVO));
|
||||
return null;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
@@ -9,21 +8,21 @@ import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "用户 App - 交易订单创建 Request VO")
|
||||
@Schema(title = "用户 App - 交易订单创建 Request VO")
|
||||
@Data
|
||||
public class AppTradeOrderCreateReqVO {
|
||||
|
||||
@ApiModelProperty(name = "收件地址编号", required = true, example = "1")
|
||||
@Schema(name = "收件地址编号", required = true, example = "1")
|
||||
@NotNull(message = "收件地址不能为空")
|
||||
private Long addressId;
|
||||
|
||||
@ApiModelProperty(name = "优惠劵编号", example = "1024")
|
||||
@Schema(name = "优惠劵编号", example = "1024")
|
||||
private Long couponId;
|
||||
|
||||
@ApiModelProperty(name = "备注", example = "这个是我的订单哟")
|
||||
@Schema(name = "备注", example = "这个是我的订单哟")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "是否来自购物车", required = true, example = "true", notes = "true - 来自购物车;false - 立即购买")
|
||||
@Schema(name = "是否来自购物车", required = true, example = "true", description = "true - 来自购物车;false - 立即购买")
|
||||
@NotNull(message = "是否来自购物车不能为空")
|
||||
private Boolean fromCart;
|
||||
|
||||
@@ -33,15 +32,15 @@ public class AppTradeOrderCreateReqVO {
|
||||
@NotEmpty(message = "必须选择购买的商品")
|
||||
private List<Item> items;
|
||||
|
||||
@ApiModel(value = "订单商品项")
|
||||
@Schema(title = "订单商品项")
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@ApiModelProperty(name = "商品 SKU 编号", required = true, example = "111")
|
||||
@Schema(name = "商品 SKU 编号", required = true, example = "111")
|
||||
@NotNull(message = "商品 SKU 编号不能为空")
|
||||
private Long skuId;
|
||||
|
||||
@ApiModelProperty(name = "商品 SKU 购买数量", required = true, example = "1024")
|
||||
@Schema(name = "商品 SKU 购买数量", required = true, example = "1024")
|
||||
@NotNull(message = "商品 SKU 购买数量不能为空")
|
||||
@Min(value = 1, message = "商品 SKU 购买数量必须大于 0")
|
||||
private Integer count;
|
||||
|
@@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "用户 App - 订单获得创建信息 Response VO")
|
||||
@Schema(title = "用户 App - 订单获得创建信息 Response VO")
|
||||
@Data
|
||||
public class AppTradeOrderGetCreateInfoRespVO {
|
||||
|
||||
@@ -25,7 +24,7 @@ public class AppTradeOrderGetCreateInfoRespVO {
|
||||
// */
|
||||
// private List<CouponCardAvailableRespDTO> coupons;
|
||||
|
||||
@ApiModel(value = "商品分组", description = "多个商品,参加同一个活动,从而形成分组")
|
||||
@Schema(title = "商品分组", description = "多个商品,参加同一个活动,从而形成分组")
|
||||
@Data
|
||||
public static class ItemGroup {
|
||||
|
||||
@@ -40,12 +39,12 @@ public class AppTradeOrderGetCreateInfoRespVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel("商品 SKU")
|
||||
@Schema(title = "商品 SKU")
|
||||
@Data
|
||||
public static class Sku {
|
||||
|
||||
// SKU 自带信息
|
||||
@ApiModelProperty(value = "SKU 编号", required = true, example = "1024")
|
||||
@Schema(title = "SKU 编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
/**
|
||||
* SPU 信息
|
||||
@@ -140,12 +139,12 @@ public class AppTradeOrderGetCreateInfoRespVO {
|
||||
|
||||
}
|
||||
|
||||
@ApiModel("费用(合计)")
|
||||
@Schema(title = "费用(合计)")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Fee {
|
||||
|
||||
@ApiModelProperty(value = "购买总价", required = true, example = "1024")
|
||||
@Schema(title = "购买总价", required = true, example = "1024")
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 优惠总价
|
||||
|
@@ -1,52 +1,51 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("交易订单项 Response VO")
|
||||
@Schema(title = "交易订单项 Response VO")
|
||||
@Data
|
||||
public class TradeOrderItemRespVO {
|
||||
|
||||
@ApiModelProperty(value = "id自增长", required = true)
|
||||
@Schema(title = "id自增长", required = true)
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "订单编号", required = true)
|
||||
@Schema(title = "订单编号", required = true)
|
||||
private Integer orderId;
|
||||
@ApiModelProperty(value = "订单项状态", required = true)
|
||||
@Schema(title = "订单项状态", required = true)
|
||||
private Integer status;
|
||||
@ApiModelProperty(value = "商品 SKU 编号", required = true)
|
||||
@Schema(title = "商品 SKU 编号", required = true)
|
||||
private Integer skuId;
|
||||
@ApiModelProperty(value = "商品 SPU 编号", required = true)
|
||||
@Schema(title = "商品 SPU 编号", required = true)
|
||||
private Integer spuId;
|
||||
@ApiModelProperty(value = "商品名字", required = true)
|
||||
@Schema(title = "商品名字", required = true)
|
||||
private String skuName;
|
||||
@ApiModelProperty(value = "图片名字", required = true)
|
||||
@Schema(title = "图片名字", required = true)
|
||||
private String skuImage;
|
||||
@ApiModelProperty(value = "商品数量", required = true)
|
||||
@Schema(title = "商品数量", required = true)
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(value = "原始单价,单位:分", required = true)
|
||||
@Schema(title = "原始单价,单位:分", required = true)
|
||||
private Integer originPrice;
|
||||
@ApiModelProperty(value = "购买单价,单位:分", required = true)
|
||||
@Schema(title = "购买单价,单位:分", required = true)
|
||||
private Integer buyPrice;
|
||||
@ApiModelProperty(value = "最终价格,单位:分", required = true)
|
||||
@Schema(title = "最终价格,单位:分", required = true)
|
||||
private Integer presentPrice;
|
||||
@ApiModelProperty(value = "购买总金额,单位:分", required = true)
|
||||
@Schema(title = "购买总金额,单位:分", required = true)
|
||||
private Integer buyTotal;
|
||||
@ApiModelProperty(value = "优惠总金额,单位:分", required = true)
|
||||
@Schema(title = "优惠总金额,单位:分", required = true)
|
||||
private Integer discountTotal;
|
||||
@ApiModelProperty(value = "最终总金额,单位:分", required = true)
|
||||
@Schema(title = "最终总金额,单位:分", required = true)
|
||||
private Integer presentTotal;
|
||||
@ApiModelProperty(value = "退款总金额,单位:分", required = true)
|
||||
@Schema(title = "退款总金额,单位:分", required = true)
|
||||
private Integer refundTotal;
|
||||
@ApiModelProperty(value = "物流id")
|
||||
@Schema(title = "物流id")
|
||||
private Integer logisticsId;
|
||||
@ApiModelProperty(value = "售后状态", required = true)
|
||||
@Schema(title = "售后状态", required = true)
|
||||
private Integer afterSaleStatus;
|
||||
@ApiModelProperty(value = "售后订单编号")
|
||||
@Schema(title = "售后订单编号")
|
||||
private Integer afterSaleOrderId;
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
|
@@ -1,17 +1,16 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("交易订单分页 Request VO")
|
||||
@Schema(title = "交易订单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TradeOrderPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举")
|
||||
@Schema(title = "订单状态", example = "1", description = "参见 TradeOrderStatusEnum 枚举")
|
||||
private Integer orderStatus;
|
||||
|
||||
}
|
||||
|
@@ -1,64 +1,63 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@ApiModel("订单交易 Response VO")
|
||||
@Schema(title = "订单交易 Response VO")
|
||||
@Data
|
||||
public class TradeOrderRespVO {
|
||||
|
||||
@ApiModelProperty(value = "订单编号", required = true)
|
||||
@Schema(title = "订单编号", required = true)
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "用户编号", required = true)
|
||||
@Schema(title = "用户编号", required = true)
|
||||
private Integer userId;
|
||||
@ApiModelProperty(value = "订单单号", required = true)
|
||||
@Schema(title = "订单单号", required = true)
|
||||
private String orderNo;
|
||||
@ApiModelProperty(value = "订单状态", required = true)
|
||||
@Schema(title = "订单状态", required = true)
|
||||
private Integer orderStatus;
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(title = "备注")
|
||||
private String remark;
|
||||
@ApiModelProperty(value = "订单结束时间")
|
||||
@Schema(title = "订单结束时间")
|
||||
private LocalDateTime endTime;
|
||||
@ApiModelProperty(value = "订单金额(总金额),单位:分", required = true)
|
||||
@Schema(title = "订单金额(总金额),单位:分", required = true)
|
||||
private Integer buyPrice;
|
||||
@ApiModelProperty(value = "优惠总金额,单位:分", required = true)
|
||||
@Schema(title = "优惠总金额,单位:分", required = true)
|
||||
private Integer discountPrice;
|
||||
@ApiModelProperty(value = "物流金额,单位:分", required = true)
|
||||
@Schema(title = "物流金额,单位:分", required = true)
|
||||
private Integer logisticsPrice;
|
||||
@ApiModelProperty(value = "最终金额,单位:分", required = true)
|
||||
@Schema(title = "最终金额,单位:分", required = true)
|
||||
private Integer presentPrice;
|
||||
@ApiModelProperty(value = "支付金额,单位:分", required = true)
|
||||
@Schema(title = "支付金额,单位:分", required = true)
|
||||
private Integer payPrice;
|
||||
@ApiModelProperty(value = "退款金额,单位:分", required = true)
|
||||
@Schema(title = "退款金额,单位:分", required = true)
|
||||
private Integer refundPrice;
|
||||
@ApiModelProperty(value = "付款时间")
|
||||
@Schema(title = "付款时间")
|
||||
private LocalDateTime payTime;
|
||||
@ApiModelProperty(value = "支付订单编号")
|
||||
@Schema(title = "支付订单编号")
|
||||
private Integer payTransactionId;
|
||||
@ApiModelProperty(value = "支付渠道")
|
||||
@Schema(title = "支付渠道")
|
||||
private Integer payChannel;
|
||||
@ApiModelProperty(value = "配送类型", required = true)
|
||||
@Schema(title = "配送类型", required = true)
|
||||
private Integer deliveryType;
|
||||
@ApiModelProperty(value = "发货时间")
|
||||
@Schema(title = "发货时间")
|
||||
private LocalDateTime deliveryTime;
|
||||
@ApiModelProperty(value = "收货时间")
|
||||
@Schema(title = "收货时间")
|
||||
private LocalDateTime receiveTime;
|
||||
@ApiModelProperty(value = "收件人名称", required = true)
|
||||
@Schema(title = "收件人名称", required = true)
|
||||
private String receiverName;
|
||||
@ApiModelProperty(value = "手机号", required = true)
|
||||
@Schema(title = "手机号", required = true)
|
||||
private String receiverMobile;
|
||||
@ApiModelProperty(value = "地区编码", required = true)
|
||||
@Schema(title = "地区编码", required = true)
|
||||
private Integer receiverAreaCode;
|
||||
@ApiModelProperty(value = "收件详细地址", required = true)
|
||||
@Schema(title = "收件详细地址", required = true)
|
||||
private String receiverDetailAddress;
|
||||
@ApiModelProperty(value = "售后状态", required = true)
|
||||
@Schema(title = "售后状态", required = true)
|
||||
private Integer afterSaleStatus;
|
||||
@ApiModelProperty(value = "优惠劵编号")
|
||||
@Schema(title = "优惠劵编号")
|
||||
private Integer couponCardId;
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
@Schema(title = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user