fix: 修复商品克重保存问题

- schema添加Weight字段
- Create和Update处理中添加Weight字段支持

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 21:51:34 +08:00
parent 321681e2ea
commit c1145113aa
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -30,6 +30,7 @@ type CreateProductRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Price float64 `json:"price" binding:"gte=0"`
Weight float64 `json:"weight"`
MinPurchase int `json:"min_purchase"`
MaxPurchase *int `json:"max_purchase"`
MinWeight *float64 `json:"min_weight"`
@@ -49,6 +50,7 @@ type UpdateProductRequest struct {
Name *string `json:"name"`
Description *string `json:"description"`
Price *float64 `json:"price"`
Weight *float64 `json:"weight"`
MinPurchase *int `json:"min_purchase"`
MaxPurchase *int `json:"max_purchase"`
MinWeight *float64 `json:"min_weight"`