package model import ( "SciencesServer/app/basic/config" "encoding/json" ) // TechnologyAchievement 技术成果数据模型 type TechnologyAchievement struct { Model Local 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"` Image File string `gorm:"column:file;type:varchar(255);default:'';comment:证明材料" json:"file"` Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"industry"` 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"` 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 Status TechnologyAchievementStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"` ModelDeleted ModelAt } // TechnologyAchievementMode 技术成本模式 type TechnologyAchievementMode int const ( // TechnologyAchievementModeForFree 免费模式 TechnologyAchievementModeForFree TechnologyAchievementMode = iota + 1 // TechnologyAchievementModeForCharge 收费模式 TechnologyAchievementModeForCharge ) // TechnologyAchievementStatus 技术成果状态 type TechnologyAchievementStatus int const ( // TechnologyAchievementStatusForDraft 草稿箱 TechnologyAchievementStatusForDraft TechnologyAchievementStatus = iota // TechnologyAchievementStatusForExamining 审核中 TechnologyAchievementStatusForExamining // TechnologyAchievementStatusForAgree 审核通过 TechnologyAchievementStatusForAgree // TechnologyAchievementStatusForRefuse 审核拒绝 TechnologyAchievementStatusForRefuse ) func (m *TechnologyAchievement) TableName() string { return "technology_achievement" } func (m *TechnologyAchievement) GetIndustryAttribute() []string { out := make([]string, 0) _ = json.Unmarshal([]byte(m.Industry), &out) return out } func (m *TechnologyAchievement) SetIndustryAttribute(value []string) { _bytes, _ := json.Marshal(value) m.Industry = string(_bytes) } func (m *TechnologyAchievement) GetCustomerAttribute() []string { out := make([]string, 0) _ = json.Unmarshal([]byte(m.Customer), &out) return out } func (m *TechnologyAchievement) SetCustomerAttribute(value []string) { _bytes, _ := json.Marshal(value) m.Customer = string(_bytes) } func (m *TechnologyAchievement) GetKeywordAttribute() []string { out := make([]string, 0) _ = json.Unmarshal([]byte(m.Keyword), &out) return out } func (m *TechnologyAchievement) SetKeywordAttribute(value []string) { _bytes, _ := json.Marshal(value) m.Keyword = string(_bytes) } func NewTechnologyAchievement() *TechnologyAchievement { return &TechnologyAchievement{} }