2021-11-26 17:26:01 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
"SciencesServer/app/basic/config"
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TechnologyProduct 技术产品数据模型
|
|
|
|
type TechnologyProduct struct {
|
|
|
|
Model
|
2022-01-15 16:48:49 +08:00
|
|
|
ModelTenant
|
2021-11-30 16:28:07 +08:00
|
|
|
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
2021-12-03 14:18:06 +08:00
|
|
|
Title string `gorm:"column:title;type:varchar(100);default:'';comment:产品名称" json:"title"`
|
2021-11-26 17:26:01 +08:00
|
|
|
Image
|
2021-12-03 14:18:06 +08:00
|
|
|
Video string `gorm:"column:video;type:varchar(255);default:'';comment:视频地址" json:"video"`
|
|
|
|
Material string `gorm:"column:material;type:varchar(255);default:'';comment:证明材料" json:"material"`
|
2021-12-23 17:43:27 +08:00
|
|
|
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"`
|
2021-12-03 14:18:06 +08:00
|
|
|
Customer string `gorm:"column:customer;type:varchar(255);default:'';comment:应用客户" json:"-"`
|
2021-11-26 17:26:01 +08:00
|
|
|
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"`
|
2021-12-03 14:18:06 +08:00
|
|
|
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"-"`
|
2021-11-26 17:26:01 +08:00
|
|
|
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
2021-12-03 10:08:23 +08:00
|
|
|
Shelf
|
2022-01-21 11:42:58 +08:00
|
|
|
TechnologyStatus
|
2021-11-26 17:26:01 +08:00
|
|
|
ModelDeleted
|
|
|
|
ModelAt
|
|
|
|
}
|
|
|
|
|
|
|
|
// TechnologyProductLeadStandard 领先标准
|
|
|
|
type TechnologyProductLeadStandard int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// TechnologyProductLeadStandardForDomesticXJ 国内先进
|
|
|
|
TechnologyProductLeadStandardForDomesticXJ TechnologyProductLeadStandard = iota + 1
|
|
|
|
// TechnologyProductLeadStandardForDomesticLX 国内领先
|
|
|
|
TechnologyProductLeadStandardForDomesticLX
|
|
|
|
// TechnologyProductLeadStandardForInternationalXJ 国际先进
|
|
|
|
TechnologyProductLeadStandardForInternationalXJ
|
|
|
|
// TechnologyProductLeadStandardForInternationalLX 国际领先
|
|
|
|
TechnologyProductLeadStandardForInternationalLX
|
|
|
|
)
|
|
|
|
|
|
|
|
// TechnologyProductShelfStatus 上下架状态
|
|
|
|
type TechnologyProductShelfStatus int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// TechnologyProductShelfStatusForUp 上架
|
|
|
|
TechnologyProductShelfStatusForUp TechnologyProductShelfStatus = iota + 1
|
|
|
|
// TechnologyProductShelfStatusForDown 下架
|
|
|
|
TechnologyProductShelfStatusForDown
|
|
|
|
)
|
|
|
|
|
|
|
|
func (m *TechnologyProduct) TableName() string {
|
|
|
|
return "technology_product"
|
|
|
|
}
|
|
|
|
|
2022-01-20 15:49:44 +08:00
|
|
|
func (m *TechnologyProduct) GetLeadStandardTitle() string {
|
|
|
|
switch m.LeadStandard {
|
|
|
|
case TechnologyProductLeadStandardForDomesticXJ:
|
|
|
|
return "国内先进"
|
|
|
|
case TechnologyProductLeadStandardForDomesticLX:
|
|
|
|
return "国内领先"
|
|
|
|
case TechnologyProductLeadStandardForInternationalXJ:
|
|
|
|
return "国际先进"
|
|
|
|
case TechnologyProductLeadStandardForInternationalLX:
|
|
|
|
return "国际领先"
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:26:01 +08:00
|
|
|
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{}
|
|
|
|
}
|