param

package
v2.0.77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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 Depts added in v2.0.31

type Depts []*Dept

func (Depts) ToTree added in v2.0.31

func (d Depts) ToTree() Depts

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 IntArray added in v2.0.8

type IntArray []int

IntArray Int数组

func (IntArray) ToMap added in v2.0.8

func (e IntArray) ToMap() map[int]int

ToMap int转Map

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 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 菜单

func (a *Menu) MenuToTree() *MenuTree

MenuToTree 菜单转菜单树结构

type MenuAccessParam struct {
	pagination.Param
	MenuID int
}

MenuAccessParam 菜单权限

type MenuAccessResource struct {
	ID       int    `json:"id"`       // ID
	Name     string `json:"menuId"`   // 菜单ID
	ParentID int    `json:"parentId"` // 上级ID
}

MenuAccessResource 菜单权限资源

func (a *MenuAccessResource) ResourceToTree() *MenuAccessResourceTree

ResourceToTree resource转树结构

type MenuAccessResourceParam struct {
	pagination.Param
	MenuID int
}

MenuAccessResourceParam 菜单动作

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 []*MenuAccessResourceTree

MenuAccessResourceTrees 菜单权限资源树列表

ToTree 转换为树形结构

type MenuAccessResources []*MenuAccessResource

MenuAccessResources 菜单权限资源列表

ToTree 转换为菜单树

type MenuParam struct {
	pagination.Param
	ParentID         int
	Name             string `form:"name"`
	PrefixParentPath string `form:"-"`
	IDs              []int  `form:"-"`
}

MenuParam 查询条件

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 MenuTrees []*MenuTree

MenuTrees 菜单树列表

func (a MenuTrees) ToTree() MenuTrees

ToTree 转换为树形结构

type Menus []*Menu

Menus 菜单列表

func (a Menus) FillMenuAccess(mAccess map[int][]int) Menus

FillMenuAccess 填充菜单动作列表

func (a Menus) Len() int
func (a Menus) Less(i, j int) bool
func (a Menus) Swap(i, j int)
func (a Menus) ToMap() map[int]*Menu

ToMap 转换为键值映射

func (a Menus) ToTree() MenuTrees

ToTree 转换为菜单树

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) ToMap

func (a RoleMenus) ToMap() map[string]*RoleMenu

ToMap 转换为map

func (RoleMenus) ToMenuIDs

func (a RoleMenus) ToMenuIDs() []int

ToMenuIDs 转换为菜单ID列表

func (RoleMenus) ToRoleIDMap

func (a RoleMenus) ToRoleIDMap() map[int]RoleMenus

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 Roles

type Roles []*Role

Roles 角色对象列表

func (Roles) ToMap

func (a Roles) ToMap() map[int]*Role

ToMap 转换为键值存储

func (Roles) ToNames

func (a Roles) ToNames() []string

ToNames 获取角色名称列表

type SettingParam

type SettingParam struct {
	Name string `json:"name" 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 用户对象

func (*User) CleanSecure

func (a *User) CleanSecure() *User

CleanSecure 清理安全数据

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

type UserRoleParam struct {
	UserID  int   `form:"-"`
	UserIDs []int `form:"-"`
}

UserRoleParam 用户角色参数

type UserRoles

type UserRoles []*UserRole

UserRoles 角色菜单列表

func (UserRoles) ToMap

func (a UserRoles) ToMap() map[string]*UserRole

ToMap 转换为map

func (UserRoles) ToRoleIDs

func (a UserRoles) ToRoleIDs() []int

ToRoleIDs 转换为角色ID列表

func (UserRoles) ToUserIDMap

func (a UserRoles) ToUserIDMap() map[int]UserRoles

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 用户显示项

type UserShows

type UserShows []*UserShow

UserShows 用户显示项列表

type Users added in v2.0.6

type Users []*User

Users 用户列表

func (Users) ToUserShows added in v2.0.6

func (a Users) ToUserShows(mUserRoles map[int][]int, mRoles map[int]*Role) UserShows

ToUserShows 转换为用户显示列表

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL