restapi

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestApi

type RestApi struct{}

func (*RestApi) Custom

func (e *RestApi) Custom(c *gin.Context, data gin.H)

Custom 兼容函数

func (*RestApi) Error

func (e *RestApi) Error(c *gin.Context, code int, err error, msg string)

Error 通常错误数据处理

func (*RestApi) GetLogger

func (e *RestApi) GetLogger(c *gin.Context) *zap.Logger

GetLogger 获取上下文提供的日志器,对GetRequestLogger做封装,可实现解耦。

func (*RestApi) OK

func (e *RestApi) OK(c *gin.Context, data interface{}, msg string)

OK 通常成功数据处理

func (*RestApi) PageOK

func (e *RestApi) PageOK(c *gin.Context, result interface{}, count int, pageIndex int, pageSize int, msg string)

PageOK 分页数据处理

func (RestApi) Translate

func (e RestApi) Translate(form, to interface{})

Jump to

Keyboard shortcuts

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