feat:完善入驻信息管理

This commit is contained in:
henry
2021-12-03 15:22:23 +08:00
parent 851a2c1784
commit 911fcf9b1c
16 changed files with 100 additions and 27 deletions

View File

@ -5,6 +5,7 @@ import (
"SciencesServer/app/common/model"
"SciencesServer/config"
"SciencesServer/serve/orm"
"SciencesServer/utils"
)
type synchronized struct {
@ -25,8 +26,10 @@ func initModel() {
function := func(synchronized ...*synchronized) {
for _, v := range synchronized {
if !db.Migrator().HasTable(v.iModel) {
_ = db.Migrator().CreateTable(v.iModel)
err := db.Migrator().CreateTable(v.iModel)
if err != nil {
panic(err)
}
if v.iValues != nil && v.iValues() != nil {
db.Table(v.iModel.TableName()).Create(v.iValues())
}
@ -40,10 +43,10 @@ func initModel() {
&synchronized{iModel: model.NewSysConfig()},
&synchronized{iModel: model.NewSysMenu()}, &synchronized{iModel: model.NewSysAuth()},
&synchronized{iModel: model.NewSysUser(), iValues: func() interface{} {
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888", Password: "123456",
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888", Password: utils.Md5String("123456"),
IsAdmin: model.SysUserAdministratorForAdmin, Remark: "超级管理员"}
}},
&synchronized{iModel: model.NewSysUserTenant()},
&synchronized{iModel: model.NewSysUserRole()}, &synchronized{iModel: model.NewSysUserTenant()},
&synchronized{iModel: model.NewSysDepartment()},
&synchronized{iModel: model.NewSysRole()}, &synchronized{iModel: model.NewSysRoleMenu()}, &synchronized{iModel: model.NewSysRoleAuth()},
// 配置管理
@ -72,7 +75,6 @@ func initModel() {
return out
}},
// 日志管理
&synchronized{iModel: model.NewSysUserRole()},
&synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()},
// 用户管理
&synchronized{iModel: model.NewUserInstance()}, &synchronized{iModel: model.NewUserIdentity()},

View File

@ -7,7 +7,7 @@ type ActivityApply struct {
MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"`
Mode ActivityInstanceMode `gorm:"column:mode;type:tinyint(1);default:1;comment:活动模式" json:"mode"`
ActivityInstanceBasic
Content string `gorm:"column:title;type:text;default:'';comment:活动详情" json:"content"`
Content string `gorm:"column:title;type:text;comment:活动详情" json:"content"`
MaxNumber int `gorm:"column:max_number;type:int(6);default:0;comment:报名限制人数0不做限制" json:"max_number"`
Status ActivityApplyStatus `gorm:"column:status;type:tinyint(1);default:0;comment:审核状态" json:"status"`
ModelDeleted

View File

@ -9,7 +9,7 @@ type ActivityInstance struct {
Identity int `gorm:"column:identity;type:tinyint(3);default:0;comment:身份来源" json:"-"`
Mode ActivityInstanceMode `gorm:"column:mode;type:tinyint(1);default:1;comment:活动模式" json:"mode"`
ActivityInstanceBasic
Content string `gorm:"column:title;type:text;default:'';comment:活动详情" json:"content"`
Content string `gorm:"column:title;type:text;comment:活动详情" json:"content"`
MaxNumber int `gorm:"column:max_number;type:int(6);default:0;comment:报名限制人数0不做限制" json:"max_number"`
Status ActivityInstanceStatus `gorm:"column:status;type:tinyint(1);default:1;comment:活动状态1显示2隐藏" json:"status"`
ModelDeleted

View File

@ -39,7 +39,7 @@ func (m *Image) Analysis(domain string) string {
// Images 多个图片信息
type Images struct {
Images string `gorm:"column:images;type:text;default:'';comment:图片" json:"images"`
Images string `gorm:"column:images;type:text;comment:图片" json:"images"`
}
// AnalysisSlice Slice解析

View File

@ -13,7 +13,7 @@ type ManageAgent struct {
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"-"`
WorkExperience string `gorm:"column:work_experience;type:varchar(255);default:'';comment:工作经历" json:"work_experience"`
WorkPlace string `gorm:"column:work_place;type:varchar(255);default:0;comment:工作地点" json:"work_place"`
IDImage string `gorm:"column:id_image;type:text;default:'';comment:身份证图片" json:"-"`
IDImage string `gorm:"column:id_image;type:text;comment:身份证图片" json:"-"`
CredentialImage string `gorm:"column:credential_image;type:varchar(255);default:'';comment:资格证书" json:"credential_image"`
Examine
ModelDeleted

View File

@ -12,7 +12,7 @@ type ManageEquipment struct {
Title string `gorm:"column:title;type:varchar(100);default:'';comment:器材名称" json:"title"`
Params string `gorm:"column:params;type:varchar(255);default:'';comment:器材参数" json:"params"`
PurchaseAt time.Time `gorm:"column:purchase_at;type:datetime;default:'';comment:购买时间" json:"purchase_at"`
Description string `gorm:"column:description;type:text;default:'';comment:器材描述" json:"description"`
Description string `gorm:"column:description;type:text;comment:器材描述" json:"description"`
ModelDeleted
ModelAt
}

View File

@ -23,7 +23,7 @@ type ManageResearch struct {
}
func (m *ManageResearch) TableName() string {
return "manage_expert"
return "manage_research"
}
func (m *ManageResearch) GetIndustryAttribute() []string {

View File

@ -11,7 +11,7 @@ type ServiceDemand struct {
Title string `gorm:"column:title;type:varchar(50);default:'';comment:需求名称" json:"title"`
Name string `gorm:"column:name;type:varchar(50);default:'';comment:联系人" json:"name"`
Mobile string `gorm:"column:mobile;type:varchar(15);default:'';comment:联系人手机号" json:"mobile"`
Description string `gorm:"column:description;type:text;default:'';comment:需求描述" json:"description"`
Description string `gorm:"column:description;type:text;comment:需求描述" json:"description"`
Status ServiceDemandStatus `gorm:"column:status;type:tinyint(1);default:1;comment:状态" json:"status"`
ModelDeleted
ModelAt

View File

@ -8,7 +8,7 @@ type SysLog struct {
Name string `gorm:"column:name;type:varchar(20);default:'';comment:真实姓名" json:"name"`
Method string `gorm:"column:method;type:varchar(8);default:'';comment:请求方式" json:"method"`
Path string `gorm:"column:path;type:varchar(8);default:0;comment:请求地址" json:"event"`
Params string `gorm:"column:params;type:text;default:'';comment:参数信息" json:"params"`
Params string `gorm:"column:params;type:text;comment:参数信息" json:"params"`
IP string `gorm:"column:ip;type:char(16);default:'';comment:IP地址" json:"ip"`
ModelDeleted
ModelAt

View File

@ -13,8 +13,8 @@ type SysPatent struct {
ApplyName string `gorm:"column:apply_name;type:varchar(100);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(100);default:'';comment:发明人" json:"inventor"`
Description string `gorm:"column:description;type:text;default:'';comment:摘要" json:"description"`
PrincipalClaim string `gorm:"column:principal_claim;type:text;default:'';comment:主权项" json:"principal_claim"`
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;type:varchar(50);default:'';comment:IPC主分类号" json:"ipc_code"`
Shelf
Status SysParentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1授权2实审3公开)" json:"-"`

View File

@ -21,7 +21,7 @@ type TechnologyInstance struct {
Territory uint64 `gorm:"column:territory;type:int(11);default:0;comment:技术领域" json:"territory"`
Transaction int `gorm:"column:transaction;type:tinyint(3);default:0;comment:交易方式" json:"transaction"`
Images
ProveImages string `gorm:"column:prove_images;type:text;default:'';comment:证明材料图片" json:"prove_images"`
ProveImages string `gorm:"column:prove_images;type:text;comment:证明材料图片" json:"prove_images"`
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
Purpose string `gorm:"column:purpose;type:text;comment:意图-承担科研项目" json:"purpose"`
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`