修复(#4): 奖品更新支持修改 type(原来 type 被静默忽略)

UpdateLotteryPrize 之前可改字段漏了 type,导致 PUT 带 type 不生效、
只能删了重建。补上 UpdateAdminLotteryPrizeRequest.Type + fields["type"]。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-17 01:03:42 -07:00
parent 13bafd5847
commit 2c1ee78bc4
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -518,6 +518,9 @@ func (l *UpdateLotteryPrizeLogic) UpdateLotteryPrize(req *types.UpdateAdminLotte
if req.Slot != nil { if req.Slot != nil {
fields["slot"] = *req.Slot fields["slot"] = *req.Slot
} }
if req.Type != "" {
fields["type"] = req.Type
}
if req.Name != "" { if req.Name != "" {
fields["name"] = req.Name fields["name"] = req.Name
} }
+1
View File
@@ -266,6 +266,7 @@ type CreateAdminLotteryPrizeRequest struct {
type UpdateAdminLotteryPrizeRequest struct { type UpdateAdminLotteryPrizeRequest struct {
Id int64 `path:"id" json:"-" validate:"required"` Id int64 `path:"id" json:"-" validate:"required"`
Slot *int `json:"slot,omitempty"` Slot *int `json:"slot,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
IconUrl string `json:"icon_url,omitempty"` IconUrl string `json:"icon_url,omitempty"`
Config json.RawMessage `json:"config,omitempty"` Config json.RawMessage `json:"config,omitempty"`