controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Chan channel controller
	Chan chanCtrl
)
View Source
var Health healthCtrl

Health health controller

View Source
var (
	// Trade trade controller
	Trade tradeCtrl
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Context *gin.Context
	Logger  *zap.Logger
	Errors  error
}

Controller server route controller

func (*Controller) AddError

func (ctrl *Controller) AddError(err error)

AddError add error

func (*Controller) Bind

func (ctrl *Controller) Bind(d interface{}, bindings ...binding.Binding) *Controller

Bind 参数校验

func (Controller) Custom

func (ctrl Controller) Custom(data gin.H)

Custom 兼容函数

func (Controller) Error

func (ctrl Controller) Error(code int, err error, msg string)

Error 通常错误数据处理

func (*Controller) MakeContext

func (ctrl *Controller) MakeContext(c *gin.Context, params ...string) *Controller

MakeContext 设置http上下文

func (Controller) OK

func (ctrl Controller) OK(data interface{}, msg string)

OK 通常成功数据处理

func (Controller) PageOK

func (ctrl Controller) PageOK(result interface{}, count int, pageIndex int, pageSize int, msg string)

PageOK 分页数据处理

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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