diff --git a/internal/model/bundle.go b/internal/model/bundle.go index 7719150..5628af1 100644 --- a/internal/model/bundle.go +++ b/internal/model/bundle.go @@ -27,7 +27,7 @@ type BundleProfile struct { FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);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:背景图-我的"` - BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;comment:套餐类型 1:基础套餐 2:先用后付套餐"` + BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"` BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"` BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"` } @@ -176,11 +176,12 @@ type UserBundleBalancePo struct { type BundleBalance struct { gorm.Model - UserId int `gorm:"column:user_id;not null"` - Month string `gorm:"column:month;type:varchar(32);not null;index:idx_month"` - OrderUUID string `gorm:"column:order_uuid;type:varchar(1024);not null;index:idx_order_uuid"` - ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间;index:idx_expired_at"` - StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间;index:idx_start_at"` + UserId int `gorm:"column:user_id;not null"` + Month string `gorm:"column:month;type:varchar(32);not null;index:idx_month"` + OrderUUID string `gorm:"column:order_uuid;type:varchar(1024);not null;index:idx_order_uuid"` + ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间;index:idx_expired_at"` + StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间;index:idx_start_at"` + BundleType int `gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"` // 套餐与增值账号 BundleAccountNumber int `gorm:"column:bundle_account_number;not null;comment:套餐账号总数"` diff --git a/pkg/db/mysql.go b/pkg/db/mysql.go index b80e5fb..b6810e8 100644 --- a/pkg/db/mysql.go +++ b/pkg/db/mysql.go @@ -58,7 +58,7 @@ func loadMysqlConn(conn string) *gorm.DB { &model.ValueAddServiceHistory{}, &model.BundleOrderValueAdd{}, &model.BundleExtensionRecords{}, - // &model.BundleBalance{}, + &model.BundleBalance{}, // &model.Reconciliation{}, &model.BundleActivate{}, &model.BundleBalanceLayout{},