controllers

package
v0.0.0-...-f668870 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInputData    = "数据输入错误"
	ErrDatabase     = "数据库操作错误"
	ErrDupUser      = "用户信息已存在"
	ErrNoUser       = "用户信息不存在"
	ErrPass         = "密码不正确"
	ErrNoUserPass   = "用户信息不存在或密码不正确"
	ErrNoUserChange = "用户信息不存在或数据未改变"
	ErrInvalidUser  = "用户信息不正确"
	ErrOpenFile     = "打开文件出错"
	ErrWriteFile    = "写文件出错"
	ErrSystem       = "操作系统错误"
)

Predefined const error strings.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	beego.Controller
}

BaseController definiton.

func (*BaseController) ParseLimitParm

func (base *BaseController) ParseLimitParm() (l int64, err error)

ParseLimitParm parse limit parameter.

limit=n

func (*BaseController) ParseOffsetParm

func (base *BaseController) ParseOffsetParm() (o int64, err error)

ParseOffsetParm parse offset parameter.

offset=n

func (*BaseController) ParseOrderParm

func (base *BaseController) ParseOrderParm() (o map[string]string, err error)

ParseOrderParm parse order parameters.

order=col1:asc|desc,col2:asc|esc,...

func (*BaseController) ParseQueryParm

func (base *BaseController) ParseQueryParm() (v map[string]string, o map[string]string, err error)

ParseQueryParm parse query parameters.

query=col1:op1:val1,col2:op2:val2,...
op: one of eq, ne, gt, ge, lt, le

func (*BaseController) ParseToken

func (base *BaseController) ParseToken() (t *jwt.Token, e *ControllerError)

ParseToken parse JWT token in http header.

func (*BaseController) RetError

func (base *BaseController) RetError(e *ControllerError)

RetError return error information in JSON.

func (*BaseController) VerifyForm

func (base *BaseController) VerifyForm(obj interface{}) (err error)

VerifyForm use validation to verify input parameters.

type ControllerError

type ControllerError struct {
	Status   int    `json:"status"`
	Code     int    `json:"code"`
	Message  string `json:"message"`
	DevInfo  string `json:"dev_info"`
	MoreInfo string `json:"more_info"`
}

ControllerError is controller error info structer.

type ErrorController

type ErrorController struct {
	BaseController
}

ErrorController definiton.

func (*ErrorController) Error404

func (c *ErrorController) Error404()

Error404 redefine 404 error information.

func (*ErrorController) RetError

func (c *ErrorController) RetError(e *ControllerError)

RetError return error informatino in JSON.

type MainController

type MainController struct {
	beego.Controller
}

MainController definition.

func (*MainController) Get

func (c *MainController) Get()

Get method.

type RoleController

type RoleController struct {
	BaseController
}

RoleController definiton.

func (*RoleController) Auth

func (c *RoleController) Auth()

Auth method.

func (*RoleController) Delete

func (c *RoleController) Delete()

Delete method.

func (*RoleController) GetAll

func (c *RoleController) GetAll()

GetAll method.

func (*RoleController) GetOne

func (c *RoleController) GetOne()

GetOne method.

func (*RoleController) Post

func (c *RoleController) Post()

Post method.

func (*RoleController) Put

func (c *RoleController) Put()

Put method.

type UserController

type UserController struct {
	BaseController
}

UserController definiton.

func (*UserController) Downloads

func (c *UserController) Downloads()

Downloads method.

func (*UserController) Login

func (c *UserController) Login()

Login method.

func (*UserController) Logout

func (c *UserController) Logout()

Logout method.

func (*UserController) Passwd

func (c *UserController) Passwd()

Passwd method.

func (*UserController) Register

func (c *UserController) Register()

Register method.

func (*UserController) Uploads

func (c *UserController) Uploads()

Uploads method.

Jump to

Keyboard shortcuts

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