Files
cas_tt_cloud_backend/app/common/model/technology_topic.go

79 lines
2.8 KiB
Go
Raw Normal View History

2021-10-18 11:57:12 +08:00
package model
import (
"SciencesServer/utils"
"time"
)
// TechnologyTopic 技术课题数据模型
type TechnologyTopic struct {
Model
ModelTenant
Local
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Title string `gorm:"column:title;type:varchar(100);default:null;comment:名称" json:"title"`
Code string `gorm:"column:code;type:varchar(30);default:null;comment:编号" json:"code"`
Emcee string `gorm:"column:emcee;type:varchar(30);default:null;comment:主持人" json:"emcee"`
Mechanism string `gorm:"column:mechanism;type:varchar(30);default:null;comment:机构" json:"mechanism"`
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:0comment:来源" json:"source"`
Kind TechnologyTopicKind `gorm:"column:kind;type:tinyint(1);default:0comment:类型" 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"`
2021-10-22 17:10:43 +08:00
Status TechnologyTopicStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
2021-10-18 11:57:12 +08:00
ModelDeleted
ModelAt
}
// TechnologyTopicSource 技术课题资助来源
type TechnologyTopicSource int
const (
// TechnologyTopicSourceForCity 市级
TechnologyTopicSourceForCity TechnologyTopicSource = iota + 1
// TechnologyTopicSourceForProvince 省级
TechnologyTopicSourceForProvince
// TechnologyTopicSourceForCountry 国家级
TechnologyTopicSourceForCountry
)
// TechnologyTopicKind 技术课题类型
type TechnologyTopicKind int
const (
//TechnologyTopicKindFor
)
2021-10-22 17:10:43 +08:00
// TechnologyTopicStatus 技术课题状态
type TechnologyTopicStatus int
const (
// TechnologyTopicStatusForDraft 草稿箱
TechnologyTopicStatusForDraft TechnologyTopicStatus = iota
// TechnologyTopicStatusForExamining 审核中
TechnologyTopicStatusForExamining
// TechnologyTopicStatusForAgree 审核通过
TechnologyTopicStatusForAgree
// TechnologyTopicStatusForRefuse 审核拒绝
TechnologyTopicStatusForRefuse
)
2021-10-18 11:57:12 +08:00
func (m *TechnologyTopic) TableName() string {
return m.NewTableName("technology_topic")
}
func (m *TechnologyTopic) GetKeywordAttribute() []string {
keywords := make([]string, 0)
_ = utils.FromJSON(m.Keyword, &keywords)
return keywords
}
func (m *TechnologyTopic) SetKeywordAttribute(keywords []string) {
m.Keyword = utils.AnyToJSON(keywords)
}
func NewTechnologyTopic() *TechnologyTopic {
return &TechnologyTopic{}
}