controllers

package
v0.0.0-...-cda82d8 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountController

type AccountController struct {
	BaseController
}

func (*AccountController) LoginForAuth

func (controller *AccountController) LoginForAuth(c *gin.Context)

LoginApi 登录接口 @Tags LoginApi @Summary 用户登录 @Produce application/json @Param data body request.Login true "用户名, 密码, 验证码" @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"

func (*AccountController) LoginForCookie

func (controller *AccountController) LoginForCookie(c *gin.Context)

LoginApi 登录接口 @Tags LoginApi @Summary 用户登录 @Produce application/json @Param data body request.Login true "用户名, 密码, 验证码" @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"

func (*AccountController) LoginPage

func (controller *AccountController) LoginPage(c *gin.Context)

LoginPage 登录页面 @Tags LoginPage @Summary 用户登录

type BaseController

type BaseController struct {
}

func (*BaseController) ApiDataList

func (bc *BaseController) ApiDataList(c *gin.Context, msg string, data interface{}, allcount int64)

返回成功的API成功

func (*BaseController) ApiError

func (bc *BaseController) ApiError(c *gin.Context, msg string, data interface{})

返回失败的API请求

func (*BaseController) ApiErrorCode

func (bc *BaseController) ApiErrorCode(c *gin.Context, msg string, data interface{}, code int)

返回失败且带code的API请求

func (*BaseController) ApiJson

func (bc *BaseController) ApiJson(c *gin.Context, code int, msg string, data interface{}, allcount int64)

JSON输出

func (*BaseController) ApiSuccess

func (bc *BaseController) ApiSuccess(c *gin.Context, msg string, data interface{})

返回成功的API成功

func (*BaseController) GetContextUserId

func (bc *BaseController) GetContextUserId(c *gin.Context) adminModel.Juint64

func (*BaseController) GetContextUserIdStr

func (bc *BaseController) GetContextUserIdStr(c *gin.Context) string

func (*BaseController) GetContextUserObj

func (bc *BaseController) GetContextUserObj(c *gin.Context) *adminModel.AdminUserBasic

func (*BaseController) ResponseHtml

func (bc *BaseController) ResponseHtml(c *gin.Context, name string, data gin.H)

第一个参数模板,第二个参数为data

func (*BaseController) ResponseHtmlByStatusCode

func (bc *BaseController) ResponseHtmlByStatusCode(c *gin.Context, name string, statusCode int, data gin.H)

设置模板 第一个参数模板,第二个参数为data

type CommonController

type CommonController struct {
	BaseController
}

通用管理

func (*CommonController) AuthImage

func (controller *CommonController) AuthImage(c *gin.Context)

图片验证码

func (*CommonController) Upload

func (controller *CommonController) Upload(c *gin.Context)

文件上传

func (*CommonController) UploadFiles

func (controller *CommonController) UploadFiles(c *gin.Context)

文件上传

type IndexController

type IndexController struct {
	BaseController
}

后台首页管理

func (*IndexController) Index

func (controller *IndexController) Index(c *gin.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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