feat:完善项目信息

This commit is contained in:
henry
2021-12-24 12:00:18 +08:00
parent ebf74435ef
commit f654b0a4f0
9 changed files with 248 additions and 17 deletions

View File

@ -14,6 +14,7 @@ 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"`
@ -28,6 +29,13 @@ type TechnologyAchievement struct {
ModelAt
}
// TechnologyAchievementChargeInfo 成果收费参数信息
type TechnologyAchievementChargeInfo struct {
VideoFile string `json:"video_file"` // 视频文件
VideoPrice float64 `json:"video_price"` // 视频价格
VideoFreeTime int `json:"video_free_time"` // 视频观看免费时长
}
// TechnologyAchievementMode 技术成本模式
type TechnologyAchievementMode int
@ -56,6 +64,17 @@ func (m *TechnologyAchievement) TableName() string {
return "technology_achievement"
}
func (m *TechnologyAchievement) GetChargeInfoAttribute() *TechnologyAchievementChargeInfo {
out := new(TechnologyAchievementChargeInfo)
_ = json.Unmarshal([]byte(m.Industry), &out)
return out
}
func (m *TechnologyAchievement) SetChargeInfoAttribute(value *TechnologyAchievementChargeInfo) {
_bytes, _ := json.Marshal(value)
m.ChargeInfo = string(_bytes)
}
func (m *TechnologyAchievement) GetIndustryAttribute() []string {
out := make([]string, 0)
_ = json.Unmarshal([]byte(m.Industry), &out)