feat:优化项目信息
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
config2 "SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/serve/orm"
|
||||
@ -52,6 +53,24 @@ func initModel() {
|
||||
&synchronized{iModel: model.NewSysPatent(), iValues: func() interface{} {
|
||||
return nil
|
||||
}},
|
||||
&synchronized{iModel: model.NewSysIdentity(), iValues: func() interface{} {
|
||||
out := make([]*model.SysIdentity, 0)
|
||||
|
||||
for k, v := range config2.TenantUserIdentityData {
|
||||
registerCount := 1
|
||||
|
||||
if k == config2.TenantUserIdentityForCompany {
|
||||
registerCount = -1
|
||||
}
|
||||
out = append(out, &model.SysIdentity{
|
||||
Identity: k,
|
||||
Name: v,
|
||||
RegisterCount: registerCount,
|
||||
IsExamine: 1,
|
||||
})
|
||||
}
|
||||
return out
|
||||
}},
|
||||
// 日志管理
|
||||
&synchronized{iModel: model.NewSysUserRole()},
|
||||
&synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()},
|
||||
|
@ -23,14 +23,24 @@ func (m *ManageCompany) TableName() string {
|
||||
return "manage_company"
|
||||
}
|
||||
|
||||
func (m *ManageCompany) GetKeywordAttribute() []string {
|
||||
keywords := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Keyword, &keywords)
|
||||
return keywords
|
||||
func (m *ManageCompany) GetIndustryAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Industry, &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *ManageCompany) SetKeywordAttribute(keywords []string) {
|
||||
m.Keyword = utils.AnyToJSON(keywords)
|
||||
func (m *ManageCompany) SetIndustryAttribute(value []string) {
|
||||
m.Industry = utils.AnyToJSON(value)
|
||||
}
|
||||
|
||||
func (m *ManageCompany) GetKeywordAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Keyword, &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *ManageCompany) SetKeywordAttribute(value []string) {
|
||||
m.Keyword = utils.AnyToJSON(value)
|
||||
}
|
||||
|
||||
func NewManageCompany() *ManageCompany {
|
||||
|
20
app/common/model/sys_identity.go
Normal file
20
app/common/model/sys_identity.go
Normal file
@ -0,0 +1,20 @@
|
||||
package model
|
||||
|
||||
// SysIdentity 身份管理数据模型
|
||||
type SysIdentity struct {
|
||||
Model
|
||||
Identity int `gorm:"column:identity;uniqueIndex:idx_sys_identity;type:tinyint(3);default:0;comment:身份信息" json:"identity"`
|
||||
Name string `gorm:"column:name;type:varchar(20);default:null;comment:身份名称" json:"name"`
|
||||
RegisterCount int `gorm:"column:register_count;type:tinyint(3);default:0;comment:每个平台下可以最大注册人数,-1不作限制" json:"register_count"`
|
||||
IsExamine int `gorm:"column:is_examine;type:tinyint(1);default:0;comment:是否需要后台审核" json:"is_examine"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *SysIdentity) TableName() string {
|
||||
return "sys_identity"
|
||||
}
|
||||
|
||||
func NewSysIdentity() *SysIdentity {
|
||||
return &SysIdentity{}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package model
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type SysTenant struct {
|
||||
Model
|
||||
Key string `gorm:"column:key;type:varchar(30);default:null;comment:key" json:"key"`
|
||||
@ -10,7 +12,7 @@ type SysTenant struct {
|
||||
Images
|
||||
Area
|
||||
Position string `gorm:"column:position;type:varchar(255);default:null;comment:坐标" json:"-"`
|
||||
Industry uint64 `gorm:"column:industry;type:int(11);default:0;comment:所属领域" json:"industry"`
|
||||
Industry string `gorm:"column:industry;type:varchar(255);default:null;comment:所属领域;行业信息" json:"-"`
|
||||
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
||||
Config string `gorm:"column:config;type:varchar(255);default:null;comment:配置信息" json:"-"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
|
||||
@ -22,6 +24,17 @@ func (m *SysTenant) TableName() string {
|
||||
return "sys_tenant"
|
||||
}
|
||||
|
||||
func (m *SysTenant) GetIndustryAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = json.Unmarshal([]byte(m.Industry), &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *SysTenant) SetIndustryAttribute(value []string) {
|
||||
_bytes, _ := json.Marshal(value)
|
||||
m.Industry = string(_bytes)
|
||||
}
|
||||
|
||||
func NewSysTenant() *SysTenant {
|
||||
return &SysTenant{}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ type TechnologyDemand struct {
|
||||
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"`
|
||||
Industry string `gorm:"column:industry;type:varchar(255);comment:所属领域;行业信息" json:"industry"`
|
||||
Introduce string `gorm:"column:introduce;type:text;comment:需求描述" json:"introduce"`
|
||||
Budget float64 `gorm:"column:budget;type:decimal(10,2);default:0;comment:投产预算" json:"budget"`
|
||||
BudgetMode TechnologyDemandBudgetMode `gorm:"column:budget_mode;type:tinyint(1);default:1;comment:预算模式(1:具体金额,2:面议)" json:"budget_mode"`
|
||||
|
@ -14,7 +14,7 @@ type TechnologyProduct struct {
|
||||
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"`
|
||||
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"`
|
||||
|
18
app/common/model/user_company.go
Normal file
18
app/common/model/user_company.go
Normal file
@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
// UserCompany 用户公司数据模型
|
||||
type UserCompany struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
CompanyID uint64 `gorm:"column:company_id;type:int(11);default:0;comment:公司模型ID" json:"-"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *UserCompany) TableName() string {
|
||||
return "user_company"
|
||||
}
|
||||
|
||||
func NewUserCompany() *UserCompany {
|
||||
return &UserCompany{}
|
||||
}
|
@ -1,14 +1,24 @@
|
||||
package model
|
||||
|
||||
// UserConsume 用户资产消耗
|
||||
// UserConsume 用户资产消耗数据模型
|
||||
type UserConsume struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Source int `json:"source"`
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Source UserConsumeSource `gorm:"column:source;type:tinyiny(1);default:null;comment:消耗来源" json:"source"`
|
||||
Consume float64 `gorm:"column:consume;type:decimal(10,2);default:null;comment:消耗数量" json:"consume"`
|
||||
Surplus float64 `gorm:"column:surplus;type:decimal(10,2);default:null;comment:剩余数量" json:"surplus"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
type UserConsumeSource int
|
||||
|
||||
const (
|
||||
// UserConsumeSourceForRecharge 充值
|
||||
UserConsumeSourceForRecharge UserConsumeSource = iota + 1
|
||||
)
|
||||
|
||||
func (m *UserConsume) TableName() string {
|
||||
return "user_consume"
|
||||
}
|
||||
|
@ -10,10 +10,9 @@ import (
|
||||
// UserManage 用户管理信息
|
||||
type UserManage struct {
|
||||
Model
|
||||
ModelTenant
|
||||
UUID uint64 `gorm:"column:uuid;uniqueIndex:idx_user_manage_uuid;type:int;default:0;comment:用户唯一UUID" json:"-"`
|
||||
ManageID uint64 `gorm:"column:manage_id;type:int(11);default:0;comment:信息管理ID,根据所在身份,对应不同数据表" json:"-"`
|
||||
UID uint64 `gorm:"column:uid;index:idx_user_manage_uid;type:int;default:0;comment:用户表UUID" json:"-"`
|
||||
ManageID uint64 `gorm:"column:manage_id;type:int(11);default:0;comment:信息管理ID,根据所在身份,对应不同数据表" json:"-"`
|
||||
Name string `gorm:"column:name;type:varchar(20);default:null;comment:真实姓名" json:"name"`
|
||||
Email string `gorm:"column:email;type:varchar(50);default:null;comment:邮箱" json:"email"`
|
||||
Job string `gorm:"column:job;type:varchar(50);default:null;comment:职务" json:"job"`
|
||||
|
Reference in New Issue
Block a user