package model import ( "SciencesServer/utils" "encoding/json" "time" ) // TechnologyDemand 技术需求数据模型 type TechnologyDemand struct { Model Local UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"` Title string `gorm:"column:title;type:varchar(50);default:null;comment:需求名称" json:"title"` Kind string `gorm:"column:kind;type:varchar(50);default:null;comment:需求类别" json:"-"` Name string `gorm:"column:name;type:varchar(30);default:null;comment:联系人" json:"name"` Mobile string `gorm:"column:mobile;type:varchar(15);default:null;comment:联系方式" json:"mobile"` Industry string `gorm:"column:industry;type:varchar(255);comment:所属领域;行业信息" json:"industry"` Introduce string `gorm:"column:introduce;type:text;comment:需求描述" json:"introduce"` Budget float64 `gorm:"column:budget;type:decimal(10,2);default:0;comment:投产预算" json:"budget"` BudgetMode TechnologyDemandBudgetMode `gorm:"column:budget_mode;type:tinyint(1);default:1;comment:预算模式(1:具体金额,2:面议)" json:"budget_mode"` Deadline time.Time `gorm:"column:deadline;type:date;not null;comment:截止时间" json:"deadline"` Other string `gorm:"column:other;type:varchar(255);default:null;comment:其他信息" json:"-"` Status TechnologyDemandStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"` ModelDeleted ModelAt } // TechnologyDemandOther 技术需求其他信息 type TechnologyDemandOther struct { Expect []string `json:"expect"` // 期望合作的企业及模式 Demand struct { Basic string `json:"basic"` // 基础 Expect string `json:"expect"` // 预期 Benefit string `json:"benefit"` // 效益 } `json:"demand"` // 需求详细信息 } // TechnologyDemandBudgetMode 预算模式 type TechnologyDemandBudgetMode int const ( // TechnologyDemandBudgetModeForAmount 具体金额 TechnologyDemandBudgetModeForAmount TechnologyDemandBudgetMode = iota + 1 // TechnologyDemandBudgetModeForToFace 面议 TechnologyDemandBudgetModeForToFace ) // TechnologyDemandStatus 需求文档状态 type TechnologyDemandStatus int const ( // TechnologyDemandStatusForDraft 草稿箱 TechnologyDemandStatusForDraft TechnologyDemandStatus = iota // TechnologyDemandStatusForExamining 审核中 TechnologyDemandStatusForExamining // TechnologyDemandStatusForAgree 审核通过 TechnologyDemandStatusForAgree // TechnologyDemandStatusForRefuse 审核拒绝 TechnologyDemandStatusForRefuse ) func (m *TechnologyDemand) TableName() string { return m.NewTableName("technology_demand") } func (m *TechnologyDemand) SetKindAttribute(value []string) { _bytes, _ := json.Marshal(value) m.Kind = string(_bytes) } func (m *TechnologyDemand) GetKindAttribute() []string { out := make([]string, 0) _ = json.Unmarshal([]byte(m.Kind), &out) return out } func (m *TechnologyDemand) SetIndustryAttribute(value []string) { _bytes, _ := json.Marshal(value) m.Industry = string(_bytes) } func (m *TechnologyDemand) GetIndustryAttribute() []string { out := make([]string, 0) _ = json.Unmarshal([]byte(m.Industry), &out) return out } func (m *TechnologyDemand) SetOtherAttribute(value *TechnologyDemandOther) { _bytes, _ := json.Marshal(value) m.Other = string(_bytes) } func (m *TechnologyDemand) GetOtherAttribute() *TechnologyDemandOther { other := new(TechnologyDemandOther) _ = utils.FromJSON(m.Other, other) return other } func NewTechnologyDemand() *TechnologyDemand { return &TechnologyDemand{} }