feat:修改技术文档需求数据模块
This commit is contained in:
@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"SciencesServer/utils"
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -9,10 +10,9 @@ import (
|
||||
type TechnologyDemand struct {
|
||||
Model
|
||||
Local
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Title string `gorm:"column:title;type:varchar(50);default:null;comment:需求名称" json:"title"`
|
||||
Kind string `gorm:"column:kind;type:varchar(50);default:null;comment:需求类别" json:"-"`
|
||||
Area
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Title string `gorm:"column:title;type:varchar(50);default:null;comment:需求名称" json:"title"`
|
||||
Kind string `gorm:"column:kind;type:varchar(50);default:null;comment:需求类别" json:"-"`
|
||||
Name string `gorm:"column:name;type:varchar(30);default:null;comment:联系人" json:"name"`
|
||||
Mobile string `gorm:"column:mobile;type:varchar(15);default:null;comment:联系方式" json:"mobile"`
|
||||
Industry string `gorm:"column:industry;type:varchar(255);comment:行业信息" json:"industry"`
|
||||
@ -64,28 +64,31 @@ func (m *TechnologyDemand) TableName() string {
|
||||
return m.NewTableName("technology_demand")
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) SetKindAttribute(kinds []string) {
|
||||
m.Kind = utils.AnyToJSON(kinds)
|
||||
func (m *TechnologyDemand) SetKindAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Kind = string(_bytes)
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) GetKindAttribute() []string {
|
||||
kinds := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Kind, &kinds)
|
||||
return kinds
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Kind), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) SetIndustryAttribute(industrys []string) {
|
||||
m.Industry = utils.AnyToJSON(industrys)
|
||||
func (m *TechnologyDemand) SetIndustryAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Industry = string(_bytes)
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) GetIndustryAttribute() []string {
|
||||
industrys := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Industry, &industrys)
|
||||
return industrys
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Industry), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) SetOtherAttribute(other *TechnologyDemandOther) {
|
||||
m.Other = utils.AnyToJSON(other)
|
||||
func (m *TechnologyDemand) SetOtherAttribute(value *TechnologyDemandOther) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Other = string(_bytes)
|
||||
}
|
||||
|
||||
func (m *TechnologyDemand) GetOtherAttribute() *TechnologyDemandOther {
|
||||
|
Reference in New Issue
Block a user