antd_apis

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Context *gin.Context
	Logger  *logger.Helper
	Orm     *gorm.DB
	Errors  error
}

func (*Api) AddError

func (e *Api) AddError(err error)

func (*Api) Bind

func (e *Api) Bind(d interface{}, bindings ...binding.Binding) *Api

Bind 参数校验

func (*Api) Custom

func (e *Api) Custom(data gin.H)

Custom 兼容函数

func (*Api) Error

func (e *Api) Error(errCode int, errMsg string, showType string)

Error 通常错误数据处理 showType error display type: 0 silent; 1 message.warn; 2 message.error; 4 notification; 9 page

func (Api) GetLogger

func (e Api) GetLogger() *logger.Helper

GetLogger 获取上下文提供的日志

func (*Api) GetOrm

func (e *Api) GetOrm(c *gin.Context) (*gorm.DB, error)

GetOrm 获取Orm DB

func (*Api) MakeContext

func (e *Api) MakeContext(c *gin.Context) *Api

MakeContext 设置http上下文

func (*Api) MakeOrm

func (e *Api) MakeOrm() *Api

MakeOrm 设置Orm DB

func (*Api) MakeService

func (e *Api) MakeService(c *service.Service) *Api

func (*Api) OK

func (e *Api) OK(data interface{})

OK 通常成功数据处理

func (*Api) PageOK

func (e *Api) PageOK(result interface{}, total int, current int, pageSize int)

PageOK 分页数据处理

Jump to

Keyboard shortcuts

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