From 52d9baf2e6d744e7ac910c1f84184040cba1bbee Mon Sep 17 00:00:00 2001 From: sxy <3187870250@qq.com> Date: Mon, 23 Jun 2025 16:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=B8=8B=E6=9E=B6?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/bundleLogic.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/logic/bundleLogic.go b/internal/logic/bundleLogic.go index e5f81e1..2aba609 100644 --- a/internal/logic/bundleLogic.go +++ b/internal/logic/bundleLogic.go @@ -336,9 +336,21 @@ func HandleShelf(req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err if req.ShelfStatus != 1 && req.ShelfStatus != 2 { return res, errors.New("状态值无效") } + detail, err := dao.GetBundleDetailByUuid(req.Uuid) + if err != nil { + return res, errors.New("获取套餐信息失败") + } + if detail.ShelfStatus == req.ShelfStatus { + if detail.ShelfStatus == 1 { + return res, errors.New("套餐已上架,请勿重复操作") + } + if detail.ShelfStatus == 2 { + return res, errors.New("套餐已下架,请勿重复操作") + } + } bundleDetailLangs, err := dao.GetBundleLangsByUuid(req.Uuid) if err != nil { - return res, errors.New("查询套餐失败") + return res, errors.New("获取套餐信息失败") } var langToPriceType = make(map[string]int64) for _, bundleLang := range bundleDetailLangs {