Documentation
¶
Overview ¶
* @Author: Wangjun * @Date: 2023-09-01 13:39:49 * @LastEditTime: 2024-12-20 14:27:13 * @LastEditors: Please set LastEditors * @Description:创建默认的router * @FilePath: \golib\autoroute\defaulter\default.go * hnxr
* @Author: Wangjun * @Date: 2021-05-15 22:43:19 * @LastEditTime: 2024-12-17 17:47:35 * @LastEditors: Please set LastEditors * @Description: * @FilePath: \golib\autoroute\defaulter\system.go * hnxr
Index ¶
- func DefaultAuth(c *gin.Context) (any, error)
- func DefaultEngine(cached bool, defaultUser func() (string, string), ...) (router *gin.Engine)
- func SecureHeader(ctx *gin.Context)
- func SetDefaultListDir(dir string)
- func TailLog(c *gin.Context)
- func UseCache(ctx *gin.Context)
- func UseDefaultAuth(defaultUser func() (user, passwd string), ...)
- type HomeController
- type LogController
- type LoginController
- type SystemController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEngine ¶
func DefaultEngine(cached bool, defaultUser func() (string, string), auth func(*gin.Context) (any, error), ginModes ...string) (router *gin.Engine)
创建默认的路由 开启缓存,不能通过安全认证
func SetDefaultListDir ¶
func SetDefaultListDir(dir string)
*
- @description: 设置默认的dir目录
- @param {string} dir
- @return {*}
Types ¶
type LoginController ¶
type LoginController struct {
controller.Controller
}
LoginController 授权相关的操作
func (*LoginController) HashData ¶
func (m *LoginController) HashData()
func (*LoginController) Login ¶
func (m *LoginController) Login()
@tags 用户管理 @Summary 用户登录 @Description 根据用户名和密码生成uid @Param username formData string true "用户名" @Param password formData string true "密码" @Produce plain @Success 200 {string} string "ok" "认证成功" @Failure 401 {string} string "code:401 需要认证" @Failure 412 {string} string "code:412 参数错误" @Router /login/login [post]
type SystemController ¶
type SystemController struct {
controller.Controller
}
SystemController 授权相关的操作
func (*SystemController) ListDir ¶
func (m *SystemController) ListDir()
*
- @description: 显示默认的dir
- @param {*}
- @return {*}
func (*SystemController) ToWhereSortPage ¶
func (m *SystemController) ToWhereSortPage(items interface{}, callback func(interface{}) interface{}, isReg ...bool)
*
- @description: 过滤 + 排序
- @param {*} interface 需要过滤的数组
- @return {*}
func (*SystemController) Upgrade ¶
func (m *SystemController) Upgrade()