修复(#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:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"`
|
||||||
|
|||||||
Reference in New Issue
Block a user