refactor(sale): 修改销售产品结构体字段类型

- 将 ChangeProductItem 中的 SaleCount 和 SalePrice 字段改为指针类型
- 将 ChangeProduct 中的 SaleCount 和 SalePrice 字段改为指针类型
- 保持其他字段类型不变以维持兼容性
- 通过指针类型支持空值处理场景
This commit is contained in:
2026-09-09 15:17:09 +08:00
parent 4e267eee3b
commit 7f7adc5cd7
2 changed files with 11 additions and 11 deletions

View File

@@ -55,9 +55,9 @@ type ArgsAuditChange struct {
Products []ChangeProductItem // 产品信息 Products []ChangeProductItem // 产品信息
} }
type ChangeProductItem struct { type ChangeProductItem struct {
Id int64 // 产品id Id int64 // 产品id
SaleCount int64 // 销售数量 SaleCount *int64 // 销售数量
SalePrice decimal.Decimal // 销售单价 SalePrice *decimal.Decimal // 销售单价
} }
// Change @TITLE 编辑商品审核 // Change @TITLE 编辑商品审核

View File

@@ -16,14 +16,14 @@ type ArgsChangeAllSearch struct {
WorkflowId int64 // 审核id WorkflowId int64 // 审核id
} }
type ChangeProduct struct { type ChangeProduct struct {
Id int64 `json:"id"` Id int64 `json:"id"`
SaleProductID int64 `json:"saleProductID"` SaleProductID int64 `json:"saleProductID"`
BeforeSaleCount int64 `json:"beforeSaleCount"` BeforeSaleCount int64 `json:"beforeSaleCount"`
SaleCount int64 `json:"saleCount"` SaleCount *int64 `json:"saleCount"`
BeforeSalePrice decimal.Decimal `json:"beforeSalePrice"` BeforeSalePrice decimal.Decimal `json:"beforeSalePrice"`
SalePrice decimal.Decimal `json:"salePrice"` SalePrice *decimal.Decimal `json:"salePrice"`
CreatedAt *time.Time `json:"createdAt"` CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"` UpdatedAt *time.Time `json:"updatedAt"`
} }
// All @TITLE 获取产品 // All @TITLE 获取产品