Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CasbinRuleTbName = "casbin_rule"
View Source
var GinAdminTbName = "gin_admin"
View Source
var GinRoleTbName = "gin_role"
View Source
var GinUserInfoTbName = "gin_user_info"
View Source
var GinUserTbName = "gin_user"
Functions ¶
This section is empty.
Types ¶
type CasbinRule ¶
type CasbinRule struct {
Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"`
Ptype string `gorm:"column:ptype;type:varchar(100);NULL;comment:策略类型" json:"ptype"` // 策略类型
V0 string `gorm:"column:v0;type:varchar(100);NULL;comment:角色ID" json:"v0"` // 角色ID
V1 string `gorm:"column:v1;type:varchar(100);NULL;comment:api路径" json:"v1"` // api路径
V2 string `gorm:"column:v2;type:varchar(100);NULL;comment:api访问方法" json:"v2"` // api访问方法
V3 string `gorm:"column:v3;type:varchar(100);NULL;" json:"v3"`
V4 string `gorm:"column:v4;type:varchar(100);NULL;" json:"v4"`
V5 string `gorm:"column:v5;type:varchar(100);NULL;" json:"v5"`
V6 string `gorm:"column:v6;type:varchar(25);NULL;" json:"v6"`
V7 string `gorm:"column:v7;type:varchar(25);NULL;" json:"v7"`
}
type GinAdmin ¶
type GinAdmin struct {
Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"`
Uuid string `gorm:"column:uuid;type:varchar(32);NOT NULL;comment:唯一id号" json:"uuid"` // 唯一id号
Account string `gorm:"column:account;type:varchar(64);NOT NULL;comment:账号" json:"account"` // 账号
Password string `gorm:"column:password;type:varchar(64);NOT NULL;comment:密码" json:"password"` // 密码
Phone string `gorm:"column:phone;type:varchar(16);NOT NULL;comment:手机号" json:"phone"` // 手机号
Avatar string `gorm:"column:avatar;type:varchar(128);NOT NULL;comment:头像" json:"avatar"` // 头像
Salt string `gorm:"column:salt;type:varchar(32);NOT NULL;comment:密码" json:"salt"` // 密码
RealName string `gorm:"column:real_name;type:varchar(64);NOT NULL;comment:真实姓名" json:"real_name"` // 真实姓名
RegisterTime uint64 `gorm:"column:register_time;type:bigint unsigned;NOT NULL;comment:注册时间" json:"register_time"` // 注册时间
RegisterIp string `gorm:"column:register_ip;type:varchar(32);NOT NULL;comment:注册ip" json:"register_ip"` // 注册ip
LoginTime uint64 `gorm:"column:login_time;type:bigint unsigned;NOT NULL;comment:登录时间" json:"login_time"` // 登录时间
LoginIp string `gorm:"column:login_ip;type:varchar(32);NOT NULL;comment:登录ip" json:"login_ip"` // 登录ip
RoleIds string `gorm:"column:role_ids;type:varchar(32);NULL;comment:角色IDs" json:"role_ids"` // 角色IDs
Status uint8 `gorm:"column:status;type:tinyint unsigned;default:1;NOT NULL;comment:状态 1:正常 0:禁用" json:"status"` // 状态 1:正常 0:禁用
CreatedAt uint64 `gorm:"column:created_at;type:bigint unsigned;NULL;" json:"created_at"`
UpdatedAt uint64 `gorm:"column:updated_at;type:bigint unsigned;NULL;" json:"updated_at"`
}
GinAdmin 后台管理员表
type GinRole ¶
type GinRole struct {
Id int `gorm:"primaryKey;autoIncrement;column:id;type:int;NOT NULL;" json:"id"`
Name string `gorm:"column:name;type:varchar(64);NOT NULL;comment:角色名称" json:"name"` // 角色名称
Desc string `gorm:"column:desc;type:varchar(64);NOT NULL;comment:角色描述" json:"desc"` // 角色描述
Status int8 `gorm:"column:status;type:tinyint(1);default:1;NOT NULL;comment:状态:1正常(默认) 0停用" json:"status"` // 状态:1正常(默认) 0停用
RoleType int8 `gorm:"column:role_type;type:tinyint(1);default:1;NOT NULL;comment:角色类型 1:web角色 2:app角色" json:"role_type"` // 角色类型 1:web角色 2:app角色
CreatedAt int `gorm:"column:created_at;type:int;NOT NULL;" json:"created_at"`
UpdatedAt int `gorm:"column:updated_at;type:int;NOT NULL;" json:"updated_at"`
}
GinRole 角色表
type GinUser ¶
type GinUser struct {
Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"`
Uuid string `gorm:"column:uuid;type:varchar(32);NOT NULL;comment:唯一id号" json:"uuid"` // 唯一id号
UserName string `gorm:"column:user_name;type:varchar(64);NOT NULL;comment:用户名" json:"user_name"` // 用户名
NickName string `gorm:"column:nick_name;type:varchar(64);NOT NULL;comment:昵称" json:"nick_name"` // 昵称
RealName string `gorm:"column:real_name;type:varchar(64);NOT NULL;comment:真实姓名" json:"real_name"` // 真实姓名
Phone string `gorm:"column:phone;type:varchar(16);NOT NULL;comment:手机号" json:"phone"` // 手机号
Avatar string `gorm:"column:avatar;type:varchar(128);NOT NULL;comment:头像" json:"avatar"` // 头像
Password string `gorm:"column:password;type:varchar(64);NOT NULL;comment:密码" json:"password"` // 密码
Salt string `gorm:"column:salt;type:varchar(32);NOT NULL;comment:密码" json:"salt"` // 密码
Status uint8 `gorm:"column:status;type:tinyint unsigned;default:1;NOT NULL;comment:状态 1:正常 2:禁用" json:"status"` // 状态 1:正常 2:禁用
RegisterTime string `gorm:"column:register_time;type:varchar(16);NOT NULL;comment:注册时间" json:"register_time"` // 注册时间
RegisterIp string `gorm:"column:register_ip;type:varchar(32);NOT NULL;comment:注册ip" json:"register_ip"` // 注册ip
LoginTime string `gorm:"column:login_time;type:varchar(16);NOT NULL;comment:登录时间" json:"login_time"` // 登录时间
LoginIp string `gorm:"column:login_ip;type:varchar(32);NOT NULL;comment:登录ip" json:"login_ip"` // 登录ip
CreatedAt uint64 `gorm:"column:created_at;type:bigint unsigned;NULL;" json:"created_at"`
UpdatedAt uint64 `gorm:"column:updated_at;type:bigint unsigned;NULL;" json:"updated_at"`
}
GinUser 用户表
type GinUserInfo ¶
type GinUserInfo struct {
Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"`
UserId uint64 `gorm:"column:user_id;type:bigint unsigned;NULL;comment:用户ID" json:"user_id"` // 用户ID
RoleIds string `gorm:"column:role_ids;type:varchar(64);NULL;comment:角色ID 例如:1,2,3" json:"role_ids"` // 角色ID 例如:1,2,3
CreatedAt uint64 `gorm:"column:created_at;type:bigint unsigned;NULL;" json:"created_at"`
}
type Model ¶
type Model struct {
Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"`
CreatedAt util.FormatTime `json:"created_at"`
UpdatedAt util.FormatTime `json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.