response

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(c *app.RequestContext, code errcode.Err)

Fail @Description 请求失败,影响返回500 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:56

func Ok

func Ok(c *app.RequestContext)

Ok @Description 请求处理成功,直接返回200 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 20:00

func OkWithData

func OkWithData(c *app.RequestContext, data interface{})

OkWithData @params @Description 请求处理成功,返回响应200 @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:02

func ParamErr

func ParamErr(c *app.RequestContext)

ParamErr @Description 请求参数错误,返回400 @params @contact.name GJing @contact.email gjing1st@gmail.com @date 2023/3/31 19:58

Types

type PageResult

type PageResult struct {
	List     interface{} `json:"list"`
	Total    int64       `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"page_size"`
}

PageResult 分页格式

type Response

type Response struct {
	Code errcode.Err `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

Response 响应格式

Jump to

Keyboard shortcuts

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