bznorm

package
v0.0.0-...-c3b94aa Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//2000
	RES_ERROR_LOGIN = ResError{Code: 2001, Msg: "登录受限"}

	//4000
	RES_ERROR_PARAM    = ResError{Code: 4000, Msg: "参数不存在"}
	RES_ERROR_PERMIT   = ResError{Code: 4001, Msg: "权限异常"}
	RES_ERROR_AUTH     = ResError{Code: 4002, Msg: "身份验证失败"}
	RES_ERROR_NOACCESS = ResError{Code: 4003, Msg: "无权限"}
	RES_ERROR_API      = ResError{Code: 4004, Msg: "接口不存在"}
	RES_ERROR_PARSER   = ResError{Code: 4005, Msg: "数据解析失败"}

	//5000
	RES_ERROR_SERVER = ResError{Code: 5001, Msg: "服务器错误"}
)

抛出异常选项

View Source
var (
	ROUTE_METHOS_GET    RouteMethodType = []byte{0, 1} //GET
	ROUTE_METHOS_POST   RouteMethodType = []byte{0, 2} //POST
	ROUTE_METHOS_PUT    RouteMethodType = []byte{0, 3} //PUT
	ROUTE_METHOS_DELETE RouteMethodType = []byte{0, 4} //DELETE
	ROUTE_METHOS_ALL    RouteMethodType = []byte{0, 0} //GET,POST,PUT,DELETE

	AutoRoute AutoRouteHandler
)

定义请求方式可选参数

Functions

This section is empty.

Types

type AutoRouteCellParam

type AutoRouteCellParam struct {
	Class  beego.ControllerInterface //beego控制器
	Action string                    //路由对应控制器执行方法
	Method RouteMethodType           //请求方式
}

单切面路由参数集结构

type AutoRouteHandler

type AutoRouteHandler struct{}

func (AutoRouteHandler) Cell

单切面路由参数集

type Controller

type Controller struct {
	beego.Controller
}

Operations about Users

func (Controller) Handler

func (t Controller) Handler() *controllerHandler

func (Controller) Options

func (t Controller) Options()

type CronChild

type CronChild struct {
	Name string `json:"name"`
	Time string `json:"time"`
	Run  func() `json:"run"`
}

type CronChildArr

type CronChildArr []CronChild

type FilterMapStruct

type FilterMapStruct map[filterCyc]map[path]filterFunc

type JsonMapData

type JsonMapData map[string]interface{}

func (JsonMapData) Get

func (r JsonMapData) Get(s string) reqParam

type ReqHandler

type ReqHandler struct {
	// contains filtered or unexported fields
}

* 获取参数 工具 *

func (ReqHandler) Form

func (r ReqHandler) Form(s string) reqParam

func (ReqHandler) FormByPost

func (r ReqHandler) FormByPost(s string) reqParam

func (ReqHandler) Get

func (r ReqHandler) Get(s string) reqParam

func (ReqHandler) Json

func (r ReqHandler) Json(obj interface{})

func (ReqHandler) JsonMap

func (r ReqHandler) JsonMap() map[string]interface{}

func (ReqHandler) JsonMapInit

func (r ReqHandler) JsonMapInit() JsonMapData

func (ReqHandler) Route

func (r ReqHandler) Route(s string) reqParam

type ResError

type ResError struct {
	Code int
	Msg  string
}

抛出异常

type ResHandler

type ResHandler struct {
	// contains filtered or unexported fields
}

* Response 工具 *

func (ResHandler) Error

func (r ResHandler) Error(t ResError, m ...string)

func (ResHandler) Fail

func (r ResHandler) Fail(c int, m string)

func (ResHandler) Response

func (r ResHandler) Response(c int, m string, d interface{})

func (ResHandler) Success

func (r ResHandler) Success(d interface{})

type ResJson

type ResJson struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

return JSON

type RouteMethodType

type RouteMethodType []byte

请求方式结构

type RouteRegistMap

type RouteRegistMap map[string]map[string]map[string]AutoRouteCellParam

路由树容器

Jump to

Keyboard shortcuts

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