101 lines
3.6 KiB
Go
101 lines
3.6 KiB
Go
package model
|
||
|
||
import (
|
||
"SciencesServer/utils"
|
||
"time"
|
||
)
|
||
|
||
// TechnologyDemand 技术需求数据模型
|
||
type TechnologyDemand struct {
|
||
Model
|
||
ModelTenant
|
||
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:"-"`
|
||
Area
|
||
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(kinds []string) {
|
||
m.Kind = utils.AnyToJSON(kinds)
|
||
}
|
||
|
||
func (m *TechnologyDemand) GetKindAttribute() []string {
|
||
kinds := make([]string, 0)
|
||
_ = utils.FromJSON(m.Kind, &kinds)
|
||
return kinds
|
||
}
|
||
|
||
func (m *TechnologyDemand) SetIndustryAttribute(industrys []string) {
|
||
m.Industry = utils.AnyToJSON(industrys)
|
||
}
|
||
|
||
func (m *TechnologyDemand) GetIndustryAttribute() []string {
|
||
industrys := make([]string, 0)
|
||
_ = utils.FromJSON(m.Industry, &industrys)
|
||
return industrys
|
||
}
|
||
|
||
func (m *TechnologyDemand) SetOtherAttribute(other *TechnologyDemandOther) {
|
||
m.Other = utils.AnyToJSON(other)
|
||
}
|
||
|
||
func (m *TechnologyDemand) GetOtherAttribute() *TechnologyDemandOther {
|
||
other := new(TechnologyDemandOther)
|
||
_ = utils.FromJSON(m.Other, other)
|
||
return other
|
||
}
|
||
|
||
func NewTechnologyDemand() *TechnologyDemand {
|
||
return &TechnologyDemand{}
|
||
}
|