Documentation ¶
Index ¶
- type Demo
- type DemoQueryOptions
- type DemoQueryParam
- type DemoQueryResult
- type HTTPError
- type HTTPErrorItem
- type HTTPList
- type HTTPPagination
- type HTTPStatus
- type LoginCaptcha
- type LoginParam
- type LoginTokenInfo
- type Menu
- type MenuAction
- type MenuActions
- type MenuQueryOptions
- type MenuQueryParam
- type MenuQueryResult
- type MenuResource
- type MenuResources
- type MenuTree
- type MenuTrees
- type Menus
- type PaginationParam
- type PaginationResult
- type Role
- type RoleMenu
- type RoleMenus
- type RoleQueryOptions
- type RoleQueryParam
- type RoleQueryResult
- type Roles
- type UpdatePasswordParam
- type User
- type UserLoginInfo
- type UserQueryOptions
- type UserQueryParam
- type UserQueryResult
- type UserRole
- type UserRoles
- type UserShow
- type UserShowQueryResult
- type UserShows
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Demo ¶
type Demo struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` Code string `json:"code" binding:"required" swaggo:"true,编号"` Name string `json:"name" binding:"required" swaggo:"true,名称"` Memo string `json:"memo" swaggo:"false,备注"` Status int `json:"status" binding:"required,max=2,min=1" swaggo:"true,状态(1:启用 2:停用)"` Creator string `json:"creator" swaggo:"false,创建者"` CreatedAt time.Time `json:"created_at" swaggo:"false,创建时间"` }
Demo demo对象
type DemoQueryOptions ¶
type DemoQueryOptions struct {
PageParam *PaginationParam // 分页参数
}
DemoQueryOptions demo对象查询可选参数项
type DemoQueryParam ¶
type DemoQueryParam struct { Code string // 编号 Status int // 状态(1:启用 2:停用) LikeCode string // 编号(模糊查询) LikeName string // 名称(模糊查询) }
DemoQueryParam 查询条件
type DemoQueryResult ¶
type DemoQueryResult struct { Data []*Demo PageResult *PaginationResult }
DemoQueryResult demo对象查询结果
type HTTPError ¶
type HTTPError struct {
Error HTTPErrorItem `json:"error" swaggo:"true,错误项"`
}
HTTPError HTTP响应错误
type HTTPErrorItem ¶
type HTTPErrorItem struct { Code int `json:"code" swaggo:"true,错误码"` Message string `json:"message" swaggo:"true,错误信息"` }
HTTPErrorItem HTTP响应错误项
type HTTPList ¶
type HTTPList struct { List interface{} `json:"list"` Pagination *HTTPPagination `json:"pagination,omitempty"` }
HTTPList HTTP响应列表数据
type HTTPPagination ¶
type HTTPPagination struct { Total int `json:"total"` Current int `json:"current"` PageSize int `json:"pageSize"` }
HTTPPagination HTTP分页数据
type HTTPStatus ¶
type HTTPStatus struct {
Status string `json:"status" swaggo:"true,状态(OK)"`
}
HTTPStatus HTTP响应状态
type LoginCaptcha ¶
type LoginCaptcha struct {
CaptchaID string `json:"captcha_id" swaggo:"true,验证码ID"`
}
LoginCaptcha 登录验证码
type LoginParam ¶
type LoginParam struct { UserName string `json:"user_name" binding:"required" swaggo:"true,用户名"` Password string `json:"password" binding:"required" swaggo:"true,密码(md5加密)"` CaptchaID string `json:"captcha_id" binding:"required" swaggo:"true,验证码ID"` CaptchaCode string `json:"captcha_code" binding:"required" swaggo:"true,验证码"` }
LoginParam 登录参数
type LoginTokenInfo ¶
type LoginTokenInfo struct { AccessToken string `json:"access_token" swaggo:"true,访问令牌"` TokenType string `json:"token_type" swaggo:"true,令牌类型"` ExpiresAt int64 `json:"expires_at" swaggo:"true,令牌到期时间"` }
LoginTokenInfo 登录令牌信息
type Menu ¶
type Menu struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` Name string `json:"name" binding:"required" swaggo:"true,菜单名称"` Sequence int `json:"sequence" swaggo:"false,排序值"` Icon string `json:"icon" swaggo:"false,菜单图标"` Router string `json:"router" swaggo:"false,访问路由"` Hidden int `json:"hidden" swaggo:"false,隐藏菜单(0:不隐藏 1:隐藏)"` ParentID string `json:"parent_id" swaggo:"false,父级ID"` ParentPath string `json:"parent_path" swaggo:"false,父级路径"` Creator string `json:"creator" swaggo:"false,创建者"` CreatedAt time.Time `json:"created_at" swaggo:"false,创建时间"` Actions MenuActions `json:"actions" swaggo:"false,动作列表"` Resources MenuResources `json:"resources" swaggo:"false,资源列表"` }
Menu 菜单对象
type MenuAction ¶
type MenuAction struct { Code string `json:"code" swaggo:"true,动作编号"` Name string `json:"name" swaggo:"true,动作名称"` }
MenuAction 菜单动作对象
type MenuQueryOptions ¶
type MenuQueryOptions struct { PageParam *PaginationParam // 分页参数 IncludeActions bool // 包含动作列表 IncludeResources bool // 包含资源列表 }
MenuQueryOptions 查询可选参数项
type MenuQueryParam ¶
type MenuQueryParam struct { RecordIDs []string // 记录ID列表 LikeName string // 菜单名称(模糊查询) ParentID *string // 父级内码 PrefixParentPath string // 父级路径(前缀模糊查询) Hidden *int // 隐藏菜单 }
MenuQueryParam 查询条件
type MenuQueryResult ¶
type MenuQueryResult struct { Data Menus PageResult *PaginationResult }
MenuQueryResult 查询结果
type MenuResource ¶
type MenuResource struct { Code string `json:"code" swaggo:"true,资源编号"` Name string `json:"name" swaggo:"true,资源名称"` Method string `json:"method" swaggo:"true,请求方式"` Path string `json:"path" swaggo:"true,请求路径"` }
MenuResource 菜单资源对象
type MenuResources ¶
type MenuResources []*MenuResource
MenuResources 菜单资源列表
func (MenuResources) ForEach ¶
func (a MenuResources) ForEach(fn func(*MenuResource, int)) MenuResources
ForEach 遍历资源数据
type MenuTree ¶
type MenuTree struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` Name string `json:"name" binding:"required" swaggo:"true,菜单名称"` Sequence int `json:"sequence" swaggo:"false,排序值"` Icon string `json:"icon" swaggo:"false,菜单图标"` Router string `json:"router" swaggo:"false,访问路由"` Hidden int `json:"hidden" swaggo:"false,隐藏菜单(0:不隐藏 1:隐藏)"` ParentID string `json:"parent_id" swaggo:"false,父级ID"` ParentPath string `json:"parent_path" swaggo:"false,父级路径"` Resources MenuResources `json:"resources" swaggo:"false,资源列表"` Actions MenuActions `json:"actions" swaggo:"false,动作列表"` Children *[]*MenuTree `json:"children,omitempty" swaggo:"false,子级树"` }
MenuTree 菜单树
type MenuTrees ¶
type MenuTrees []*MenuTree
MenuTrees 菜单树列表
type Menus ¶
type Menus []*Menu
Menus 菜单列表
func (Menus) SplitAndGetAllRecordIDs ¶
SplitAndGetAllRecordIDs 拆分父级路径并获取所有记录ID
func (Menus) ToLeafRecordIDs ¶
ToLeafRecordIDs 转换为叶子节点记录ID列表
type PaginationParam ¶
PaginationParam 分页查询条件
type Role ¶
type Role struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` Name string `json:"name" binding:"required" swaggo:"true,角色名称"` Sequence int `json:"sequence" swaggo:"false,排序值"` Memo string `json:"memo" swaggo:"false,备注"` Creator string `json:"creator" swaggo:"false,创建者"` CreatedAt time.Time `json:"created_at" swaggo:"false,创建时间"` Menus RoleMenus `json:"menus" binding:"required,gt=0" swaggo:"false,菜单权限"` }
Role 角色对象
type RoleMenu ¶
type RoleMenu struct { MenuID string `json:"menu_id" swaggo:"false,菜单ID"` Actions []string `json:"actions" swaggo:"false,动作权限列表"` Resources []string `json:"resources" swaggo:"false,资源权限列表"` }
RoleMenu 角色菜单对象
type RoleQueryOptions ¶
type RoleQueryOptions struct { PageParam *PaginationParam // 分页参数 IncludeMenus bool // 包含菜单权限 }
RoleQueryOptions 查询可选参数项
type RoleQueryParam ¶
type RoleQueryParam struct { RecordIDs []string // 记录ID列表 Name string // 角色名称 LikeName string // 角色名称(模糊查询) UserID string // 用户ID }
RoleQueryParam 查询条件
type RoleQueryResult ¶
type RoleQueryResult struct { Data Roles PageResult *PaginationResult }
RoleQueryResult 查询结果
type Roles ¶
type Roles []*Role
Roles 角色对象列表
func (Roles) ToMenuIDActionsMap ¶
ToMenuIDActionsMap 转换为菜单ID的动作权限列表映射
type UpdatePasswordParam ¶
type UpdatePasswordParam struct { OldPassword string `json:"old_password" binding:"required" swaggo:"true,旧密码(md5加密)"` NewPassword string `json:"new_password" binding:"required" swaggo:"true,新密码(md5加密)"` }
UpdatePasswordParam 更新密码请求参数
type User ¶
type User struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` UserName string `json:"user_name" binding:"required" swaggo:"true,用户名"` RealName string `json:"real_name" binding:"required" swaggo:"true,真实姓名"` Password string `json:"password" swaggo:"false,密码"` Phone string `json:"phone" swaggo:"false,手机号"` Email string `json:"email" swaggo:"false,邮箱"` Status int `json:"status" binding:"required,max=2,min=1" swaggo:"true,用户状态(1:启用 2:停用)"` Creator string `json:"creator" swaggo:"false,创建者"` CreatedAt time.Time `json:"created_at" swaggo:"false,创建时间"` Roles UserRoles `json:"roles" binding:"required,gt=0" swaggo:"true,角色授权"` }
User 用户对象
type UserLoginInfo ¶
type UserLoginInfo struct { UserName string `json:"user_name" swaggo:"true,用户名"` RealName string `json:"real_name" swaggo:"true,真实姓名"` RoleNames []string `json:"role_names" swaggo:"true,角色名列表"` }
UserLoginInfo 用户登录信息
type UserQueryOptions ¶
type UserQueryOptions struct { PageParam *PaginationParam // 分页参数 IncludeRoles bool // 包含角色权限 }
UserQueryOptions 查询可选参数项
type UserQueryParam ¶
type UserQueryParam struct { UserName string // 用户名 LikeUserName string // 用户名(模糊查询) LikeRealName string // 真实姓名(模糊查询) Status int // 用户状态(1:启用 2:停用) RoleIDs []string // 角色ID列表 }
UserQueryParam 查询条件
type UserQueryResult ¶
type UserQueryResult struct { Data Users PageResult *PaginationResult }
UserQueryResult 查询结果
type UserRole ¶
type UserRole struct {
RoleID string `json:"role_id" swaggo:"true,角色ID"`
}
UserRole 用户角色
type UserShow ¶
type UserShow struct { RecordID string `json:"record_id" swaggo:"false,记录ID"` UserName string `json:"user_name" swaggo:"true,用户名"` RealName string `json:"real_name" swaggo:"true,真实姓名"` Phone string `json:"phone" swaggo:"false,手机号"` Email string `json:"email" swaggo:"false,邮箱"` Status int `json:"status" swaggo:"true,用户状态(1:启用 2:停用)"` CreatedAt time.Time `json:"created_at" swaggo:"false,创建时间"` Roles []*Role `json:"roles" swaggo:"true,授权角色列表"` }
UserShow 用户显示项
type UserShowQueryResult ¶
type UserShowQueryResult struct { Data UserShows PageResult *PaginationResult }
UserShowQueryResult 用户显示项查询结果