修改
This commit is contained in:
parent
baac64a6ee
commit
9f73670aa8
@ -9,9 +9,9 @@ import (
|
|||||||
"micro-bundle/pkg/msg"
|
"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)
|
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 {
|
if err != nil {
|
||||||
res.Msg = msg.ErrorCreateBundleInfo
|
res.Msg = msg.ErrorCreateBundleInfo
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorCreateBundleInfo, "创建套餐信息失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorCreateBundleInfo, "创建套餐信息失败: ")
|
||||||
@ -20,9 +20,9 @@ func CreateBundle(bundle *model.BundleProfile) (res *bundle.CommonResponse, err
|
|||||||
return
|
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)
|
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 {
|
if err != nil {
|
||||||
res.Msg = msg.ErrorUpdateBundleInfo
|
res.Msg = msg.ErrorUpdateBundleInfo
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
||||||
|
Loading…
Reference in New Issue
Block a user