feat:增加用户服务需求数据模型
This commit is contained in:
79
app/common/model/service_demand.go
Normal file
79
app/common/model/service_demand.go
Normal file
@ -0,0 +1,79 @@
|
||||
package model
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// ServiceDemand 服务需求数据模型
|
||||
type ServiceDemand struct {
|
||||
Model
|
||||
Local
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Kind string `gorm:"column:kind;type:varchar(50);default:null;comment:需求类型" json:"kind"`
|
||||
Title string `gorm:"column:title;type:varchar(50);default:null;comment:需求名称" json:"title"`
|
||||
Name string `gorm:"column:name;type:varchar(50);default:null;comment:联系人" json:"name"`
|
||||
Mobile string `gorm:"column:mobile;type:varchar(15);default:null;comment:联系人手机号" json:"mobile"`
|
||||
Description string `gorm:"column:description;type:text;default:null;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{}
|
||||
}
|
@ -8,9 +8,8 @@ import (
|
||||
// TechnologyDemand 技术需求数据模型
|
||||
type TechnologyDemand struct {
|
||||
Model
|
||||
ModelTenant
|
||||
Local
|
||||
MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"`
|
||||
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
|
||||
|
@ -18,7 +18,7 @@ type TechnologyTopic struct {
|
||||
Keyword string `gorm:"column:keyword;type:varchar(255);default:null;comment:关键词" json:"-"`
|
||||
Amount float64 `gorm:"column:amount;decimal(10,2);default:0;comment:经费" json:"amount"`
|
||||
Source TechnologyTopicSource `gorm:"column:source;type:tinyint(1);default:0;comment:来源" json:"source"`
|
||||
Kind TechnologyTopicKind `gorm:"column:kind;type:tinyint(1);default:0comment:类型" json:"kind"`
|
||||
Kind TechnologyTopicKind `gorm:"column:kind;type:tinyint(1);default:0;comment:类型" json:"kind"`
|
||||
BeginAt time.Time `gorm:"column:begin_at;type:datetime;not null;comment:开始时间" json:"begin_at"`
|
||||
FinishAt time.Time `gorm:"column:finish_at;type:datetime;not null;comment:结束时间" json:"finish_at"`
|
||||
Status TechnologyTopicStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
|
||||
|
Reference in New Issue
Block a user