Update:增加字段

This commit is contained in:
jiaji.H 2026-06-08 11:51:31 +08:00
parent f9c7edf7c3
commit 17c8114b47
7 changed files with 4551 additions and 4500 deletions

View File

@ -94,6 +94,7 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
ContractDuration: int64(bundleProfile.ContractDuration), ContractDuration: int64(bundleProfile.ContractDuration),
BundleCommonUid: bundleProfile.BundleCommonUid, BundleCommonUid: bundleProfile.BundleCommonUid,
BundleType: int64(bundleProfile.BundleType), BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
}) })
} }
@ -134,6 +135,7 @@ func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
ContractDuration: int64(bundleProfile.ContractDuration), ContractDuration: int64(bundleProfile.ContractDuration),
BundleCommonUid: bundleProfile.BundleCommonUid, BundleCommonUid: bundleProfile.BundleCommonUid,
BundleType: int64(bundleProfile.BundleType), BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
} }
return return
} }
@ -236,6 +238,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
ShelfStatus: int64(bundleProfile.ShelfStatus), ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor, FontColor: bundleProfile.FontColor,
BundleType: int64(bundleProfile.BundleType), BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
}) })
} }
} }
@ -468,6 +471,7 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
ShelfStatus: int64(bundleProfile.ShelfStatus), ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor, FontColor: bundleProfile.FontColor,
BundleType: int64(bundleProfile.BundleType), BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
}) })
} }
} }

View File

@ -80,6 +80,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
ShelfStatus: model.BundleShelfStatusDown, //默认初始状态为2-下架 ShelfStatus: model.BundleShelfStatusDown, //默认初始状态为2-下架
FontColor: req.FontColor, FontColor: req.FontColor,
BundleType: req.BundleType, BundleType: req.BundleType,
PayLaterTime: req.PayLaterTime,
} }
bundleLang := &model.BundleProfileLang{ bundleLang := &model.BundleProfileLang{
Name: req.Name, Name: req.Name,
@ -203,6 +204,8 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
serviceName = "账号数" serviceName = "账号数"
case msg.AvailableTimeService: case msg.AvailableTimeService:
serviceName = "可用时长" serviceName = "可用时长"
case msg.CompetitiveService:
serviceName = "竞品数"
} }
return res, fmt.Errorf("服务类型%s的额度不兼容套餐权益额度为%d附加权益额度为%d", return res, fmt.Errorf("服务类型%s的额度不兼容套餐权益额度为%d附加权益额度为%d",
serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue) serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue)
@ -298,6 +301,8 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
"bg_img1": req.BgImg1, "bg_img1": req.BgImg1,
"bg_img2": req.BgImg2, "bg_img2": req.BgImg2,
"font_color": req.FontColor, "font_color": req.FontColor,
"bundle_type": req.BundleType,
"pay_later_time": req.PayLaterTime,
} }
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil { if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
return res, errors.New("更新套餐信息失败") return res, errors.New("更新套餐信息失败")
@ -359,6 +364,7 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"), UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
Contract: detail.Contract, Contract: detail.Contract,
BundleType: int64(detail.BundleType), BundleType: int64(detail.BundleType),
PayLaterTime: int64(detail.PayLaterTime),
} }
if len(detail.BundleToValueAddService) > 0 { if len(detail.BundleToValueAddService) > 0 {
var valueUuids []string var valueUuids []string
@ -429,12 +435,14 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
PriceType: lang.PriceType, PriceType: lang.PriceType,
Content: lang.Content, Content: lang.Content,
Language: lang.Language, Language: lang.Language,
PayLaterTime: int64(lang.PayLaterTime),
ImgOption: int32(detail.ImgOption), ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1, BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2, BgImg2: detail.BgImg2,
FontColor: detail.FontColor, FontColor: detail.FontColor,
Sort: detail.Sort, Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus, ShelfStatus: detail.ShelfStatus,
BundleType: int64(detail.BundleType),
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"), CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"), UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
}) })
@ -471,6 +479,8 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
res.Sort = detail.Sort res.Sort = detail.Sort
res.ShelfStatus = detail.ShelfStatus res.ShelfStatus = detail.ShelfStatus
res.Contract = detail.Contract res.Contract = detail.Contract
res.BundleType = int64(detail.BundleType)
res.PayLaterTime = int64(detail.PayLaterTime)
if len(detail.BundleToValueAddService) > 0 { if len(detail.BundleToValueAddService) > 0 {
var serviceLangInfos []*bundle.ServiceLangInfo var serviceLangInfos []*bundle.ServiceLangInfo
for _, service := range detail.BundleToValueAddService { for _, service := range detail.BundleToValueAddService {
@ -488,6 +498,7 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
res.PriceType = lang.PriceType res.PriceType = lang.PriceType
res.Content = lang.Content res.Content = lang.Content
res.Language = lang.Language res.Language = lang.Language
res.PayLaterTime = int64(lang.PayLaterTime)
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05") res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05") res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
} }

View File

@ -38,6 +38,7 @@ type BundleProfile struct {
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"` BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"` BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"` BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"`
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"` BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"` BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
} }
@ -48,6 +49,7 @@ type BundleProfileLang struct {
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"` Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"` PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"` Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"` Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"` CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"` UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`

View File

@ -35,7 +35,7 @@ type ValueAddService struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"` UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"` ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数 7:支付时长"` ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"` ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"` BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"` CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
@ -48,7 +48,7 @@ type ValueAddServiceLang struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"` UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"` ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数 7:支付时长"` ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"` PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"`
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"` OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用 TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用

View File

@ -374,6 +374,7 @@ message BundleProfile {
int32 imgOption = 20 [json_name = "imgOption"]; int32 imgOption = 20 [json_name = "imgOption"];
string fontColor = 21 [json_name = "fontColor"]; string fontColor = 21 [json_name = "fontColor"];
int64 bundleType = 22 [json_name = "bundleType"]; int64 bundleType = 22 [json_name = "bundleType"];
int64 payLaterTime = 23 [json_name = "payLaterTime"]; //
} }
message BundleProfileLang { message BundleProfileLang {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];
@ -393,7 +394,9 @@ message BundleProfileLang {
string bgImg2 = 15 [json_name = "bgImg2"]; string bgImg2 = 15 [json_name = "bgImg2"];
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2 int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2
int32 imgOption = 17 [json_name = "imgOption"]; int32 imgOption = 17 [json_name = "imgOption"];
repeated ServiceLangInfo serviceLangInfo = 18 [json_name = "serviceLangInfo"];// int64 bundleType = 18 [json_name = "bundleType"];
int64 payLaterTime = 19 [json_name = "payLaterTime"]; //
repeated ServiceLangInfo serviceLangInfo = 20 [json_name = "serviceLangInfo"];//
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"]; //repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
} }

File diff suppressed because it is too large Load Diff

View File

@ -119,6 +119,7 @@ const (
DataReportService = 3 //数据报表 DataReportService = 3 //数据报表
AccountService = 4 //账号数 AccountService = 4 //账号数
AvailableTimeService = 5 //可用时长 AvailableTimeService = 5 //可用时长
CompetitiveService = 6 //竞品数
) )
// 套餐状态 // 套餐状态