Documentation
¶
Index ¶
- Constants
- type CPUParam
- type ConfigParam
- type DBColumnsParam
- type DBTablesParam
- type Dept
- type DeptParam
- type Depts
- type DictDataParam
- type DictTypeParam
- type DiskParam
- type FileDirParam
- type FileInfoParam
- type IntArray
- type LoginLogParam
- type LoginParam
- type LoginTokenInfo
- type MemParam
- type Menu
- type MenuAccessParam
- type MenuAccessResource
- type MenuAccessResourceParam
- type MenuAccessResourceTree
- type MenuAccessResourceTrees
- type MenuAccessResources
- type MenuParam
- type MenuTree
- type MenuTrees
- type Menus
- type OSParam
- type OperLogParam
- type PostParam
- type Role
- type RoleMenu
- type RoleMenuParam
- type RoleMenus
- type RoleParam
- type Roles
- type SettingParam
- type SmsParam
- type TablesParam
- type User
- type UserLoginInfo
- type UserParam
- type UserPassword
- type UserRole
- type UserRoleParam
- type UserRoles
- type UserShow
- type UserShows
- type Users
Constants ¶
const ( ACCOUNT = "ACCOUNT" SMS = "SMS" IV = "013" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUParam ¶
type CPUParam struct {
Info interface{} `json:"cpuInfo"` // CPU信息
Percent float64 `json:"Percent"` // CPU使用率
CPUNum int `json:"cpuNum"` // CPU数量
}
CPUParam cpu信息
type ConfigParam ¶
type ConfigParam struct {
pagination.Param
ConfigName string `form:"configName"`
ConfigKey string `form:"configKey"`
ConfigType string `form:"configType"`
}
ConfigParam 查询条件
type DBColumnsParam ¶
type DBColumnsParam struct {
pagination.Param
TableName string `form:"tableName" binding:"required"`
}
DBColumnsParam 查询条件
type DBTablesParam ¶
type DBTablesParam struct {
pagination.Param
TableName string `form:"tableName"`
}
DBTablesParam 查询条件
type Dept ¶ added in v2.0.31
type Dept struct {
ID int `json:"id"`
ParentID int `json:"-"` // 上级ID
Name string `json:"name"`
Children *Depts `json:"-"`
}
DeptLabel 部门标签
type DeptParam ¶
type DeptParam struct {
pagination.Param
Name string `form:"name"`
Status int `form:"status"`
Path string `form:"path"`
Skip bool `form:"-"`
}
DeptParam 查询条件
type DictDataParam ¶
type DictDataParam struct {
pagination.Param
Label string `form:"label"`
Status int `form:"status"`
DictType string `form:"dictType"`
ID int `form:"id"`
}
DictDataParam 查询条件
type DictTypeParam ¶
type DictTypeParam struct {
pagination.Param
ID int `form:"id"`
Name string `form:"name"`
Type string `form:"type"`
}
DictTypeParam 查询条件
type DiskParam ¶
type DiskParam struct {
Total int `json:"total"` // 总存储
Used int `json:"used"` // 已使用
Percent float64 `json:"percent"` // 使用率
Partitions []disk.UsageStat `json:"partitions"` // 分区数组
}
DiskParam 硬盘信息
type FileDirParam ¶
type FileDirParam struct {
pagination.Param
Path string `form:"path"`
}
FileDirParam 查询条件
type FileInfoParam ¶
type FileInfoParam struct {
pagination.Param
PID string `form:"p_id"`
}
FileInfoParam 查询条件
type LoginLogParam ¶
type LoginLogParam struct {
pagination.Param
IPAddr string `form:"ipAddr"`
Status string `form:"status"`
Username string `form:"userName"`
}
LoginLogParam 查询条件
type LoginParam ¶
type LoginParam struct {
Username string `form:"username" json:"username" binding:"required"` // 用户名
Password string `form:"password" json:"password"` // 密码
Code string `form:"code" json:"code" binding:"required"` // 验证码
Type string `form:"type" json:"type"` // 登录类型; account,sms
}
LoginParam 登录参数
type LoginTokenInfo ¶
type LoginTokenInfo struct {
AccessToken string `json:"token"` // 访问令牌
TokenType string `json:"tokenType"` // 令牌类型
ExpiresAt int64 `json:"expires"` // 令牌到期时间戳
}
LoginTokenInfo 登录令牌信息
type MemParam ¶
type MemParam struct {
Total int `json:"total"` // 总内存
Used int `json:"used"` // 已用内存
Free int `json:"free"` // 空闲内存
Usage int `json:"usage"` // 使用率
}
MemParam 内存信息
type Menu ¶
type Menu struct {
ID int `json:"id"` // ID
Name string `json:"name" binding:"required"` // 菜单名称
Type int `json:"type" binding:"required"` // 类型 1:模块 2:页面 3:按钮
Code string `json:"code" binding:"required"` // 唯一编码
Sequence int `json:"sequence"` // 排序值
ParentID int `json:"parentId"` // 父级ID
ParentPath string `json:"parentPath"` // 父级路径
Remark string `json:"remark"` // 备注
CreatedBy string `json:"createdBy"` // 创建人
UpdatedBy string `json:"updatedBy"` // 更新人
Access []int `json:"access"` // 权限列表
}
Menu 菜单
type MenuAccessParam ¶
type MenuAccessParam struct {
pagination.Param
MenuID int
}
MenuAccessParam 菜单权限
type MenuAccessResource ¶
type MenuAccessResource struct {
ID int `json:"id"` // ID
Name string `json:"menuId"` // 菜单ID
ParentID int `json:"parentId"` // 上级ID
}
MenuAccessResource 菜单权限资源
func (*MenuAccessResource) ResourceToTree ¶
func (a *MenuAccessResource) ResourceToTree() *MenuAccessResourceTree
ResourceToTree resource转树结构
type MenuAccessResourceParam ¶
type MenuAccessResourceParam struct {
pagination.Param
MenuID int
}
MenuAccessResourceParam 菜单动作
type MenuAccessResourceTree ¶
type MenuAccessResourceTree struct {
ID int `json:"id"` // ID
Name string `json:"menuId"` // 菜单ID
ParentID int `json:"parentId"` // 上级ID
Children *MenuAccessResourceTrees `json:"children,omitempty"` // 子级树
}
MenuAccessResourceTree 菜单权限资源树
type MenuAccessResourceTrees ¶
type MenuAccessResourceTrees []*MenuAccessResourceTree
MenuAccessResourceTrees 菜单权限资源树列表
func (MenuAccessResourceTrees) ToTree ¶
func (a MenuAccessResourceTrees) ToTree() MenuAccessResourceTrees
ToTree 转换为树形结构
type MenuAccessResources ¶
type MenuAccessResources []*MenuAccessResource
MenuAccessResources 菜单权限资源列表
func (MenuAccessResources) ToTree ¶
func (a MenuAccessResources) ToTree() MenuAccessResourceTrees
ToTree 转换为菜单树
type MenuParam ¶
type MenuParam struct {
pagination.Param
ParentID int
Name string `form:"name"`
PrefixParentPath string `form:"-"`
IDs []int `form:"-"`
}
MenuParam 查询条件
type MenuTree ¶
type MenuTree struct {
ID int `yaml:"-" json:"id"` // ID
Name string `yaml:"name" json:"name"` // 菜单名称
Type int `yaml:"type" json:"type"` // 类型
Code string `yaml:"code" json:"code"` // 唯一编码
Sequence int `yaml:"sequence" json:"sequence"` // 排序值
ParentID int `yaml:"-" json:"parentId"` // 父级ID
Remark string `json:"remark"` // 备注
Access []int `yaml:"access,omitempty" json:"access"` // 动作列表
Children *MenuTrees `yaml:"children,omitempty" json:"children"` // 子级树
}
MenuTree 菜单树
type OSParam ¶
type OSParam struct {
GoOs string `json:"goOs"` // 平台
Arch string `json:"arch"` // 架构
Mem int `json:"mem"` // 内存
Compiler string `json:"compiler"` // 编译器
IP string `json:"ip"` // IP地址
Version string `json:"version"` // 版本
NumGoroutine int `json:"numGoroutine"` // Goroutine数量
ProjectDir string `json:"projectDir"` // 项目路径
}
OSParam 系统信息
type OperLogParam ¶
type OperLogParam struct {
pagination.Param
OperIP string `form:"operrIp"`
Status string `form:"status"`
OperName string `form:"operName"`
BusinessType string `form:"businessType"`
}
OperLogParam 查询条件
type PostParam ¶
type PostParam struct {
pagination.Param
Code string `form:"code"`
Name string `form:"name"`
Status int `form:"status"`
All bool `form:"all"`
}
PostParam 查询条件
type Role ¶
type Role struct {
ID int `json:"id"` // 唯一标识
Name string `json:"name" binding:"required"` // 角色名称
Type int `json:"type"` // 角色类型(1:平台2:路局)
Sequence int `json:"sequence"` // 排序值
Remark string `json:"remark"` // 备注
Status int `json:"status" binding:"required,max=2,min=1"` // 状态(1:启用 2:禁用)
CreatedBy string `json:"createdBy"` // 创建者
UpdatedBy string `json:"updatedBy"` // 更新者
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
RoleMenus []int `json:"roleMenus"` // 角色菜单列表
}
Role 角色对象
type RoleMenu ¶
type RoleMenu struct {
ID int `json:"id"` // 唯一标识
RoleID int `json:"role_id" binding:"required"` // 角色ID
MenuID int `json:"menu_id" binding:"required"` // 菜单ID
}
RoleMenu 角色菜单对象
type RoleMenuParam ¶ added in v2.0.3
type RoleMenuParam struct {
pagination.Param
RoleID int `form:"-"`
MenuID int `form:"-"`
RoleIDs []int `form:"-"`
}
RoleMenuParam 角色菜单参数
type RoleMenus ¶
type RoleMenus []*RoleMenu
RoleMenus 角色菜单列表
func (RoleMenus) ToRoleIDMap ¶
ToRoleIDMap 转换为角色ID映射
type RoleParam ¶
type RoleParam struct {
pagination.Param
RoleName string `form:"roleName"`
Status int `form:"status"`
IDs []int `form:"-"`
All bool `form:"all"`
Type int `form:"type"`
}
RoleParam 查询条件
type SettingParam ¶
type SettingParam struct {
Name string `json:"name" binding:"required"` // 名称
Logo string `json:"logo" binding:"required"` // 头像
}
SettingParam 设置参数
type SmsParam ¶ added in v2.0.14
type SmsParam struct {
Phone string `form:"phone" json:"phone" binding:"required"` // 手机号
Timestamp string `form:"timestamp" json:"timestamp" binding:"required"` // 时间戳
}
SmsParam 发送验证码
type TablesParam ¶
type TablesParam struct {
pagination.Param
Name string `form:"tableName"`
Comment string `form:"tableComment"`
}
TablesParam 查询条件
type User ¶
type User struct {
ID int `json:"id"` // ID
Username string `json:"username"` // 用户名
Password string `json:"password"` // 密码
RealName string `json:"realName" binding:"required"` // 真实姓名
Phone string `json:"phone" binding:"required"` // 手机号
RoleID int `json:"roleId" binding:"required"` // 角色ID
RoleName string `json:"roleName"` // 角色名称
Salt string `json:"-"` // 盐
Avatar string `json:"avatar"` // 头像
Sex int `json:"sex"` // 性别
Email string `json:"email"` // 邮箱
DeptID int `json:"deptId"` // 部门编码
DeptName string `json:"deptName"` // 部门名称
PostID int `json:"postId"` // 职位编码
Status int `json:"status"` // 状态
Remark string `json:"remark"` // 备注
CreatedBy string `json:"createdBy"` // 创建人
UpdatedBy string `json:"updatedBy"` // 更新人
CreatedAt time.Time `json:"createdAt"` // 创建时间
Roles []int `json:"-"` // 角色授权
}
User 用户对象
type UserLoginInfo ¶
type UserLoginInfo struct {
UserID int `json:"userId"` // 用户ID
UserName string `json:"username"` // 用户名
RealName string `json:"realName"` // 真实姓名
Roles Roles `json:"roles"` // 角色列表
}
UserLoginInfo 用户登录信息
type UserParam ¶
type UserParam struct {
pagination.Param
Username string `form:"username"`
Status int `form:"status"`
Phone string `form:"phone"`
PostID int `form:"postId"`
DeptID int `form:"deptId"`
CurrentDeptID int `form:"-"`
}
UserParam 查询条件
type UserPassword ¶
type UserPassword struct {
OldPassword string `json:"oldPassword"`
NewPassword string `json:"newPassword"`
}
UserPassword 用户密码
type UserRole ¶
type UserRole struct {
ID int `json:"id"` // ID
UserID int `json:"userId"` // 用户ID
RoleID int `json:"roleId"` // 角色ID
}
UserRole 用户角色
type UserRoleParam ¶ added in v2.0.3
UserRoleParam 用户角色参数
type UserRoles ¶
type UserRoles []*UserRole
UserRoles 角色菜单列表
func (UserRoles) ToUserIDMap ¶
ToUserIDMap 转换为用户ID映射
type UserShow ¶
type UserShow struct {
ID int `json:"id"` // ID
Username string `json:"username"` // 用户名
RealName string `json:"realName"` // 真实姓名
RoleID int `json:"roleId"` // 角色ID
RoleName string `json:"roleName"` // 角色名称
Salt string `json:"salt"` // 盐
Phone string `json:"phone"` // 手机号
Email string `json:"email"` // 邮箱
Avatar string `json:"avatar"` // 头像
Sex int `json:"sex"` // 性别
DeptID int `json:"deptId"` // 部门编码
PostID int `json:"postId"` // 职位编码
Status int `json:"status"` // 用户状态(1:启用 2:停用)
Remark string `json:"remark"` // 备注
CreatedAt time.Time `json:"createdAt"` // 创建时间
Roles []*Role `json:"-"` // 授权角色列表
DeptName string `json:"deptName"` // 部门名称
}
UserShow 用户显示项