fix: 修复商品克重保存问题
- schema添加Weight字段 - Create和Update处理中添加Weight字段支持 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -236,6 +236,7 @@ func (h *ProductHandler) Create(c *gin.Context) {
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
Price: req.Price,
|
||||
Weight: req.Weight,
|
||||
MinPurchase: req.MinPurchase,
|
||||
MaxPurchase: req.MaxPurchase,
|
||||
MinWeight: req.MinWeight,
|
||||
@@ -299,6 +300,9 @@ func (h *ProductHandler) Update(c *gin.Context) {
|
||||
if req.Price != nil {
|
||||
updates["price"] = *req.Price
|
||||
}
|
||||
if req.Weight != nil {
|
||||
updates["weight"] = *req.Weight
|
||||
}
|
||||
if req.MinPurchase != nil {
|
||||
updates["min_purchase"] = *req.MinPurchase
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user