91 lines
3.7 KiB
Go
91 lines
3.7 KiB
Go
package model
|
||
|
||
import (
|
||
"SciencesServer/app/basic/config"
|
||
"SciencesServer/utils"
|
||
)
|
||
|
||
// TechnologyInstance 技术文档数据模型
|
||
type TechnologyInstance struct {
|
||
Model
|
||
Local
|
||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||
PatentID uint64 `gorm:"column:patent_id;type:int;default:0;comment:代表专利" json:"patent_id"`
|
||
Title string `gorm:"column:title;type:varchar(30);default:'';comment:名称" json:"title"`
|
||
Company string `gorm:"column:company;type:varchar(30);default:'';comment:单位" json:"company"`
|
||
Maturity config.TechnologyMaturity `gorm:"column:maturity;type:tinyint(1);default:0;comment:成熟度" json:"maturity"`
|
||
Prototype int `gorm:"column:prototype;type:tinyint(1);default:0;comment:样机(0:无,1:有)" json:"prototype"`
|
||
Product string `gorm:"column:product;type:varchar(255);default:'';comment:应用产品" json:"product"`
|
||
Source TechnologyInstanceSource `gorm:"column:source;type:tinyint(1);default:0;comment:来源" json:"source"`
|
||
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"keyword"`
|
||
Territory uint64 `gorm:"column:territory;type:int(11);default:0;comment:技术领域" json:"territory"`
|
||
Transaction int `gorm:"column:transaction;type:tinyint(3);default:0;comment:交易方式" json:"transaction"`
|
||
Images
|
||
ProveImages string `gorm:"column:prove_images;type:text;default:'';comment:证明材料图片" json:"prove_images"`
|
||
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
||
Purpose string `gorm:"column:purpose;type:text;comment:意图-承担科研项目" json:"purpose"`
|
||
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`
|
||
Shelf
|
||
Status TechnologyInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
|
||
ModelDeleted
|
||
ModelAt
|
||
}
|
||
|
||
// TechnologyInstanceSource 技术来源
|
||
type TechnologyInstanceSource int
|
||
|
||
const (
|
||
// TechnologyInstanceSourceForCompany 企业
|
||
TechnologyInstanceSourceForCompany TechnologyInstanceSource = iota
|
||
// TechnologyInstanceSourceForSchool 院校
|
||
TechnologyInstanceSourceForSchool
|
||
// TechnologyInstanceSourceForResearch 科研机构
|
||
TechnologyInstanceSourceForResearch
|
||
// TechnologyInstanceSourceForPerson 个人
|
||
TechnologyInstanceSourceForPerson
|
||
// TechnologyInstanceSourceForOther 其他
|
||
TechnologyInstanceSourceForOther
|
||
)
|
||
|
||
// TechnologyInstanceStatus 技术文档状态
|
||
type TechnologyInstanceStatus int
|
||
|
||
const (
|
||
// TechnologyInstanceStatusForDraft 草稿箱
|
||
TechnologyInstanceStatusForDraft TechnologyInstanceStatus = iota
|
||
// TechnologyInstanceStatusForExamining 审核中
|
||
TechnologyInstanceStatusForExamining
|
||
// TechnologyInstanceStatusForAgree 审核通过
|
||
TechnologyInstanceStatusForAgree
|
||
// TechnologyInstanceStatusForRefuse 审核拒绝
|
||
TechnologyInstanceStatusForRefuse
|
||
)
|
||
|
||
func (m *TechnologyInstance) TableName() string {
|
||
return m.NewTableName("technology_instance")
|
||
}
|
||
|
||
func (m *TechnologyInstance) GetKeywordAttribute() []string {
|
||
keywords := make([]string, 0)
|
||
_ = utils.FromJSON(m.Keyword, &keywords)
|
||
return keywords
|
||
}
|
||
|
||
func (m *TechnologyInstance) SetKeywordAttribute(keywords []string) {
|
||
m.Keyword = utils.AnyToJSON(keywords)
|
||
}
|
||
|
||
func (m *TechnologyInstance) GetProductAttribute() []string {
|
||
products := make([]string, 0)
|
||
_ = utils.FromJSON(m.Product, &products)
|
||
return products
|
||
}
|
||
|
||
func (m *TechnologyInstance) SetProductAttribute(products []string) {
|
||
m.Product = utils.AnyToJSON(products)
|
||
}
|
||
|
||
func NewTechnologyInstance() *TechnologyInstance {
|
||
return &TechnologyInstance{}
|
||
}
|