Documentation
¶
Index ¶
Constants ¶
View Source
const ( ModelNameUser = "User" PreloadUsers = "Users" )
View Source
const ( UserStatusActive = iota + 1 UserStatusDisabled UserStatusInactive )
View Source
const (
PreloadApis = "Apis"
)
View Source
const PreloadRoles = "Roles"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
ID int64 `gorm:"column:id;primarykey" json:"id,omitempty"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt,omitempty"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt,omitempty"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
Name string `gorm:"column:name" json:"name,omitempty"`
Path string `gorm:"column:path" json:"path,omitempty"`
Method string `gorm:"column:method" json:"method,omitempty"`
Description string `gorm:"column:description" json:"description,omitempty"`
Roles []*Role `gorm:"many2many:role_apis" json:"roles,omitempty"`
}
type CasbinRule ¶
type CasbinRule struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
PType *string `gorm:"column:ptype" json:"ptype"`
V0 *string `gorm:"column:v0" json:"v0"`
V1 *string `gorm:"column:v1" json:"v1"`
V2 *string `gorm:"column:v2" json:"v2"`
V3 *string `gorm:"column:v3" json:"v3"`
V4 *string `gorm:"column:v4" json:"v4"`
V5 *string `gorm:"column:v5" json:"v5"`
}
func (*CasbinRule) TableName ¶
func (*CasbinRule) TableName() string
type FeiShuUser ¶
type FeiShuUser struct {
UID int64 `gorm:"column:uid;primarykey;comment:关联users表中的用户id" json:"uid"`
User *User `gorm:"foreignKey:UID;references:ID" json:"user"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
AvatarBig string `gorm:"column:avatar_big;size:255;comment:飞书用户avatar_big" json:"avatar_big"`
AvatarMiddle string `gorm:"column:avatar_middle;size:255;comment:飞书用户avatar_middle" json:"avatar_middle"`
AvatarThumb string `gorm:"column:avatar_thumb;size:255;comment:飞书用户avatar_thumb" json:"avatar_thumb"`
AvatarUrl string `gorm:"column:avatar_url;size:255;comment:飞书用户avatar_url" json:"avatar_url"`
Email string `gorm:"column:email;size:255;comment:飞书用户email" json:"email"`
EmployeeNo string `gorm:"column:employee_no;size:255;comment:飞书用户employee_no" json:"employee_no"`
EnName string `gorm:"column:en_name;size:255;comment:飞书用户en_name" json:"en_name"`
EnterpriseEmail string `gorm:"column:enterprise_email;size:255;comment:飞书用户enterprise_email" json:"enterprise_email"`
Mobile string `gorm:"column:mobile;size:255;comment:飞书用户mobile" json:"mobile"`
Name string `gorm:"column:name;size:255;comment:飞书用户name" json:"name"`
OpenID string `gorm:"column:open_id;size:255;comment:飞书用户open_id" json:"open_id"`
TenantKey string `gorm:"column:tenant_key;size:255;comment:飞书用户tenant_key" json:"tenant_key"`
UnionID string `gorm:"column:union_id;size:255;comment:飞书用户union_id" json:"union_id"`
UserID string `gorm:"column:user_id;size:255;comment:飞书用户ID;index:idx_user_id_status,priority:1" json:"user_id"`
}
func (*FeiShuUser) TableName ¶
func (receiver *FeiShuUser) TableName() string
type KeycloakUser ¶
type KeycloakUser struct {
Sub string `json:"sub"`
EmailVerified bool `json:"email_verified"`
Roles []string `json:"roles"`
Name string `json:"name"`
PreferredUsername string `json:"preferred_username"`
GivenName string `json:"given_name"`
FamilyName string `json:"family_name"`
Email string `json:"email"`
Group []string `json:"group"`
}
type Role ¶
type Role struct {
ID int64 `gorm:"column:id;primarykey" json:"id,omitempty"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt,omitempty"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt,omitempty"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
Name string `gorm:"column:name" json:"name,omitempty"`
Description string `gorm:"column:description" json:"description,omitempty"`
Users []*User `gorm:"many2many:user_roles" json:"users,omitempty"`
Apis []*Api `gorm:"many2many:role_apis" json:"apis,omitempty"`
}
func (*Role) AssociationModelName ¶
type User ¶
type User struct {
ID int64 `gorm:"column:id;primarykey;autoIncrement" json:"id"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
Name string `gorm:"column:name;comment:用户名称;size:50" json:"name"`
NickName string `gorm:"column:nick_name;comment:用户昵称;size:50" json:"nickName"`
Department string `gorm:"column:department;comment:用户部门;size:50" json:"department"`
Email string `gorm:"column:email;comment:邮箱;size:100" json:"email"`
Password string `gorm:"column:password;comment:用户密码;size:255" json:"-"`
Avatar string `gorm:"column:avatar;comment:用户头像;size:1024" json:"avatar"`
Mobile string `gorm:"column:mobile;comment:用户手机号;size:20" json:"mobile"`
Status *int `gorm:"column:status;comment:用户状态,1可用,2禁用,3未激活;size:1;default:1" json:"status"`
Roles []*Role `gorm:"many2many:user_roles" json:"roles,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.