feat:完善信息
This commit is contained in:
@ -66,6 +66,20 @@ const (
|
||||
AccountStatusForDisable
|
||||
)
|
||||
|
||||
// ShelfStatus 上下架状态
|
||||
type ShelfStatus struct {
|
||||
ShelfStatus ShelfStatusKind `gorm:"column:shelf_status;type:tinyint(1);default:0;comment:上下架状态(1:上架,2:下架)" json:"shelf_status"`
|
||||
}
|
||||
|
||||
type ShelfStatusKind int
|
||||
|
||||
const (
|
||||
// ShelfStatusForUp 上架
|
||||
ShelfStatusForUp ShelfStatusKind = iota
|
||||
// ShelfStatusForDown 下架
|
||||
ShelfStatusForDown
|
||||
)
|
||||
|
||||
// ExamineStatus 审核状态
|
||||
type ExamineStatus struct {
|
||||
Status ExamineStatusKind `gorm:"column:status;type:tinyint(1);default:0;comment:审核状态(0:审核中,1:审核通过,2:审核拒绝)" json:"status"`
|
||||
|
@ -1,4 +1,105 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/utils"
|
||||
|
||||
// TechnologyInstance 技术文档数据模型
|
||||
type TechnologyInstance struct {
|
||||
Model
|
||||
ModelTenant
|
||||
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:null;comment:名称" json:"title"`
|
||||
Company string `gorm:"column:company;type:varchar(30);default:null;comment:单位" json:"company"`
|
||||
Maturity TechnologyInstanceMaturity `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:null;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:null;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:null;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:null;comment:备注信息" json:"remark"`
|
||||
ShelfStatus
|
||||
Status TechnologyInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// TechnologyInstanceMaturity 技术文档成熟度
|
||||
type TechnologyInstanceMaturity int
|
||||
|
||||
const (
|
||||
// TechnologyInstanceMaturityForDev 正在研发
|
||||
TechnologyInstanceMaturityForDev TechnologyInstanceMaturity = iota + 1
|
||||
// TechnologyInstanceMaturityForTest 小试阶段
|
||||
TechnologyInstanceMaturityForTest
|
||||
// TechnologyInstanceMaturityForTestFinish 通过小试
|
||||
TechnologyInstanceMaturityForTestFinish
|
||||
// TechnologyInstanceMaturityForModerateTest 中试阶段
|
||||
TechnologyInstanceMaturityForModerateTest
|
||||
// TechnologyInstanceMaturityForModerateTestFinish 通过中试
|
||||
TechnologyInstanceMaturityForModerateTestFinish
|
||||
// TechnologyInstanceMaturityForProduce 可规模生产
|
||||
TechnologyInstanceMaturityForProduce
|
||||
)
|
||||
|
||||
// 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{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user