From 614570a2447a677d31a24923790e2a181fb48199 Mon Sep 17 00:00:00 2001 From: Agent Date: Tue, 24 Mar 2026 12:11:56 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80Lombok=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=A7=A3=E5=86=B3=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + .../building/dto/CreateOrderRequest.java | 70 ++----------------- 2 files changed, 5 insertions(+), 66 deletions(-) diff --git a/pom.xml b/pom.xml index 23a1756..db68978 100644 --- a/pom.xml +++ b/pom.xml @@ -79,6 +79,7 @@ org.projectlombok lombok + 1.18.30 true diff --git a/src/main/java/com/example/building/dto/CreateOrderRequest.java b/src/main/java/com/example/building/dto/CreateOrderRequest.java index a8adcdf..66f58e9 100644 --- a/src/main/java/com/example/building/dto/CreateOrderRequest.java +++ b/src/main/java/com/example/building/dto/CreateOrderRequest.java @@ -1,5 +1,7 @@ package com.example.building.dto; +import lombok.Data; + import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @@ -13,6 +15,7 @@ import java.util.List; * 2. 计算优惠金额(discount_amount) = total_amount × (100 - discount_rate) / 100 * 3. 计算实付金额(actual_amount) = total_amount - discount_amount */ +@Data public class CreateOrderRequest { /** @@ -41,50 +44,10 @@ public class CreateOrderRequest { */ private String paymentMethod; - // Getters and Setters - public String getCustomerId() { - return customerId; - } - - public void setCustomerId(String customerId) { - this.customerId = customerId; - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public BigDecimal getDiscountRate() { - return discountRate; - } - - public void setDiscountRate(BigDecimal discountRate) { - this.discountRate = discountRate; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPaymentMethod() { - return paymentMethod; - } - - public void setPaymentMethod(String paymentMethod) { - this.paymentMethod = paymentMethod; - } - /** * 订单明细项DTO */ + @Data public static class OrderItemDTO { /** * 商品ID @@ -102,30 +65,5 @@ public class CreateOrderRequest { * 销售单价(用户可自定义) */ private BigDecimal price; - - // Getters and Setters - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } } }