fix:mall vo @Schema required = true => requiredMode = Schema.RequiredMode.REQUIRED

This commit is contained in:
puhui999 2023-06-21 08:41:45 +08:00
parent 700d95a43d
commit 666925da6e
33 changed files with 171 additions and 177 deletions

View File

@ -5,17 +5,16 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
// TODO @puhui999class 类的开始和结束都要有一个空行哈
@Schema(description = "管理后台 - 品牌精简信息 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductBrandSimpleRespVO {
@Schema(description = "品牌编号", required = true, example = "1024")
@Schema(description = "品牌编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "品牌名称", required = true, example = "苹果")
@Schema(description = "品牌名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "苹果")
private String name;
}

View File

@ -20,16 +20,16 @@ import java.util.List;
@ToString(callSuper = true)
public class ProductSpuDetailRespVO extends ProductSpuBaseVO {
@Schema(description = "商品 SPU 编号", required = true, example = "1212")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1212")
private Long id;
@Schema(description = "商品销量", required = true, example = "10000")
@Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
private Integer salesCount;
@Schema(description = "浏览量", required = true, example = "20000")
@Schema(description = "浏览量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20000")
private Integer browseCount;
@Schema(description = "商品状态", required = true, example = "1")
@Schema(description = "商品状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
// ========== SKU 相关字段 =========

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -51,7 +50,7 @@ public class ProductSpuPageReqVO extends PageParam {
@Schema(description = "商品名称", example = "清凉小短袖")
private String name;
@Schema(description = "前端请求的tab类型", required = true, example = "1")
@Schema(description = "前端请求的tab类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer tabType;
@Schema(description = "商品分类编号", example = "1")

View File

@ -1,16 +1,11 @@
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 商品 SPU Status 更新 Request VO
@ -21,11 +16,11 @@ import java.util.List;
@Data
public class ProductSpuUpdateStatusReqVO{
@Schema(description = "商品编号", required = true, example = "1")
@Schema(description = "商品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "商品编号不能为空")
private Long id;
@Schema(description = "商品状态", required = true, example = "1")
@Schema(description = "商品状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "商品状态不能为空")
@InEnum(ProductSpuStatusEnum.class)
private Integer status;

View File

@ -9,40 +9,40 @@ import java.util.List;
@Data
public class AppProductSpuPageRespVO {
@Schema(description = "商品 SPU 编号", required = true, example = "1")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "商品名称", required = true, example = "芋道")
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String name;
@Schema(description = "分类编号", required = true)
@Schema(description = "分类编号", requiredMode = Schema.RequiredMode.REQUIRED)
private Long categoryId;
@Schema(description = "商品封面图", required = true)
@Schema(description = "商品封面图", requiredMode = Schema.RequiredMode.REQUIRED)
private String picUrl;
@Schema(description = "商品轮播图", required = true)
@Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED)
private List<String> sliderPicUrls;
// ========== SKU 相关字段 =========
@Schema(description = "规格类型", required = true, example = "true")
@Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean specType;
@Schema(description = "商品价格,单位使用:分", required = true, example = "1024")
@Schema(description = "商品价格,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Integer price;
@Schema(description = "库存", required = true, example = "666")
@Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
private Integer stock;
// ========== 营销相关字段 =========
@Schema(description = "活动排序数组", required = true, example = "1024")
@Schema(description = "活动排序数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private List<Integer> activityOrders;
// ========== 统计相关字段 =========
@Schema(description = "商品销量", required = true, example = "1024")
@Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Integer salesCount;
}

View File

@ -82,4 +82,5 @@ public interface ProductCommentConvert {
ProductCommentDO convert(ProductCommentCreateReqVO createReq);
List<AppProductCommentRespVO> convertList02(List<ProductCommentDO> list);
}

View File

@ -9,19 +9,20 @@ import java.time.LocalDateTime;
@Data
public class AppActivityRespVO {
@Schema(description = "活动编号", required = true, example = "1024")
@Schema(description = "活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "活动类型", required = true, example = "1") // 对应 PromotionTypeEnum 枚举
@Schema(description = "活动类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
// 对应 PromotionTypeEnum 枚举
private Integer type;
@Schema(description = "活动名称", required = true, example = "618 大促")
@Schema(description = "活动名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "618 大促")
private String name;
@Schema(description = "活动开始时间", required = true)
@Schema(description = "活动开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime startTime;
@Schema(description = "活动结束时间", required = true)
@Schema(description = "活动结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime endTime;
}

View File

@ -10,28 +10,28 @@ import java.util.List;
@Data
public class AppCombinationActivityDetailRespVO {
@Schema(description = "拼团活动编号", required = true, example = "1024")
@Schema(description = "拼团活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "拼团活动名称", required = true, example = "618 大拼团")
@Schema(description = "拼团活动名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "618 大拼团")
private String name;
@Schema(description = "活动状态", required = true, example = "1")
@Schema(description = "活动状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
@Schema(description = "活动开始时间", required = true)
@Schema(description = "活动开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime startTime;
@Schema(description = "活动结束时间", required = true)
@Schema(description = "活动结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime endTime;
@Schema(description = "拼团人数", required = true, example = "3")
@Schema(description = "拼团人数", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
private Integer userSize;
@Schema(description = "成功的拼团数量", required = true, example = "100")
@Schema(description = "成功的拼团数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer successCount;
@Schema(description = "商品 SPU 编号", required = true, example = "2048")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long spuId;
@Schema(description = "总共限购数量", example = "10")
@ -40,17 +40,17 @@ public class AppCombinationActivityDetailRespVO {
@Schema(description = "单次限购数量", example = "5")
private Integer singleLimitCount;
@Schema(description = "商品信息数组", required = true)
@Schema(description = "商品信息数组", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Product> products;
@Schema(description = "商品信息")
@Data
public static class Product {
@Schema(description = "商品 SKU 编号", required = true, example = "4096")
@Schema(description = "商品 SKU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
private Long skuId;
@Schema(description = "拼团金额,单位:分", required = true, example = "100")
@Schema(description = "拼团金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer combinationPrice;
}

View File

@ -7,25 +7,28 @@ import lombok.Data;
@Data
public class AppCombinationActivityRespVO {
@Schema(description = "拼团活动编号", required = true, example = "1024")
@Schema(description = "拼团活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "拼团活动名称", required = true, example = "618 大拼团")
@Schema(description = "拼团活动名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "618 大拼团")
private String name;
@Schema(description = "拼团人数", required = true, example = "3")
@Schema(description = "拼团人数", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
private Integer userSize;
@Schema(description = "商品 SPU 编号", required = true, example = "2048")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long spuId;
@Schema(description = "商品图片", required = true, example = "4096") // SPU picUrl 读取
@Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
// SPU picUrl 读取
private String picUrl;
@Schema(description = "商品市场价,单位:分", required = true, example = "50") // SPU marketPrice 读取
@Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
// SPU marketPrice 读取
private Integer marketPrice;
@Schema(description = "拼团金额,单位:分", required = true, example = "100") // 从拼团商品里取最低价
@Schema(description = "拼团金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
// 从拼团商品里取最低价
private Integer combinationPrice;
}

View File

@ -9,13 +9,14 @@ import java.util.List;
@Data
public class AppCombinationRecordDetailRespVO {
@Schema(description = "团长的拼团记录", required = true)
@Schema(description = "团长的拼团记录", requiredMode = Schema.RequiredMode.REQUIRED)
private AppCombinationRecordRespVO headRecord;
@Schema(description = "成员的拼团记录", required = true)
@Schema(description = "成员的拼团记录", requiredMode = Schema.RequiredMode.REQUIRED)
private List<AppCombinationRecordRespVO> memberRecords;
@Schema(description = "当前用户参团记录对应的订单编号", required = true, example = "1024") // 如果没参团返回 null
@Schema(description = "当前用户参团记录对应的订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
// 如果没参团返回 null
private Long orderId;
}

View File

@ -9,37 +9,37 @@ import java.util.Date;
@Data
public class AppCombinationRecordRespVO {
@Schema(description = "拼团记录编号", required = true, example = "1024")
@Schema(description = "拼团记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "拼团活动编号", required = true, example = "1024")
@Schema(description = "拼团活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long activityId;
@Schema(description = "用户昵称", required = true, example = "1024")
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private String nickname;
@Schema(description = "用户头像", required = true, example = "1024")
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private String avatar;
@Schema(description = "过期时间", required = true)
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date expireTime;
@Schema(description = "可参团人数", required = true, example = "10")
@Schema(description = "可参团人数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer userSize;
@Schema(description = "已参团人数", required = true, example = "5")
@Schema(description = "已参团人数", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
private Integer userCount;
@Schema(description = "拼团状态", required = true, example = "1")
@Schema(description = "拼团状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
@Schema(description = "商品名字", required = true, example = "我是大黄豆")
@Schema(description = "商品名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "我是大黄豆")
private String spuName;
@Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png")
@Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
private String picUrl;
@Schema(description = "拼团金额,单位:分", required = true, example = "100")
@Schema(description = "拼团金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer combinationPrice;
}

View File

@ -9,10 +9,10 @@ import java.util.List;
@Data
public class AppCombinationRecordSummaryRespVO {
@Schema(description = "拼团用户数量", required = true, example = "1024")
@Schema(description = "拼团用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Integer userCount;
@Schema(description = "拼团用户头像列表", required = true) // 只返回最近的 7
@Schema(description = "拼团用户头像列表", requiredMode = Schema.RequiredMode.REQUIRED) // 只返回最近的 7
private List<String> avatars;
}

View File

@ -10,27 +10,28 @@ import java.time.LocalDateTime;
@Data
public class AppCouponTemplateRespVO {
@Schema(description = "优惠劵模板编号", required = true, example = "1")
@Schema(description = "优惠劵模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "优惠劵名", required = true, example = "春节送送送")
@Schema(description = "优惠劵名", requiredMode = Schema.RequiredMode.REQUIRED, example = "春节送送送")
private String name;
@Schema(description = "每人限领个数", required = true, example = "66") // -1 - 则表示不限制
@Schema(description = "每人限领个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "66") // -1 - 则表示不限制
private Integer takeLimitCount;
@Schema(description = "是否设置满多少金额可用", required = true, example = "100") // 单位0 - 不限制
@Schema(description = "是否设置满多少金额可用", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
// 单位0 - 不限制
private Integer usePrice;
// TODO 芋艿这两要改的
// @Schema(description = "商品范围", required = true, example = "1")
// @Schema(description = "商品范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
// @InEnum(PromotionProductScopeEnum.class)
// private Integer productScope;
//
// @Schema(description = "商品 SPU 编号的数组", example = "1,3")
// private List<Long> productSpuIds;
@Schema(description = "生效日期类型", required = true, example = "1")
@Schema(description = "生效日期类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer validityType;
@Schema(description = "固定日期 - 生效开始时间")
@ -47,7 +48,7 @@ public class AppCouponTemplateRespVO {
@Min(value = 1L, message = "开始天数必须大于 1")
private Integer fixedEndTerm;
@Schema(description = "优惠类型", required = true, example = "1")
@Schema(description = "优惠类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer discountType;
@Schema(description = "折扣百分比", example = "80") // 例如说80% 80
@ -62,7 +63,7 @@ public class AppCouponTemplateRespVO {
// ========== 用户相关字段 ==========
@Schema(description = "是否已领取", required = true, example = "true")
@Schema(description = "是否已领取", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean takeStatus;
}

View File

@ -10,24 +10,24 @@ import java.util.List;
@Data
public class AppSeckillActivityDetailRespVO {
@Schema(description = "秒杀活动编号", required = true, example = "1024")
@Schema(description = "秒杀活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "秒杀活动名称", required = true, example = "晚九点限时秒杀")
@Schema(description = "秒杀活动名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晚九点限时秒杀")
private String name;
@Schema(description = "活动状态", required = true, example = "1")
@Schema(description = "活动状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
// TODO @芋艿开始时间结束时间要和场次结合起来就是要算到当前场次是几点哈
@Schema(description = "活动开始时间", required = true)
@Schema(description = "活动开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime startTime;
@Schema(description = "活动结束时间", required = true)
@Schema(description = "活动结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime endTime;
@Schema(description = "商品 SPU 编号", required = true, example = "2048")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long spuId;
@Schema(description = "总共限购数量", example = "10")
@ -36,26 +36,26 @@ public class AppSeckillActivityDetailRespVO {
@Schema(description = "单次限购数量", example = "5")
private Integer singleLimitCount;
@Schema(description = "秒杀库存(剩余)", required = true, example = "50")
@Schema(description = "秒杀库存(剩余)", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
private Integer stock;
@Schema(description = "秒杀库存(总计)", required = true, example = "100")
@Schema(description = "秒杀库存(总计)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer totalStock;
@Schema(description = "商品信息数组", required = true)
@Schema(description = "商品信息数组", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Product> products;
@Schema(description = "商品信息")
@Data
public static class Product {
@Schema(description = "商品 SKU 编号", required = true, example = "4096")
@Schema(description = "商品 SKU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
private Long skuId;
@Schema(description = "秒杀金额,单位:分", required = true, example = "100")
@Schema(description = "秒杀金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer seckillPrice;
@Schema(description = "秒杀限量库存", required = true, example = "50")
@Schema(description = "秒杀限量库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
private Integer stock;
}

View File

@ -10,10 +10,10 @@ import java.util.List;
@Data
public class AppSeckillActivityNowRespVO {
@Schema(description = "秒杀时间段", required = true)
@Schema(description = "秒杀时间段", requiredMode = Schema.RequiredMode.REQUIRED)
private AppSeckillConfigRespVO config;
@Schema(description = "秒杀活动数组", required = true)
@Schema(description = "秒杀活动数组", requiredMode = Schema.RequiredMode.REQUIRED)
private List<AppSeckillActivityRespVO> activities;
}

View File

@ -7,28 +7,31 @@ import lombok.Data;
@Data
public class AppSeckillActivityRespVO {
@Schema(description = "秒杀活动编号", required = true, example = "1024")
@Schema(description = "秒杀活动编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "秒杀活动名称", required = true, example = "晚九点限时秒杀")
@Schema(description = "秒杀活动名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晚九点限时秒杀")
private String name;
@Schema(description = "商品 SPU 编号", required = true, example = "2048")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long spuId;
@Schema(description = "商品图片", required = true, example = "4096") // SPU picUrl 读取
@Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
// SPU picUrl 读取
private String picUrl;
@Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private String unitName;
@Schema(description = "商品市场价,单位:分", required = true, example = "50") // SPU marketPrice 读取
@Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
// SPU marketPrice 读取
private Integer marketPrice;
@Schema(description = "秒杀库存(剩余)", required = true, example = "100")
@Schema(description = "秒杀库存(剩余)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer stock;
@Schema(description = "秒杀库存(总共)", required = true, example = "200")
@Schema(description = "秒杀库存(总共)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer totalStock;
@Schema(description = "秒杀金额,单位:分", required = true, example = "100") // 从秒杀商品里取最低价
@Schema(description = "秒杀金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
// 从秒杀商品里取最低价
private Integer seckillPrice;
}

View File

@ -9,15 +9,15 @@ import java.util.List;
@Data
public class AppSeckillConfigRespVO {
@Schema(description = "秒杀时间段编号", required = true, example = "1024")
@Schema(description = "秒杀时间段编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "开始时间点", required = true, example = "09:00")
@Schema(description = "开始时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "09:00")
private String startTime;
@Schema(description = "结束时间点", required = true, example = "09:59")
@Schema(description = "结束时间点", requiredMode = Schema.RequiredMode.REQUIRED, example = "09:59")
private String endTime;
@Schema(description = "轮播图", required = true)
@Schema(description = "轮播图", requiredMode = Schema.RequiredMode.REQUIRED)
private List<String> sliderPicUrls;
}

View File

@ -12,22 +12,22 @@ import javax.validation.constraints.NotNull;
@Data
public class DeliveryExpressBaseVO {
@Schema(description = "快递公司编码", required = true)
@Schema(description = "快递公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "快递公司编码不能为空")
private String code;
@Schema(description = "快递公司名称", required = true, example = "李四")
@Schema(description = "快递公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@NotNull(message = "快递公司名称不能为空")
private String name;
@Schema(description = "快递公司logo")
private String logo;
@Schema(description = "排序", required = true)
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "排序不能为空")
private Integer sort;
@Schema(description = "状态", required = true, example = "1")
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空")
private Integer status;

View File

@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 快递公司 Response VO")
@ -10,10 +13,10 @@ import java.time.LocalDateTime;
@ToString(callSuper = true)
public class DeliveryExpressRespVO extends DeliveryExpressBaseVO {
@Schema(description = "编号", required = true, example = "6592")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6592")
private Long id;
@Schema(description = "创建时间", required = true)
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -13,7 +13,7 @@ import javax.validation.constraints.NotNull;
@ToString(callSuper = true)
public class DeliveryExpressUpdateReqVO extends DeliveryExpressBaseVO {
@Schema(description = "编号", required = true, example = "6592")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6592")
@NotNull(message = "编号不能为空")
private Long id;

View File

@ -12,15 +12,15 @@ import javax.validation.constraints.NotNull;
@Data
public class DeliveryExpressTemplateBaseVO {
@Schema(description = "模板名称", required = true, example = "王五")
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotNull(message = "模板名称不能为空")
private String name;
@Schema(description = "配送计费方式 1:按件 2:按重量 3:按体积", required = true)
@Schema(description = "配送计费方式 1:按件 2:按重量 3:按体积", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "配送计费方式 1:按件 2:按重量 3:按体积不能为空")
private Integer chargeMode;
@Schema(description = "排序", required = true)
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "排序不能为空")
private Integer sort;

View File

@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstemplate;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 快递运费模板 Response VO")
@ -10,10 +13,10 @@ import java.time.LocalDateTime;
@ToString(callSuper = true)
public class DeliveryExpressTemplateRespVO extends DeliveryExpressTemplateBaseVO {
@Schema(description = "编号,自增", required = true, example = "371")
@Schema(description = "编号,自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "371")
private Long id;
@Schema(description = "创建时间", required = true)
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -12,10 +12,10 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class DeliveryExpressTemplateSimpleRespVO {
@Schema(description = "模版编号", required = true, example = "1024")
@Schema(description = "模版编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "模板名称", required = true, example = "测试模版")
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试模版")
private String name;
}

View File

@ -15,7 +15,7 @@ import java.util.List;
@ToString(callSuper = true)
public class DeliveryExpressTemplateUpdateReqVO extends DeliveryExpressTemplateBaseVO {
@Schema(description = "编号", required = true, example = "371")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "371")
@NotNull(message = "编号不能为空")
private Long id;

View File

@ -18,49 +18,49 @@ import java.time.LocalTime;
@Data
public class DeliveryPickUpStoreBaseVO {
@Schema(description = "门店名称", required = true, example = "李四")
@Schema(description = "门店名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@NotBlank(message = "门店名称不能为空")
private String name;
@Schema(description = "门店简介", example = "我是门店简介")
private String introduction;
@Schema(description = "门店手机", required = true, example = "15601892312")
@Schema(description = "门店手机", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601892312")
@NotBlank(message = "门店手机不能为空")
@Mobile
private String phone;
@Schema(description = "区域编号", required = true, example = "18733")
@Schema(description = "区域编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18733")
@NotNull(message = "区域编号不能为空")
private Integer areaId;
@Schema(description = "门店详细地址", required = true, example = "复旦大学路 188 号")
@Schema(description = "门店详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "复旦大学路 188 号")
@NotBlank(message = "门店详细地址不能为空")
private String detailAddress;
@Schema(description = "门店 logo", required = true, example = "https://www.iocoder.cn/1.png")
@Schema(description = "门店 logo", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
@NotBlank(message = "门店 logo 不能为空")
private String logo;
@Schema(description = "营业开始时间", required = true)
@Schema(description = "营业开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "营业开始时间不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
private LocalTime openingTime;
@Schema(description = "营业结束时间", required = true)
@Schema(description = "营业结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "营业结束时间不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
private LocalTime closingTime;
@Schema(description = "纬度", required = true, example = "5.88")
@Schema(description = "纬度", requiredMode = Schema.RequiredMode.REQUIRED, example = "5.88")
@NotNull(message = "纬度不能为空")
private Double latitude;
@Schema(description = "经度", required = true, example = "6.99")
@Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED, example = "6.99")
@NotNull(message = "经度不能为空")
private Double longitude;
@Schema(description = "门店状态", required = true, example = "1")
@Schema(description = "门店状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "门店状态不能为空")
@InEnum(CommonStatusEnum.class)
private Integer status;

View File

@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 自提门店 Response VO")
@ -10,10 +13,10 @@ import java.time.LocalDateTime;
@ToString(callSuper = true)
public class DeliveryPickUpStoreRespVO extends DeliveryPickUpStoreBaseVO {
@Schema(description = "编号", required = true, example = "23128")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23128")
private Long id;
@Schema(description = "创建时间", required = true)
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 自提门店更新 Request VO")
@Data
@ -11,7 +13,7 @@ import javax.validation.constraints.*;
@ToString(callSuper = true)
public class DeliveryPickUpStoreUpdateReqVO extends DeliveryPickUpStoreBaseVO {
@Schema(description = "编号", required = true, example = "23128")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23128")
@NotNull(message = "编号不能为空")
private Long id;

View File

@ -36,7 +36,7 @@ public class AppTradeAfterSaleCreateReqVO {
/**
* @see AfterSaleStatusEnum
*/
@Schema(description = "操作类型", required = true, example = "1")
@Schema(description = "操作类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "操作类型不能为空")
private String operateType;

View File

@ -11,48 +11,48 @@ import java.util.List;
@Data
public class AppTradeAfterSalePageItemRespVO {
@Schema(description = "售后编号", required = true, example = "1024")
@Schema(description = "售后编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "售后流水号", required = true, example = "1146347329394184195")
@Schema(description = "售后流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1146347329394184195")
private String no;
@Schema(description = "售后状态", required = true, example = "1")
@Schema(description = "售后状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status;
@Schema(description = "售后方式", required = true, example = "1")
@Schema(description = "售后方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer way;
@Schema(description = "售后类型", required = true, example = "1")
@Schema(description = "售后类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer type;
@Schema(description = "申请原因", required = true, example = "1")
@Schema(description = "申请原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String applyReason;
@Schema(description = "补充描述", required = true, example = "1")
@Schema(description = "补充描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String applyDescription;
@Schema(description = "补充凭证图片", required = true, example = "1")
@Schema(description = "补充凭证图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private List<String> applyPicUrls;
// ========== 交易订单相关 ==========
@Schema(description = "交易订单编号", required = true, example = "1")
@Schema(description = "交易订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long orderId;
@Schema(description = "交易订单流水号", required = true, example = "1")
@Schema(description = "交易订单流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String orderNo;
@Schema(description = "交易订单项编号", required = true, example = "1")
@Schema(description = "交易订单项编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long orderItemId;
@Schema(description = "商品 SPU 编号", required = true, example = "1")
@Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long spuId;
@Schema(description = "商品 SPU 名称", required = true, example = "1")
@Schema(description = "商品 SPU 名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String spuName;
@Schema(description = "商品 SKU 编号", required = true, example = "1")
@Schema(description = "商品 SKU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long skuId;
/**
@ -60,10 +60,10 @@ public class AppTradeAfterSalePageItemRespVO {
*/
private List<AppProductPropertyValueDetailRespVO> properties;
@Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/01.jpg")
@Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/01.jpg")
private String picUrl;
@Schema(description = "退货商品数量", required = true, example = "1")
@Schema(description = "退货商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer count;
// ========== 审批相关 ==========

View File

@ -17,7 +17,7 @@ public class AppTradeCartAddReqVO {
@NotNull(message = "数量不能为空")
private Integer count;
@Schema(description = "是否添加到购物车", required = true, example = "true")
@Schema(description = "是否添加到购物车", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否添加购物车不能为空")
private Boolean addStatus;

View File

@ -25,10 +25,10 @@ public class AppTradeCartListRespVO {
@Data
public static class Cart {
@Schema(description = "购物项的编号", required = true, example = "1024")
@Schema(description = "购物项的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "商品数量", required = true, example = "1")
@Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer count;
/**

View File

@ -10,11 +10,11 @@ import javax.validation.constraints.NotNull;
@Data
public class AppTradeCartUpdateReqVO {
@Schema(description = "编号", required = true, example = "1024")
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "编号不能为空")
private Long id;
@Schema(description = "商品数量", required = true, example = "1")
@Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "数量不能为空")
@Min(message = "数量必须大于 0", value = 1L)
private Integer count;

View File

@ -6,9 +6,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.core.KeyValue;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.member.api.address.AddressApi;
@ -25,9 +23,7 @@ import cn.iocoder.yudao.module.promotion.api.coupon.CouponApi;
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponUseReqDTO;
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
import cn.iocoder.yudao.module.system.api.notify.dto.NotifyTemplateReqDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.enums.notify.NotifyTemplateTypeEnum;
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO;
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO;
@ -357,28 +353,12 @@ public class TradeOrderServiceImpl implements TradeOrderService {
// TODO 芋艿发送订单变化的消息
// TODO 芋艿发送站内信 fix
// TODO @puhui999使用 sendSingleMessageToMember 走模版不用判断模版是否存在哈
// 1获取模版编码为 order_delivery 的模版判断是否存在 存在放回 true
if (!notifyMessageSendApi.validateNotifyTemplate("order_delivery")) {
// 11 站内信模版不存在则创建模版
NotifyTemplateReqDTO templateReqDTO = new NotifyTemplateReqDTO();
templateReqDTO.setName("订单发货通知模版");
templateReqDTO.setCode("order_delivery");
templateReqDTO.setType(NotifyTemplateTypeEnum.NOTIFICATION_MESSAGE.getType()); // 系统消息
// 获取操作用户
// AdminUserRespDTO user = adminUserApi.getUser(userId);
// templateReqDTO.setNickname(user.getNickname());
templateReqDTO.setNickname(UserTypeEnum.ADMIN.getName());
templateReqDTO.setContent("订单:{orderId}{msg}");
templateReqDTO.setStatus(CommonStatusEnum.ENABLE.getStatus());
notifyMessageSendApi.createNotifyTemplate(templateReqDTO);
}
// 2构造消息
// 1构造消息
Map<String, Object> msgMap = new HashMap<>();
msgMap.put("orderId", deliveryReqVO.getId());
msgMap.put("msg", TradeOrderStatusEnum.DELIVERED.getStatus());
// 2发送站内信
notifyMessageSendApi.sendSingleMessageToAdmin(
notifyMessageSendApi.sendSingleMessageToMember(
new NotifySendSingleToUserReqDTO()
.setUserId(userId)
.setTemplateCode("order_delivery")