Documentation
¶
Index ¶
- type AdminPermissions
- type AppInfo
- type Authority
- type InstanceDb
- type InstanceObjectDB
- type Permissions
- type PlatformAdmin
- func (ad *PlatformAdmin) Default() interface{}
- func (ad *PlatformAdmin) GetTypeAttribute(value interface{}) interface{}
- func (ad *PlatformAdmin) Scan(userId int64) error
- func (ad *PlatformAdmin) TableName() string
- func (ad *PlatformAdmin) User() *PlatformAdmin
- func (ad *PlatformAdmin) Value() interface{}
- type RetrieveDB
- type RolePermissions
- type SysRoles
- type Token
- type UserRoles
- type UserToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminPermissions ¶
type AdminPermissions struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
UserId int64 `gorm:"column:user_id;type:int" json:"userId"`
PermissionId int64 `gorm:"column:permission_id;type:int" json:"permissionId"`
TenantsId int64 `gorm:"column:tenants_id;type:int" json:"tenantsId"`
AppId int64 `gorm:"column:app_id;type:int" json:"appId"`
RoleId int64 `gorm:"column:role_id;type:int(11);NOT NULL" json:"role_id"`
RouteNameMd5Value string `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`
RouteName string `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
}
func (*AdminPermissions) TableName ¶
func (s *AdminPermissions) TableName() string
type AppInfo ¶
type AppInfo struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
Key string `gorm:"type:varchar(20);not null;size:20;unique" json:"key" form:"key"` // 应用key
Name string `gorm:"type:varchar(255);not null;" json:"name" form:"name"` // 应用名称
IsCreated int64 `gorm:"type:int(1);not null;default:2;" json:"is_created" form:"is_created"` // 是否创建DB实例
Status int64 `gorm:"type:int(1);not null;default:0;" json:"status" form:"status"` // 应用名称
Description string `gorm:"type:varchar(255)" json:"description" form:"description"` // 应用描述
AppName string `gorm:"type:varchar(255)" json:"app_name" form:"app_name"`
Port string `gorm:"type:varchar(255)" json:"port" form:"port"`
No int64 `gorm:"type:int(11)" json:"no" form:"no"`
CreatedAt zone.Time `gorm:"column:created_at"`
UpdatedAt zone.Time `gorm:"column:updated_at"`
}
AppInfo 应用信息表
type Authority ¶
type Authority struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
Pid int64 `gorm:"type:int(11);not null;size:11" json:"pid" form:"pid"`
AppId int64 `gorm:"type:int(11);not null;size:11" json:"app_id" form:"app_id"`
Name string `gorm:"type:varchar(255);not null;" json:"name" form:"name"`
MenuName string `gorm:"type:varchar(255);" json:"menu_name" form:"menu_name"`
Description string `gorm:"type:varchar(255);not null;" json:"description" form:"description"`
RegisterFileName string `gorm:"type:varchar(255);not null;" json:"register_file_name" form:"register_file_name"`
MainHandlerName string `gorm:"type:varchar(255);not null;" json:"main_handler_name" form:"main_handler_name"`
Method string `gorm:"type:varchar(255);not null;" json:"method" form:"method"`
FormattedPath string `gorm:"type:varchar(255);not null;" json:"formatted_path" form:"formatted_path"`
StaticPath string `gorm:"type:varchar(255);not null;" json:"static_path" form:"static_path"`
Path string `gorm:"type:varchar(255);not null;" json:"path" form:"path"`
SourceFileName string `gorm:"type:varchar(255);not null;" json:"source_file_name" form:"source_file_name"`
RouteName string `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
Status int64 `gorm:"type:int(11);not null;default:0;" json:"status" form:"status"`
Md5Value string `gorm:"type:varchar(255);not null;" json:"md5_value" form:"md5_value"`
RouteNameMd5Value string `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`
CreatedAt zone.Time `gorm:"column:created_at"`
UpdatedAt zone.Time `gorm:"column:updated_at"`
}
Authority 权限模型
type InstanceDb ¶
type InstanceDb struct {
ID int64 `gorm:"column:id;primary_key;auto_increment"`
Code string `gorm:"column:code;type:varchar(255);not null"`
AppName string `gorm:"column:app_name;type:varchar(255);not null"`
UseType string `gorm:"column:use_type;type:varchar(255);not null"`
AppId int64 `gorm:"column:app_id;type:int unsigned;not null"`
Host string `gorm:"column:host;type:varchar(255);not null"`
DriverName string `gorm:"column:drivername;type:varchar(255);not null"`
Port int `gorm:"column:port;type:int unsigned;not null"`
Prefix string `gorm:"column:prefix;type:varchar(255);not null"`
DbName string `gorm:"column:dbname;type:varchar(255);not null"`
Dbuser string `gorm:"column:dbuser;type:varchar(255);not null"`
Charset string `gorm:"column:charset;type:varchar(255);not null"`
Collation string `gorm:"column:collation;type:varchar(255);not null"`
SetmaxIdleconns int `gorm:"column:setmaxIdleconns;type:int unsigned;not null"`
Setmaxopenconns int `gorm:"column:setmaxopenconns;type:int unsigned;not null"`
Setconnmaxlifetime int `gorm:"column:setconnmaxlifetime;type:int unsigned;not null"`
Status int `gorm:"column:status;type:int(1);"`
NetSwitch int `gorm:"column:net_switch;type:int(1);"`
Password string `gorm:"column:password;type:varchar(255);not null"`
Intranet string `gorm:"column:intranet;type:varchar(255);not null"` //内网访问地址
OuterNet string `gorm:"column:outer_net;type:varchar(255);not null"` //外网访问地址
CreatedAt zone.Time `gorm:"column:created_at"`
UpdatedAt zone.Time `gorm:"column:updated_at"`
}
InstanceDb 租户数据信息模型
type InstanceObjectDB ¶
type Permissions ¶
type Permissions struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
PermissionId int64 `gorm:"column:permission_id;type:int(11);NOT NULL;uniqueIndex" json:"permission_id"`
Pid int64 `gorm:"type:int(11);not null;size:11" json:"pid" form:"pid"`
AppId int64 `gorm:"type:int(11);not null;size:11" json:"app_id" form:"app_id"`
Name string `gorm:"type:varchar(255);not null;" json:"name" form:"name"`
MenuName string `gorm:"type:varchar(255);" json:"menu_name" form:"menu_name"`
Description string `gorm:"type:varchar(255);not null;" json:"description" form:"description"`
RegisterFileName string `gorm:"type:varchar(255);not null;" json:"register_file_name" form:"register_file_name"`
MainHandlerName string `gorm:"type:varchar(255);not null;" json:"main_handler_name" form:"main_handler_name"`
Method string `gorm:"type:varchar(255);not null;" json:"method" form:"method"`
FormattedPath string `gorm:"type:varchar(255);not null;" json:"formatted_path" form:"formatted_path"`
StaticPath string `gorm:"type:varchar(255);not null;" json:"static_path" form:"static_path"`
Path string `gorm:"type:varchar(255);not null;" json:"path" form:"path"`
SourceFileName string `gorm:"type:varchar(255);not null;" json:"source_file_name" form:"source_file_name"`
RouteName string `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
Status int64 `gorm:"type:int(1);not null;default:0;" json:"status" form:"status"`
Md5Value string `gorm:"type:varchar(255);not null;" json:"md5_value" form:"md5_value"`
RouteNameMd5Value string `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`
CreatedAt zone.Time `gorm:"column:created_at"`
UpdatedAt zone.Time `gorm:"column:updated_at"`
}
Permissions 权限明细表
type PlatformAdmin ¶
type PlatformAdmin struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
Mobile string `gorm:"size:11;unique;" json:"mobile" form:"mobile"` // 手机
UserName string `gorm:"size:100;" json:"username" form:"username"` // 用户名
Email string `gorm:"size:255;" json:"email" form:"email"` // 邮箱
EmailVerified bool `gorm:"default:false" json:"emailVerified" form:"emailVerified"` // 邮箱是否验证
Nickname string `gorm:"size:255;" json:"nickname" form:"nickname"` // 昵称
Avatar string `gorm:"type:text" json:"avatar" form:"avatar"` // 头像
BackgroundImage string `gorm:"type:text" json:"backgroundImage" form:"backgroundImage"` // 个人中心背景图片
Password string `gorm:"size:512" json:"-" form:"password"` // 密码
HomePage string `gorm:"size:1024" json:"homePage" form:"homePage"` // 个人主页
Description string `gorm:"type:text" json:"description" form:"description"` // 个人描述
Score int64 `gorm:"not null;" json:"score" form:"score"` // 积分
Status int64 `gorm:"not null" json:"status" form:"status"` // 状态
TopicCount int64 `gorm:"not null" json:"topicCount" form:"topicCount"` // 帖子数量
CommentCount int64 `gorm:"not null" json:"commentCount" form:"commentCount"` // 跟帖数量
Roles string `gorm:"type:text" json:"roles" form:"roles"` // 角色
UserType int64 `gorm:"not null" json:"type" form:"type"` // 用户类型
ForbiddenEndTime int64 `gorm:"default:0" json:"forbiddenEndTime" form:"forbiddenEndTime"` // 禁言结束时间
CreateTime int64 `json:"createTime" form:"createTime"` // 创建时间
UpdateTime int64 `json:"updateTime" form:"updateTime"` // 更新时间
}
func (*PlatformAdmin) Default ¶ added in v1.0.4
func (ad *PlatformAdmin) Default() interface{}
func (*PlatformAdmin) GetTypeAttribute ¶
func (ad *PlatformAdmin) GetTypeAttribute(value interface{}) interface{}
func (*PlatformAdmin) Scan ¶ added in v1.0.4
func (ad *PlatformAdmin) Scan(userId int64) error
func (*PlatformAdmin) User ¶ added in v1.0.4
func (ad *PlatformAdmin) User() *PlatformAdmin
func (*PlatformAdmin) Value ¶ added in v1.0.4
func (ad *PlatformAdmin) Value() interface{}
type RetrieveDB ¶
RetrieveDB 检索租户对象
type RolePermissions ¶
type RolePermissions struct {
Id int64 `gorm:"column:id;type:int(11) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
PermissionId int64 `gorm:"column:permission_id;type:int(11);index:idx_permission_id" json:"permission_id"`
RoleId int64 `gorm:"column:role_id;type:int(11);NOT NULL" json:"role_id"`
TenantsId int64 `gorm:"column:tenants_id;type:int(11);NOT NULL" json:"tenants_id"`
AppId int64 `gorm:"column:app_id;type:int(11);NOT NULL" json:"app_id"`
}
RolePermissions 角色拥有权限
type SysRoles ¶
type SysRoles struct {
Id int64 `gorm:"column:id;type:int(11) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
Name string `gorm:"column:name;type:varchar(255);NOT NULL" json:"name"`
AppId int64 `gorm:"column:app_id;type:int(11) unsigned;NOT NULL" json:"app_id"`
CreatedAt zone.Time `gorm:"column:created_at"`
UpdatedAt zone.Time `gorm:"column:updated_at"`
Permissions []RolePermissions `gorm:"foreignKey:RoleId"`
}
SysRoles 角色表
type UserRoles ¶
type UserToken ¶
type UserToken struct {
Id int64 `gorm:"primaryKey;autoIncrement;" json:"id" form:"id"`
Mobile string `gorm:"size:11;;embeddedPrefix:my_" json:"mobile" form:"mobile"` // 手机
Token string `gorm:"type:text;" json:"token" form:"token"`
UserId int64 `gorm:"not null;index:idx_user_token_user_id;" json:"userId" form:"userId"`
ExpiredAt int64 `gorm:"not null;" json:"expiredAt" form:"expiredAt"`
Status int `gorm:"not null;" json:"status" form:"status"`
CreateTime int64 `gorm:"not null" json:"createTime" form:"createTime"`
Md5Token string `gorm:"size:255;unique;" json:"md5_token" form:"md5_token"` // token MD5
}
Click to show internal directories.
Click to hide internal directories.