feat:增加专利模型数据
This commit is contained in:
108
app/common/model/technology_prodcut.go
Normal file
108
app/common/model/technology_prodcut.go
Normal file
@ -0,0 +1,108 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"SciencesServer/app/basic/config"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// TechnologyProduct 技术产品数据模型
|
||||
type TechnologyProduct struct {
|
||||
Model
|
||||
ModelTenant
|
||||
Local
|
||||
MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"`
|
||||
Title string `gorm:"column:title;type:varchar(100);default:null;comment:产品名称" json:"title"`
|
||||
Image
|
||||
Video string `gorm:"column:video;type:varchar(255);default:null;comment:视频地址" json:"video"`
|
||||
Material string `gorm:"column:material;type:varchar(255);default:null;comment:证明材料" json:"material"`
|
||||
Industry string `gorm:"column:industry;type:varchar(255);default:null;comment:所属领域" json:"industry"`
|
||||
Customer string `gorm:"column:customer;type:varchar(255);default:null;comment:应用客户" json:"-"`
|
||||
Maturity config.TechnologyMaturity `gorm:"column:maturity;type:tinyint(1);default:0;comment:技术成熟度" json:"maturity"`
|
||||
LeadStandard TechnologyProductLeadStandard `gorm:"column:lead_standard;type:tinyint(1);default:0;comment:领先标准" json:"lead_standard"`
|
||||
CooperationMode config.TechnologyCooperationMode `gorm:"column:cooperation_mode;type:tinyint(1);default:0;comment:合作模式" json:"cooperation_mode"`
|
||||
Keyword string `gorm:"column:keyword;type:varchar(255);default:null;comment:关键词" json:"-"`
|
||||
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
||||
ShelfStatus
|
||||
Status TechnologyProductStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// TechnologyProductLeadStandard 领先标准
|
||||
type TechnologyProductLeadStandard int
|
||||
|
||||
const (
|
||||
// TechnologyProductLeadStandardForDomesticXJ 国内先进
|
||||
TechnologyProductLeadStandardForDomesticXJ TechnologyProductLeadStandard = iota + 1
|
||||
// TechnologyProductLeadStandardForDomesticLX 国内领先
|
||||
TechnologyProductLeadStandardForDomesticLX
|
||||
// TechnologyProductLeadStandardForInternationalXJ 国际先进
|
||||
TechnologyProductLeadStandardForInternationalXJ
|
||||
// TechnologyProductLeadStandardForInternationalLX 国际领先
|
||||
TechnologyProductLeadStandardForInternationalLX
|
||||
)
|
||||
|
||||
// TechnologyProductStatus 状态
|
||||
type TechnologyProductStatus int
|
||||
|
||||
const (
|
||||
// TechnologyProductStatusForDraft 草稿箱
|
||||
TechnologyProductStatusForDraft TechnologyProductStatus = iota
|
||||
// TechnologyProductStatusForExamining 审核中
|
||||
TechnologyProductStatusForExamining
|
||||
// TechnologyProductStatusForAgree 审核通过
|
||||
TechnologyProductStatusForAgree
|
||||
// TechnologyProductStatusForRefuse 审核拒绝
|
||||
TechnologyProductStatusForRefuse
|
||||
)
|
||||
|
||||
// TechnologyProductShelfStatus 上下架状态
|
||||
type TechnologyProductShelfStatus int
|
||||
|
||||
const (
|
||||
// TechnologyProductShelfStatusForUp 上架
|
||||
TechnologyProductShelfStatusForUp TechnologyProductShelfStatus = iota + 1
|
||||
// TechnologyProductShelfStatusForDown 下架
|
||||
TechnologyProductShelfStatusForDown
|
||||
)
|
||||
|
||||
func (m *TechnologyProduct) TableName() string {
|
||||
return "technology_product"
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) GetIndustryAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Industry), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) SetIndustryAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Industry = string(_bytes)
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) GetCustomerAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Customer), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) SetCustomerAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Customer = string(_bytes)
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) GetKeywordAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Keyword), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyProduct) SetKeywordAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Keyword = string(_bytes)
|
||||
}
|
||||
|
||||
func NewTechnologyProduct() *TechnologyProduct {
|
||||
return &TechnologyProduct{}
|
||||
}
|
Reference in New Issue
Block a user