47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// TechnologyPatentClassify 专利分类信息数据模型
|
|
type TechnologyPatentClassify struct {
|
|
Model
|
|
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"parent_id"`
|
|
IPC string `gorm:"column:ipc;type:varchar(18);default:'';comment:IPC主分类号" json:"ipc"`
|
|
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:行业领域" json:"-"`
|
|
IndustryDetail string `gorm:"column:industry_detail;type:varchar(255);default:'';comment:详细行业领域,包含父级领域信息" json:"industry_detail"`
|
|
ModelDeleted
|
|
ModelAt
|
|
}
|
|
|
|
func (m *TechnologyPatentClassify) TableName() string {
|
|
return "technology_patent_classify"
|
|
}
|
|
|
|
func (m *TechnologyPatentClassify) GetIndustryAttribute() []string {
|
|
out := make([]string, 0)
|
|
_ = json.Unmarshal([]byte(m.Industry), &out)
|
|
return out
|
|
}
|
|
|
|
func (m *TechnologyPatentClassify) SetIndustryAttribute(value []string) {
|
|
_bytes, _ := json.Marshal(value)
|
|
m.Industry = string(_bytes)
|
|
}
|
|
|
|
func (m *TechnologyPatentClassify) GetIndustryDetailAttribute() []string {
|
|
out := make([]string, 0)
|
|
_ = json.Unmarshal([]byte(m.IndustryDetail), &out)
|
|
return out
|
|
}
|
|
|
|
func (m *TechnologyPatentClassify) SetIndustryDetailAttribute(value []string) {
|
|
_bytes, _ := json.Marshal(value)
|
|
m.IndustryDetail = string(_bytes)
|
|
}
|
|
|
|
func NewTechnologyPatentClassify() *TechnologyPatentClassify {
|
|
return &TechnologyPatentClassify{}
|
|
}
|