feat: RBAC 基本完成

This commit is contained in:
Blizzard
2025-09-14 21:58:44 +08:00
parent 2ec091bf59
commit 9be75d53fe
35 changed files with 615 additions and 87 deletions
+4 -2
View File
@@ -6,21 +6,23 @@ import (
type Login interface {
GetAccount() string
GetUserId() uint
GetUserId() string
GetUserInfo() any
}
type User struct {
global.BaseModel
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
ClientId string `gorm:"size:20;" json:"clientId"`
Account string `gorm:"size:11;unique;" json:"account" form:"account"`
Password string `gorm:"size:100;" json:"-" form:"password"`
Phone string `gorm:"size:11;" json:"phone" form:"phone"`
Roles []Role `gorm:"many2many:user_role;" json:"roles"`
}
func (u *User) GetAccount() string {
return u.Account
}
func (u *User) GetUserId() uint {
func (u *User) GetUserId() string {
return u.Id
}