feat:优化项目信息

This commit is contained in:
henry
2022-02-15 17:19:23 +08:00
parent cbc0ad1a41
commit dcb5948e91
45 changed files with 852 additions and 100 deletions

View File

@ -9,9 +9,10 @@ import (
type TechnologyAchievement struct {
Model
ModelTenant
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Mode TechnologyAchievementMode `gorm:"column:mode;type:tinyint(1);default:1;comment:成果模式" json:"mode"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:成果名称" json:"title"`
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Mode TechnologyAchievementMode `gorm:"column:mode;type:tinyint(1);default:1;comment:成果模式" json:"mode"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:成果名称" json:"title"`
Description string `gorm:"source:description;type:varchar(255);comment:成果描述" json:"description"`
Image
File string `gorm:"column:file;type:varchar(255);default:'';comment:证明材料" json:"file"`
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"`
@ -22,7 +23,6 @@ type TechnologyAchievement struct {
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"`
Shelf
TechnologyStatus
ModelDeleted
@ -50,6 +50,15 @@ func (m *TechnologyAchievement) TableName() string {
return "technology_achievement"
}
func (m *TechnologyAchievement) GetModeTitle() string {
if m.Mode == TechnologyAchievementModeForFree {
return "免费模式"
} else if m.Mode == TechnologyAchievementModeForCharge {
return "收费模式"
}
return ""
}
func (m *TechnologyAchievement) GetConfigAttribute() *TechnologyAchievementConfig {
out := new(TechnologyAchievementConfig)
_ = json.Unmarshal([]byte(m.Config), &out)