修改
This commit is contained in:
parent
d18adaac6c
commit
9f490bb725
@ -1,7 +1,6 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jinzhu/copier"
|
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -101,11 +100,23 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
|
|||||||
|
|
||||||
func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
|
func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
|
||||||
res = new(bundle.BundleProfile)
|
res = new(bundle.BundleProfile)
|
||||||
bundle := new(model.BundleProfile)
|
bundleProfile := new(model.BundleProfile)
|
||||||
err = app.ModuleClients.BundleDB.Where("uuid = ?", uuid).First(&bundle).Error
|
err = app.ModuleClients.BundleDB.Where("uuid = ?", uuid).First(&bundleProfile).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorGetBundleInfo, "获取套餐信息失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorGetBundleInfo, "获取套餐信息失败: ")
|
||||||
}
|
}
|
||||||
_ = copier.CopyWithOption(&res, bundle, copier.Option{DeepCopy: true})
|
//_ = copier.CopyWithOption(&res, bundle, copier.Option{DeepCopy: true})
|
||||||
|
|
||||||
|
res = &bundle.BundleProfile{
|
||||||
|
Uuid: bundleProfile.UUID,
|
||||||
|
Name: bundleProfile.Name,
|
||||||
|
Price: bundleProfile.Price,
|
||||||
|
PriceType: bundleProfile.PriceType,
|
||||||
|
Contract: bundleProfile.Contract,
|
||||||
|
Content: bundleProfile.Content,
|
||||||
|
Language: bundleProfile.Language,
|
||||||
|
CreatedAt: bundleProfile.CreatedAt.String(),
|
||||||
|
UpdatedAt: bundleProfile.UpdatedAt.String(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user