Updata:增加中间数据结构

This commit is contained in:
jiaji.H 2026-03-11 19:31:13 +08:00
parent 1ff83504c2
commit 5fef6272c3
2 changed files with 16 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package logic
import (
"encoding/json"
"errors"
"fmt"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
@ -24,13 +25,14 @@ func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (
if err != nil {
return nil, errors.New("获取问卷信息失败")
}
bundleInfo := &bundle.SurveyBundleInfo{}
bundleInfo := &model.DbBundleInfo{}
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
if err != nil {
return nil, errors.New("反序列化失败")
}
fmt.Println("获取套餐名称:", bundleInfo.BundleName)
resp.UserName = data.UserName
resp.BundleInfo = bundleInfo
resp.BundleInfo = &bundle.SurveyBundleInfo{}
resp.BundleInfo.BundleName = bundleInfo.BundleName
resp.BundleInfo.StartAt = bundleInfo.StartAt
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt

View File

@ -60,3 +60,15 @@ type UserInfo struct {
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
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"`
}