Updata:增加中间数据结构
This commit is contained in:
parent
1ff83504c2
commit
5fef6272c3
@ -3,6 +3,7 @@ package logic
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"micro-bundle/internal/dao"
|
"micro-bundle/internal/dao"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
@ -24,13 +25,14 @@ func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("获取问卷信息失败")
|
return nil, errors.New("获取问卷信息失败")
|
||||||
}
|
}
|
||||||
bundleInfo := &bundle.SurveyBundleInfo{}
|
bundleInfo := &model.DbBundleInfo{}
|
||||||
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
|
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("反序列化失败")
|
return nil, errors.New("反序列化失败")
|
||||||
}
|
}
|
||||||
|
fmt.Println("获取套餐名称:", bundleInfo.BundleName)
|
||||||
resp.UserName = data.UserName
|
resp.UserName = data.UserName
|
||||||
resp.BundleInfo = bundleInfo
|
resp.BundleInfo = &bundle.SurveyBundleInfo{}
|
||||||
resp.BundleInfo.BundleName = bundleInfo.BundleName
|
resp.BundleInfo.BundleName = bundleInfo.BundleName
|
||||||
resp.BundleInfo.StartAt = bundleInfo.StartAt
|
resp.BundleInfo.StartAt = bundleInfo.StartAt
|
||||||
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt
|
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt
|
||||||
|
|||||||
@ -60,3 +60,15 @@ type UserInfo struct {
|
|||||||
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
|
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
|
||||||
UserTel string `gorm:"column:user_tel;not null;comment:用户电话" json:"user_tel"`
|
UserTel string `gorm:"column:user_tel;not null;comment:用户电话" json:"user_tel"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DbBundleInfo struct {
|
||||||
|
BundleName string `json:"bundle_name"`
|
||||||
|
StartAt string `json:"start_at"`
|
||||||
|
ExpiredAt string `json:"expired_at"`
|
||||||
|
BundleAccountNumber int32 `json:"bundle_account_number"`
|
||||||
|
BundleVideoNumber int32 `json:"bundle_video_number"`
|
||||||
|
IncreaseVideoNumber int32 `json:"increase_video_number"`
|
||||||
|
BundleImageNumber int32 `json:"bundle_image_number"`
|
||||||
|
BundleDataNumber int32 `json:"bundle_data_number"`
|
||||||
|
BundleCompetitiveNumber int32 `json:"bundle_competitive_number"`
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user