增加clor

This commit is contained in:
孙肖扬 2025-06-17 09:24:18 +08:00
parent 8793f023c9
commit 0c5ffdcc90
6 changed files with 1086 additions and 1070 deletions

View File

@ -207,6 +207,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
SelectValueAddService: selectValueAddService, SelectValueAddService: selectValueAddService,
BundleProfileLang: bundleProfileLang, BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus), ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
}) })
} }
} }

View File

@ -76,6 +76,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
BgImg1: req.BgImg1, BgImg1: req.BgImg1,
BgImg2: req.BgImg2, BgImg2: req.BgImg2,
ShelfStatus: 2, //默认初始状态为2-下架 ShelfStatus: 2, //默认初始状态为2-下架
FontColor: req.FontColor,
} }
bundleLang := &model.BundleProfileLang{ bundleLang := &model.BundleProfileLang{
Name: req.Name, Name: req.Name,
@ -242,6 +243,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
"img_option": req.ImgOption, "img_option": req.ImgOption,
"bg_img1": req.BgImg1, "bg_img1": req.BgImg1,
"bg_img2": req.BgImg2, "bg_img2": req.BgImg2,
"font_color": req.FontColor,
} }
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil { if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
return res, err return res, err
@ -332,6 +334,7 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
bundleProfile.ImgOption = int32(detail.ImgOption) bundleProfile.ImgOption = int32(detail.ImgOption)
bundleProfile.BgImg1 = detail.BgImg1 bundleProfile.BgImg1 = detail.BgImg1
bundleProfile.BgImg2 = detail.BgImg2 bundleProfile.BgImg2 = detail.BgImg2
bundleProfile.FontColor = detail.FontColor
bundleProfile.Sort = detail.Sort bundleProfile.Sort = detail.Sort
bundleProfile.ShelfStatus = detail.ShelfStatus bundleProfile.ShelfStatus = detail.ShelfStatus
bundleProfile.CreatedAt = detail.CreatedAt.Format("2006-01-02 15:04:05") bundleProfile.CreatedAt = detail.CreatedAt.Format("2006-01-02 15:04:05")

View File

@ -22,6 +22,7 @@ type BundleProfile struct {
Sort int64 `json:"sort" gorm:"column:sort;type:int;comment:套餐排序"` //数字越小越靠前,同大小后创建优先 Sort int64 `json:"sort" gorm:"column:sort;type:int;comment:套餐排序"` //数字越小越靠前,同大小后创建优先
ShelfStatus int64 `json:"shelfStatus" gorm:"column:shelf_status;type:int;default:2;comment:上架状态 1:上架 2:下架"` ShelfStatus int64 `json:"shelfStatus" gorm:"column:shelf_status;type:int;default:2;comment:上架状态 1:上架 2:下架"`
ImgOption int8 `json:"imgOption" gorm:"column:img_option;type:int;default:1;comment:图片选择 1:背景图1 2 3"` ImgOption int8 `json:"imgOption" gorm:"column:img_option;type:int;default:1;comment:图片选择 1:背景图1 2 3"`
FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);comment:字体颜色"`
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:背景图-我的"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"` BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`

View File

@ -233,6 +233,7 @@ message BundleProfile {
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"]; repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
repeated BundleProfileLang bundleProfileLang = 18 [json_name = "bundleProfileLang"]; repeated BundleProfileLang bundleProfileLang = 18 [json_name = "bundleProfileLang"];
int32 imgOption = 19 [json_name = "imgOption"]; int32 imgOption = 19 [json_name = "imgOption"];
string fontColor = 20 [json_name = "fontColor"];
} }
message BundleProfileLang { message BundleProfileLang {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@ import (
fmt "fmt" fmt "fmt"
math "math" math "math"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators" _ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
) )