controllers

package
v0.0.0-...-62252a8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthed  = errors2.EmitCode(constants.NotAuthed)
	ErrNotLogined = errors2.EmitCode(constants.NotLogin)
)

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	beego.Controller
}

func (*BaseController) AssetNotEmpty

func (this *BaseController) AssetNotEmpty(value interface{}, errmsg string)

func (*BaseController) CheckError

func (this *BaseController) CheckError(err error)

func (*BaseController) Fail

func (this *BaseController) Fail(msg string, args ...interface{})

func (*BaseController) GetBool

func (this *BaseController) GetBool(key string, def ...bool) (bool, error)

func (*BaseController) GetBoolFromInputJson

func (this *BaseController) GetBoolFromInputJson(field string, defaultValue ...bool) (bool, error)

func (*BaseController) GetFloat

func (this *BaseController) GetFloat(key string, def ...float64) (float64, error)

func (*BaseController) GetFloat64FromInputJson

func (this *BaseController) GetFloat64FromInputJson(field string, defaultValue ...float64) float64

func (*BaseController) GetInt

func (this *BaseController) GetInt(key string, def ...int) (int, error)

func (*BaseController) GetIntFromInputJson

func (this *BaseController) GetIntFromInputJson(field string, defaultValue ...int) int

func (*BaseController) GetIpAddress

func (this *BaseController) GetIpAddress() string

获取ip地址

func (*BaseController) GetMapFromInputJson

func (this *BaseController) GetMapFromInputJson() (data map[string]interface{})

func (*BaseController) GetString

func (this *BaseController) GetString(key string, def ...string) string

func (*BaseController) GetStringFromInputJson

func (this *BaseController) GetStringFromInputJson(field string, defaultValue ...string) string

func (*BaseController) GetUserExtraId

func (this *BaseController) GetUserExtraId(params ...bool) interface{}

func (*BaseController) GetUserExtraIdAsFloat

func (this *BaseController) GetUserExtraIdAsFloat(params ...bool) float64

func (*BaseController) GetUserExtraIdAsInt

func (this *BaseController) GetUserExtraIdAsInt(params ...bool) int

func (*BaseController) GetUserExtraIdAsString

func (this *BaseController) GetUserExtraIdAsString(params ...bool) string

func (*BaseController) GetUserId

func (this *BaseController) GetUserId(params ...bool) int

func (*BaseController) GetUserIdWithErr

func (this *BaseController) GetUserIdWithErr(params ...bool) (userId int, err error)

func (*BaseController) GetUserInfo

func (this *BaseController) GetUserInfo(params ...bool) *utils.LoginUser

func (*BaseController) GetUserInfoWithErr

func (this *BaseController) GetUserInfoWithErr(params ...bool) (loginUser *utils.LoginUser, err error)

func (*BaseController) IsNoRows

func (this *BaseController) IsNoRows(err error) bool

查询为空

func (*BaseController) LogError

func (this *BaseController) LogError(err error)

func (*BaseController) Options

func (c *BaseController) Options()

func (*BaseController) ParseInputJSON

func (this *BaseController) ParseInputJSON(data interface{})

func (*BaseController) RefreshUserInfo

func (this *BaseController) RefreshUserInfo(loginUser *utils.LoginUser)

刷新jwt 用户信息

func (*BaseController) ResponseJson

func (this *BaseController) ResponseJson(errcode constants.ErrorCode, msg string, data interface{})

func (*BaseController) ResponseRawJson

func (this *BaseController) ResponseRawJson(data interface{})

func (*BaseController) SetUserInfo

func (this *BaseController) SetUserInfo(loginUser *utils.LoginUser) (err error)

func (*BaseController) Success

func (this *BaseController) Success(data ...interface{})

func (*BaseController) SuccessEmpty

func (this *BaseController) SuccessEmpty()

func (*BaseController) Throw

func (this *BaseController) Throw(args ...interface{})

抛出异常

type ErrorController

type ErrorController struct {
	BaseController
}

func (*ErrorController) Error403

func (this *ErrorController) Error403()

func (*ErrorController) Error404

func (this *ErrorController) Error404()

func (*ErrorController) Error501

func (this *ErrorController) Error501()

Jump to

Keyboard shortcuts

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