feat:完善项目信息
This commit is contained in:
@ -4,7 +4,8 @@ package model
|
||||
type ActivityApply struct {
|
||||
Model
|
||||
ModelTenant
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
Identity int `gorm:"column:identity;type:tinyint(3);default:0;comment:身份信息" json:"-"`
|
||||
ActivityInstanceBasic
|
||||
Contact string `gorm:"column:contact;type:varchar(20);default:'';comment:联系人" json:"contact"`
|
||||
ContactMobile string `gorm:"column:contact_mobile;type:varchar(15);default:'';comment:联系方式" json:"contact_mobile"`
|
||||
|
@ -3,10 +3,12 @@ package model
|
||||
// SysNavigation 自定义导航栏数据模型
|
||||
type SysNavigation struct {
|
||||
Model
|
||||
ModelTenant
|
||||
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"parent_id"`
|
||||
Title string `gorm:"column:title;type:varchar(20);default:'';comment:区域名称" json:"title"`
|
||||
Link string `gorm:"column:link;type:varchar(255);default:'';comment:访问地址" json:"link"`
|
||||
Sort int `gorm:"column:sort;type:tinyint(3);default:0;comment:排序,从大到小" json:"-"`
|
||||
IsTarget int `gorm:"column:is_target;type:tinyint(1);default:0;comment:是否新窗口打开(0:否,1:是)" json:"is_target"`
|
||||
Sort int `gorm:"column:sort;type:tinyint(3);default:0;comment:排序,从小到小" json:"-"`
|
||||
Status SysNavigationStatus `gorm:"column:status;type:tinyint(1);default:1;comment:状态" json:"-"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
|
@ -1,15 +1,8 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"SciencesServer/utils"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// UserIdentity 用户身份管理数据模型
|
||||
type UserIdentity struct {
|
||||
Model
|
||||
UUID uint64 `gorm:"column:uuid;uniqueIndex:idx_user_manage_uuid;type:int;default:0;comment:用户唯一UUID" json:"-"`
|
||||
UID uint64 `gorm:"column:uid;index:idx_user_manage_uid;type:int;default:0;comment:用户表UUID" json:"-"`
|
||||
Name string `gorm:"column:name;type:varchar(20);default:'';comment:真实姓名" json:"name"`
|
||||
Email string `gorm:"column:email;type:varchar(50);default:'';comment:邮箱" json:"email"`
|
||||
@ -36,13 +29,6 @@ func (m *UserIdentity) TableName() string {
|
||||
return m.NewTableName("user_identity")
|
||||
}
|
||||
|
||||
func (m *UserIdentity) BeforeCreate(db *gorm.DB) error {
|
||||
snowflake, _ := utils.NewSnowflake(1)
|
||||
m.UUID = uint64(snowflake.GetID())
|
||||
m.CreatedAt = time.Now()
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewUserIdentity() *UserIdentity {
|
||||
return &UserIdentity{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user