feat:优化项目信息

This commit is contained in:
henry
2022-02-08 08:56:28 +08:00
parent a25464289f
commit 252182f089
13 changed files with 67 additions and 138 deletions

View File

@ -61,9 +61,6 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewSysConfig(), iValues: func() interface{} {
return nil
}},
&synchronized{iModel: model.NewSysPatent(), iValues: func() interface{} {
return nil
}},
&synchronized{iModel: model.NewSysIdentity(), iValues: func() interface{} {
out := make([]*model.SysIdentity, 0)

View File

@ -1,68 +0,0 @@
package model
// SysPatent 专利信息数据模型
type SysPatent struct {
Model
ModelTenant
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Kind SysParentKind `gorm:"column:kind;index:idx_sys_patent_kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:名称标题" json:"title"`
FileUrl string `gorm:"column:file_url;type:varchar(255);default:'';comment:文件地址" json:"file_url"`
ApplyCode string `gorm:"column:apply_code;type:varchar(30);default:'';comment:申请号" json:"apply_code"`
ApplyAt string `gorm:"column:apply_at;type:varchar(10);default:'';comment:申请日" json:"apply_at"`
OpenCode string `gorm:"column:open_code;type:varchar(30);default:'';comment:公开(公告)号" json:"open_code"`
OpenAt string `gorm:"column:open_at;type:varchar(10);default:'';comment:公开(公告)日" json:"open_at"`
ApplyName string `gorm:"column:apply_name;type:varchar(255);default:'';comment:申请(专利权)人" json:"apply_name"`
ApplyAddress string `gorm:"column:apply_address;type:varchar(255);default:'';comment:申请人地址" json:"apply_address"`
Inventor string `gorm:"column:inventor;type:varchar(255);default:'';comment:发明人" json:"inventor"`
Description string `gorm:"column:description;type:text;comment:摘要" json:"description"`
PrincipalClaim string `gorm:"column:principal_claim;type:text;comment:主权项" json:"principal_claim"`
IPCCode string `gorm:"column:ipc_code;index:idx_sys_patent_ipc_code;type:varchar(30);default:'';comment:IPC主分类号" json:"ipc_code"`
Shelf
Status SysParentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1授权2实审3公开)" json:"-"`
ModelDeleted
ModelAt
}
// SysParentKind 专利类型
type SysParentKind int
const (
// SysParentKindForInvent 发明专利
SysParentKindForInvent SysParentKind = iota + 1
// SysParentKindForDesign 外观设计
SysParentKindForDesign
// SysParentKindForNewPractical 实用新型
SysParentKindForNewPractical
)
// SysParentStatus 专利状态
type SysParentStatus int
const (
// SysParentStatusForAuthorize 授权
SysParentStatusForAuthorize SysParentStatus = iota + 1
// SysParentStatusForActualTrial 实审
SysParentStatusForActualTrial
// SysParentStatusForPublic 公开
SysParentStatusForPublic
)
func (m *SysPatent) TableName() string {
return "sys_patent"
}
func (m *SysPatent) KindTitle() string {
if m.Kind == SysParentKindForInvent {
return "发明专利"
} else if m.Kind == SysParentKindForDesign {
return "外观设计"
} else if m.Kind == SysParentKindForNewPractical {
return "实用新型"
}
return "未知"
}
func NewSysPatent() *SysPatent {
return &SysPatent{}
}

View File

@ -4,22 +4,22 @@ package model
type TechnologyPatent struct {
Model
ModelTenant
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Kind SysParentKind `gorm:"column:kind;index:idx_sys_patent_kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:名称标题" json:"title"`
FileUrl string `gorm:"column:file_url;type:varchar(255);default:'';comment:文件地址" json:"file_url"`
ApplyCode string `gorm:"column:apply_code;type:varchar(30);default:'';comment:申请号" json:"apply_code"`
ApplyAt string `gorm:"column:apply_at;type:varchar(10);default:'';comment:申请日" json:"apply_at"`
OpenCode string `gorm:"column:open_code;type:varchar(30);default:'';comment:公开(公告)号" json:"open_code"`
OpenAt string `gorm:"column:open_at;type:varchar(10);default:'';comment:公开(公告)日" json:"open_at"`
ApplyName string `gorm:"column:apply_name;type:varchar(255);default:'';comment:申请(专利权)人" json:"apply_name"`
ApplyAddress string `gorm:"column:apply_address;type:varchar(255);default:'';comment:申请人地址" json:"apply_address"`
Inventor string `gorm:"column:inventor;type:varchar(255);default:'';comment:发明人" json:"inventor"`
Description string `gorm:"column:description;type:text;comment:摘要" json:"description"`
PrincipalClaim string `gorm:"column:principal_claim;type:text;comment:主权项" json:"principal_claim"`
IPCCode string `gorm:"column:ipc_code;index:idx_sys_patent_ipc_code;type:varchar(30);default:'';comment:IPC主分类号" json:"ipc_code"`
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Kind TechnologyPatentKind `gorm:"column:kind;index:idx_sys_patent_kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:名称标题" json:"title"`
FileUrl string `gorm:"column:file_url;type:varchar(255);default:'';comment:文件地址" json:"file_url"`
ApplyCode string `gorm:"column:apply_code;type:varchar(30);default:'';comment:申请号" json:"apply_code"`
ApplyAt string `gorm:"column:apply_at;type:varchar(10);default:'';comment:申请日" json:"apply_at"`
OpenCode string `gorm:"column:open_code;type:varchar(30);default:'';comment:公开(公告)号" json:"open_code"`
OpenAt string `gorm:"column:open_at;type:varchar(10);default:'';comment:公开(公告)日" json:"open_at"`
ApplyName string `gorm:"column:apply_name;type:varchar(255);default:'';comment:申请(专利权)人" json:"apply_name"`
ApplyAddress string `gorm:"column:apply_address;type:varchar(255);default:'';comment:申请人地址" json:"apply_address"`
Inventor string `gorm:"column:inventor;type:varchar(255);default:'';comment:发明人" json:"inventor"`
Description string `gorm:"column:description;type:text;comment:摘要" json:"description"`
PrincipalClaim string `gorm:"column:principal_claim;type:text;comment:主权项" json:"principal_claim"`
IPCCode string `gorm:"column:ipc_code;index:idx_sys_patent_ipc_code;type:varchar(30);default:'';comment:IPC主分类号" json:"ipc_code"`
Shelf
Status SysParentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1授权2实审3公开)" json:"-"`
Status TechnologyPatentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1授权2实审3公开)" json:"-"`
ModelDeleted
ModelAt
}
@ -53,11 +53,11 @@ func (m *TechnologyPatent) TableName() string {
}
func (m *TechnologyPatent) KindTitle() string {
if m.Kind == SysParentKindForInvent {
if m.Kind == TechnologyPatentKindForInvent {
return "发明专利"
} else if m.Kind == SysParentKindForDesign {
} else if m.Kind == TechnologyPatentKindForDesign {
return "外观设计"
} else if m.Kind == SysParentKindForNewPractical {
} else if m.Kind == TechnologyPatentKindForNewPractical {
return "实用新型"
}
return "未知"