From c25a92777e7f47597295aff52dc02c90a55c3672 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sat, 9 Nov 2024 15:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=AB=AF=E7=94=A8=E6=88=B7=E5=88=9B=E5=BB=BA=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/capital/OrderItemMainInfoAddRequest.java | 4 ++++ .../dto/order/capital/OrderMainInfoAddRequest.java | 13 +++++++++++++ .../service/good/impl/CartRecordServiceImpl.java | 5 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderItemMainInfoAddRequest.java b/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderItemMainInfoAddRequest.java index 3f7cb9a..5dfae5f 100644 --- a/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderItemMainInfoAddRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderItemMainInfoAddRequest.java @@ -1,23 +1,27 @@ package com.cultural.heritage.model.dto.order.capital; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serial; import java.io.Serializable; @Data +@Schema(description = "订单明细主要信息请求体", requiredProperties = {"goodId", "quantity"}) public class OrderItemMainInfoAddRequest implements Serializable { /** * 商品id */ + @Schema(description = "商品id(id > 0)", example = "8") private Long goodId; /** * 购买 */ + @Schema(description = "购买数量", example = "10") private Integer quantity; diff --git a/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderMainInfoAddRequest.java b/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderMainInfoAddRequest.java index a1fb60f..d7196d5 100644 --- a/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderMainInfoAddRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/order/capital/OrderMainInfoAddRequest.java @@ -1,5 +1,6 @@ package com.cultural.heritage.model.dto.order.capital; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serial; @@ -7,63 +8,75 @@ import java.io.Serializable; import java.util.List; @Data +@Schema(description = "订单主要信息请求体", requiredProperties = {"userId", "userName", "orderNumber", "addressId", "contactsId", +"couponId", "totalAmount", "orderStatus", "note", "orderItemMainInfoAddRequestList"}) public class OrderMainInfoAddRequest implements Serializable { /** * 用户id */ + @Schema(description = "用户id(id > 0)", example = "2") private Long userId; /** * 用户昵称 */ + @Schema(description = "用户昵称", example = "Hello") private String userName; /** * 订单编号 */ + @Schema(description = "订单编号", example = "1432442845453453") private String orderNumber; /** * 地址id */ + @Schema(description = "地址id(id > 0)", example = "12") private Long addressId; /** * 联系人id */ + @Schema(description = "联系人id(id > 0)", example = "3") private Long contactsId; /** * 优惠券id */ + @Schema(description = "优惠券id(id > 0)", example = "2") private Long couponId; /** * 订单总金额 */ + @Schema(description = "订单总金额", example = "560") private Double totalAmount; /** * 订单状态 */ + @Schema(description = "订单状态", example = "已支付") private String orderStatus; /** * 订单备注 */ + @Schema(description = "订单备注", example = "希望能完整体验非遗文化,保持产品原貌,妥善包装") private String note; /** * 订单主要明细信息 */ + @Schema(description = "订单主要明细信息") private List orderItemMainInfoAddRequestList; diff --git a/src/main/java/com/cultural/heritage/service/good/impl/CartRecordServiceImpl.java b/src/main/java/com/cultural/heritage/service/good/impl/CartRecordServiceImpl.java index 7689b84..1d5f337 100644 --- a/src/main/java/com/cultural/heritage/service/good/impl/CartRecordServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/good/impl/CartRecordServiceImpl.java @@ -43,8 +43,9 @@ public class CartRecordServiceImpl extends ServiceImpl