feat: rbac迁移完成,并已部署至dev服务器
This commit is contained in:
@@ -62,24 +62,15 @@ func (SundynixRoleMenu) TableName() string {
|
||||
return "sundynix_role_menu"
|
||||
}
|
||||
|
||||
// SundynixUserRole 用户角色关联表
|
||||
type SundynixUserRole struct {
|
||||
UserID string `gorm:"size:50;primaryKey;column:user_id" json:"userId"`
|
||||
RoleID string `gorm:"size:50;primaryKey;column:role_id" json:"roleId"`
|
||||
}
|
||||
|
||||
func (SundynixUserRole) TableName() string {
|
||||
return "sundynix_user_role"
|
||||
}
|
||||
|
||||
// SundynixOperationRecord 操作记录表
|
||||
type SundynixOperationRecord struct {
|
||||
model.BaseModel
|
||||
ClientID string `gorm:"size:50;column:client_id;comment:客户端标识" json:"clientId"`
|
||||
IP string `gorm:"column:ip;comment:请求ip" json:"ip"`
|
||||
Method string `gorm:"column:method;comment:请求方法" json:"method"`
|
||||
Path string `gorm:"column:path;comment:请求路径" json:"path"`
|
||||
Status int `gorm:"column:status;comment:请求状态" json:"status"`
|
||||
Latency time.Duration `gorm:"column:latency;comment:延迟" json:"latency"`
|
||||
Latency time.Duration `gorm:"column:latency;comment:耗时(纳秒)" json:"latency"`
|
||||
Agent string `gorm:"type:text;column:agent;comment:代理" json:"agent"`
|
||||
ErrorMessage string `gorm:"column:error_message;comment:错误信息" json:"errorMessage"`
|
||||
Body string `gorm:"type:text;column:body;comment:请求Body" json:"body"`
|
||||
@@ -104,3 +95,37 @@ type SundynixDict struct {
|
||||
func (SundynixDict) TableName() string {
|
||||
return "sundynix_dict"
|
||||
}
|
||||
|
||||
// SundynixUser 用户基础表
|
||||
type SundynixUser struct {
|
||||
model.BaseModel
|
||||
TenantID string `gorm:"size:20;column:tenant_id" json:"tenantId"`
|
||||
ClientID string `gorm:"size:20;column:client_id" json:"clientId"`
|
||||
Name string `gorm:"size:100;column:name" json:"name"`
|
||||
Account string `gorm:"size:50;column:account" json:"account"`
|
||||
Password string `gorm:"size:100;column:password" json:"-"`
|
||||
NickName string `gorm:"size:100;column:nick_name" json:"nickName"`
|
||||
Phone string `gorm:"size:20;column:phone" json:"phone"`
|
||||
SessionKey string `gorm:"size:80;column:session_key" json:"-"`
|
||||
UnionID string `gorm:"size:80;column:union_id" json:"unionId"`
|
||||
OpenID string `gorm:"size:80;column:open_id;index" json:"openId"`
|
||||
SaOpenID string `gorm:"size:80;column:sa_open_id" json:"saOpenId"`
|
||||
AvatarID string `gorm:"size:50;column:avatar_id" json:"avatarId"`
|
||||
Gender int `gorm:"default:0;column:gender" json:"gender"`
|
||||
LastLoginIP string `gorm:"size:20;column:last_login_ip" json:"lastLoginIp"`
|
||||
LastLoginAt *time.Time `gorm:"column:last_login_at" json:"lastLoginAt"`
|
||||
}
|
||||
|
||||
func (SundynixUser) TableName() string {
|
||||
return "sundynix_user"
|
||||
}
|
||||
|
||||
// SundynixUserRole 用户角色关联表
|
||||
type SundynixUserRole struct {
|
||||
UserID string `gorm:"size:50;primaryKey;column:user_id" json:"userId"`
|
||||
RoleID string `gorm:"size:50;primaryKey;column:role_id" json:"roleId"`
|
||||
}
|
||||
|
||||
func (SundynixUserRole) TableName() string {
|
||||
return "sundynix_user_role"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user