This commit is contained in:
蒋海成 2025-02-22 18:53:35 +08:00
parent baac64a6ee
commit 9f73670aa8

View File

@ -9,9 +9,9 @@ import (
"micro-bundle/pkg/msg"
)
func CreateBundle(bundle *model.BundleProfile) (res *bundle.CommonResponse, err error) {
func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Create(&bundle).Error
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Create(&req).Error
if err != nil {
res.Msg = msg.ErrorCreateBundleInfo
return res, commonErr.ReturnError(err, msg.ErrorCreateBundleInfo, "创建套餐信息失败: ")
@ -20,9 +20,9 @@ func CreateBundle(bundle *model.BundleProfile) (res *bundle.CommonResponse, err
return
}
func UpdateBundle(bundle *model.BundleProfile) (res *bundle.CommonResponse, err error) {
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", bundle.UUID).Updates(bundle).Error
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", req.UUID).Updates(req).Error
if err != nil {
res.Msg = msg.ErrorUpdateBundleInfo
return res, commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")