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;
- }
}
}