From 2c1ee78bc4501f2dbf7ead960a2a57453454b080 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Fri, 17 Jul 2026 01:03:42 -0700 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(#4):=20=E5=A5=96=E5=93=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9=20type?= =?UTF-8?q?=EF=BC=88=E5=8E=9F=E6=9D=A5=20type=20=E8=A2=AB=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E5=BF=BD=E7=95=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UpdateLotteryPrize 之前可改字段漏了 type,导致 PUT 带 type 不生效、 只能删了重建。补上 UpdateAdminLotteryPrizeRequest.Type + fields["type"]。 Co-Authored-By: Claude Opus 4.8 (1M context) --- internal/logic/admin/lottery/lottery.go | 3 +++ internal/types/lottery.go | 1 + 2 files changed, 4 insertions(+) diff --git a/internal/logic/admin/lottery/lottery.go b/internal/logic/admin/lottery/lottery.go index db24309..3413605 100644 --- a/internal/logic/admin/lottery/lottery.go +++ b/internal/logic/admin/lottery/lottery.go @@ -518,6 +518,9 @@ func (l *UpdateLotteryPrizeLogic) UpdateLotteryPrize(req *types.UpdateAdminLotte if req.Slot != nil { fields["slot"] = *req.Slot } + if req.Type != "" { + fields["type"] = req.Type + } if req.Name != "" { fields["name"] = req.Name } diff --git a/internal/types/lottery.go b/internal/types/lottery.go index bfec706..2ea88b6 100644 --- a/internal/types/lottery.go +++ b/internal/types/lottery.go @@ -266,6 +266,7 @@ type CreateAdminLotteryPrizeRequest struct { type UpdateAdminLotteryPrizeRequest struct { Id int64 `path:"id" json:"-" validate:"required"` Slot *int `json:"slot,omitempty"` + Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` IconUrl string `json:"icon_url,omitempty"` Config json.RawMessage `json:"config,omitempty"`