feat:完善项目信息

This commit is contained in:
henry
2022-01-21 10:14:56 +08:00
parent c4c9074a41
commit dda20eb011
8 changed files with 170 additions and 23 deletions

View File

@ -14,12 +14,12 @@ type TechnologyAchievement struct {
Title string `gorm:"column:title;type:varchar(100);default:'';comment:成果名称" json:"title"`
Image
File string `gorm:"column:file;type:varchar(255);default:'';comment:证明材料" json:"file"`
ChargeInfo string `gorm:"column:charge_info;type:varchar(255);default:'';comment:收费信息" json:"charge_info"`
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"`
Customer string `gorm:"column:customer;type:varchar(255);default:'';comment:应用客户" json:"-"`
Maturity config.TechnologyMaturity `gorm:"column:maturity;type:tinyint(1);default:0;comment:技术成熟度" json:"maturity"`
LeadStandard TechnologyProductLeadStandard `gorm:"column:lead_standard;type:tinyint(1);default:0;comment:领先标准" json:"lead_standard"`
CooperationMode config.TechnologyCooperationMode `gorm:"column:cooperation_mode;type:tinyint(1);default:0;comment:合作模式" json:"cooperation_mode"`
Config string `gorm:"column:config;type:varchar(255);default:'';comment:配置信息" json:"config"`
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"-"`
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
Source string `gorm:"source:introduce;type:text;comment:成果来源" json:"source"`
@ -29,8 +29,8 @@ type TechnologyAchievement struct {
ModelAt
}
// TechnologyAchievementChargeInfo 成果收费参数信息
type TechnologyAchievementChargeInfo struct {
// TechnologyAchievementConfig 成果收费参数信息
type TechnologyAchievementConfig struct {
VideoFile string `json:"video_file"` // 视频文件
VideoPrice float64 `json:"video_price"` // 视频价格
VideoFreeTime int `json:"video_free_time"` // 视频观看免费时长
@ -64,15 +64,15 @@ func (m *TechnologyAchievement) TableName() string {
return "technology_achievement"
}
func (m *TechnologyAchievement) GetChargeInfoAttribute() *TechnologyAchievementChargeInfo {
out := new(TechnologyAchievementChargeInfo)
_ = json.Unmarshal([]byte(m.Industry), &out)
func (m *TechnologyAchievement) GetConfigAttribute() *TechnologyAchievementConfig {
out := new(TechnologyAchievementConfig)
_ = json.Unmarshal([]byte(m.Config), &out)
return out
}
func (m *TechnologyAchievement) SetChargeInfoAttribute(value *TechnologyAchievementChargeInfo) {
func (m *TechnologyAchievement) SetConfigAttribute(value *TechnologyAchievementConfig) {
_bytes, _ := json.Marshal(value)
m.ChargeInfo = string(_bytes)
m.Config = string(_bytes)
}
func (m *TechnologyAchievement) GetIndustryAttribute() []string {