Documentation ¶
Index ¶
- type Demo
- type DemoQueryOptions
- type DemoQueryParam
- type DemoQueryResult
- type HTTPError
- type HTTPErrorItem
- type HTTPList
- type HTTPPagination
- type HTTPStatus
- type HTTPStatusText
- 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"` // 记录ID Code string `json:"code" binding:"required"` // 编号 Name string `json:"name" binding:"required"` // 名称 Memo string `json:"memo"` // 备注 Status int `json:"status" binding:"required,max=2,min=1"` // 状态(1:启用 2:停用) Creator string `json:"creator"` // 创建者 CreatedAt time.Time `json:"created_at"` // 创建时间 }
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"` // 错误项
}
HTTPError HTTP响应错误
type HTTPErrorItem ¶
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"` // 状态(OK)
}
HTTPStatus HTTP响应状态
type HTTPStatusText ¶
type HTTPStatusText string
HTTPStatusText 定义HTTP状态文本
const (
OKStatusText HTTPStatusText = "OK"
)
定义HTTP状态文本常量
func (HTTPStatusText) String ¶
func (t HTTPStatusText) String() string
type LoginCaptcha ¶
type LoginCaptcha struct {
CaptchaID string `json:"captcha_id"` // 验证码ID
}
LoginCaptcha 登录验证码
type LoginParam ¶
type LoginParam struct { UserName string `json:"user_name" binding:"required"` // 用户名 Password string `json:"password" binding:"required"` // 密码(md5加密) CaptchaID string `json:"captcha_id" binding:"required"` // 验证码ID CaptchaCode string `json:"captcha_code" binding:"required"` // 验证码 }
LoginParam 登录参数
type LoginTokenInfo ¶
type LoginTokenInfo struct { AccessToken string `json:"access_token"` // 访问令牌 TokenType string `json:"token_type"` // 令牌类型 ExpiresAt int64 `json:"expires_at"` // 令牌到期时间戳 }
LoginTokenInfo 登录令牌信息
type Menu ¶
type Menu struct { RecordID string `json:"record_id"` // 记录ID Name string `json:"name" binding:"required"` // 菜单名称 Sequence int `json:"sequence"` // 排序值 Icon string `json:"icon"` // 菜单图标 Router string `json:"router"` // 访问路由 Hidden int `json:"hidden"` // 隐藏菜单(0:不隐藏 1:隐藏) ParentID string `json:"parent_id"` // 父级ID ParentPath string `json:"parent_path"` // 父级路径 Creator string `json:"creator"` // 创建者 CreatedAt time.Time `json:"created_at"` // 创建时间 Actions MenuActions `json:"actions"` // 动作列表 Resources MenuResources `json:"resources"` // 资源列表 }
Menu 菜单对象
type MenuAction ¶
MenuAction 菜单动作对象
type MenuQueryOptions ¶
type MenuQueryOptions struct { PageParam *PaginationParam // 分页参数 IncludeActions bool // 包含动作列表 IncludeResources bool // 包含资源列表 }
MenuQueryOptions 查询可选参数项
type MenuQueryParam ¶
type MenuQueryParam struct { RecordIDs []string // 记录ID列表 LikeName string // 菜单名称(模糊查询) Name 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"` // 资源编号 Name string `json:"name"` // 资源名称 Method string `json:"method"` // 请求方式 Path string `json:"path"` // 请求路径 }
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"` // 记录ID Name string `json:"name" binding:"required"` // 菜单名称 Sequence int `json:"sequence"` // 排序值 Icon string `json:"icon"` // 菜单图标 Router string `json:"router"` // 访问路由 Hidden int `json:"hidden"` // 隐藏菜单(0:不隐藏 1:隐藏) ParentID string `json:"parent_id"` // 父级ID ParentPath string `json:"parent_path"` // 父级路径 Resources MenuResources `json:"resources"` // 资源列表 Actions MenuActions `json:"actions"` // 动作列表 Children *[]*MenuTree `json:"children,omitempty"` // 子级树 }
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"` // 记录ID Name string `json:"name" binding:"required"` // 角色名称 Sequence int `json:"sequence"` // 排序值 Memo string `json:"memo"` // 备注 Creator string `json:"creator"` // 创建者 CreatedAt time.Time `json:"created_at"` // 创建时间 Menus RoleMenus `json:"menus" binding:"required,gt=0"` // 菜单权限 }
Role 角色对象
type RoleMenu ¶
type RoleMenu struct { MenuID string `json:"menu_id"` // 菜单ID Actions []string `json:"actions"` // 动作权限列表 Resources []string `json:"resources"` // 资源权限列表 }
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"` // 旧密码(md5加密) NewPassword string `json:"new_password" binding:"required"` // 新密码(md5加密) }
UpdatePasswordParam 更新密码请求参数
type User ¶
type User struct { RecordID string `json:"record_id"` // 记录ID UserName string `json:"user_name" binding:"required"` // 用户名 RealName string `json:"real_name" binding:"required"` // 真实姓名 Password string `json:"password"` // 密码 Phone string `json:"phone"` // 手机号 Email string `json:"email"` // 邮箱 Status int `json:"status" binding:"required,max=2,min=1"` // 用户状态(1:启用 2:停用) Creator string `json:"creator"` // 创建者 CreatedAt time.Time `json:"created_at"` // 创建时间 Roles UserRoles `json:"roles" binding:"required,gt=0"` // 角色授权 }
User 用户对象
type UserLoginInfo ¶
type UserLoginInfo struct { UserName string `json:"user_name"` // 用户名 RealName string `json:"real_name"` // 真实姓名 RoleNames []string `json:"role_names"` // 角色名列表 }
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"` // 记录ID UserName string `json:"user_name"` // 用户名 RealName string `json:"real_name"` // 真实姓名 Phone string `json:"phone"` // 手机号 Email string `json:"email"` // 邮箱 Status int `json:"status"` // 用户状态(1:启用 2:停用) CreatedAt time.Time `json:"created_at"` // 创建时间 Roles []*Role `json:"roles"` // 授权角色列表 }
UserShow 用户显示项
type UserShowQueryResult ¶
type UserShowQueryResult struct { Data UserShows PageResult *PaginationResult }
UserShowQueryResult 用户显示项查询结果