80 lines
2.6 KiB
Go
80 lines
2.6 KiB
Go
package model
|
|
|
|
import "encoding/json"
|
|
|
|
// ServiceDemand 服务需求数据模型
|
|
type ServiceDemand struct {
|
|
Model
|
|
ModelTenant
|
|
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
|
Kind string `gorm:"column:kind;type:varchar(50);default:'';comment:需求类型" json:"kind"`
|
|
Title string `gorm:"column:title;type:varchar(50);default:'';comment:需求名称" json:"title"`
|
|
Name string `gorm:"column:name;type:varchar(50);default:'';comment:联系人" json:"name"`
|
|
Mobile string `gorm:"column:mobile;type:varchar(15);default:'';comment:联系人手机号" json:"mobile"`
|
|
Description string `gorm:"column:description;type:text;comment:需求描述" json:"description"`
|
|
Status ServiceDemandStatus `gorm:"column:status;type:tinyint(1);default:1;comment:状态" json:"status"`
|
|
ModelDeleted
|
|
ModelAt
|
|
}
|
|
|
|
// ServiceDemandKind 服务需求类型
|
|
type ServiceDemandKind int
|
|
|
|
const (
|
|
// ServiceDemandKindForCPTG 成果推广
|
|
ServiceDemandKindForCPTG ServiceDemandKind = iota + 1
|
|
// ServiceDemandKindForGJCGJJ 关键成果解决
|
|
ServiceDemandKindForGJCGJJ
|
|
// ServiceDemandKindForDJZJYS 对接专家院士
|
|
ServiceDemandKindForDJZJYS
|
|
// ServiceDemandKindForSHFD 上市辅导
|
|
ServiceDemandKindForSHFD
|
|
// ServiceDemandKindForXMSBFD 项目申报辅导
|
|
ServiceDemandKindForXMSBFD
|
|
// ServiceDemandKindForGMZL 购买专利
|
|
ServiceDemandKindForGMZL
|
|
// ServiceDemandKindForDJCPLSXYQY 对接产品链上下游企业
|
|
ServiceDemandKindForDJCPLSXYQY
|
|
// ServiceDemandKindForDJZFZC 对接政府政策
|
|
ServiceDemandKindForDJZFZC
|
|
// ServiceDemandKindForZSCQBJ 知识产权布局
|
|
ServiceDemandKindForZSCQBJ
|
|
// ServiceDemandKindForCXYHZ 产学研合作
|
|
ServiceDemandKindForCXYHZ
|
|
// ServiceDemandKindForQT 其他
|
|
ServiceDemandKindForQT
|
|
)
|
|
|
|
// ServiceDemandStatus 服务需求状态
|
|
type ServiceDemandStatus int
|
|
|
|
const (
|
|
// ServiceDemandStatusForDraft 草稿箱
|
|
ServiceDemandStatusForDraft ServiceDemandStatus = iota
|
|
// ServiceDemandStatusForPublish 发布
|
|
ServiceDemandStatusForPublish
|
|
// ServiceDemandStatusForAcceptance 受理
|
|
ServiceDemandStatusForAcceptance
|
|
// ServiceDemandStatusForComplete 完成结束
|
|
ServiceDemandStatusForComplete
|
|
)
|
|
|
|
func (m *ServiceDemand) TableName() string {
|
|
return "service_demand"
|
|
}
|
|
|
|
func (m *ServiceDemand) GetKindAttribute() []int {
|
|
out := make([]int, 0)
|
|
_ = json.Unmarshal([]byte(m.Kind), &out)
|
|
return out
|
|
}
|
|
|
|
func (m *ServiceDemand) SetKindAttribute(value []int) {
|
|
_bytes, _ := json.Marshal(value)
|
|
m.Kind = string(_bytes)
|
|
}
|
|
|
|
func NewServiceDemand() *ServiceDemand {
|
|
return &ServiceDemand{}
|
|
}
|