diff --git a/internal/dao/bundleDao.go b/internal/dao/bundleDao.go index 1f4ed6b..56793bf 100644 --- a/internal/dao/bundleDao.go +++ b/internal/dao/bundleDao.go @@ -1,7 +1,6 @@ package dao import ( - "github.com/jinzhu/copier" "micro-bundle/internal/model" "micro-bundle/pb/bundle" "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) { res = new(bundle.BundleProfile) - bundle := new(model.BundleProfile) - err = app.ModuleClients.BundleDB.Where("uuid = ?", uuid).First(&bundle).Error + bundleProfile := new(model.BundleProfile) + err = app.ModuleClients.BundleDB.Where("uuid = ?", uuid).First(&bundleProfile).Error if err != nil { 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 }