kongchuanhujiao

package
v1.3.21-beta.d0ffc0a6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSuccResp = &Response{Message: "ok"}               // DefaultSuccResp 默认成功响应
	DefaultErrResp  = &Response{Status: 1, Message: "服务器错误"} // DefaultErrResp 默认错误响应
)

Functions

This section is empty.

Types

type Response

type Response struct {
	Status  uint16      `json:"status"`  // 状态码
	Message string      `json:"message"` // 消息
	Data    interface{} `json:"data"`    // 数据
}

Response 响应

func GenerateErrResp

func GenerateErrResp(s uint16, msg string) *Response

GenerateErrResp 生成错误响应 返回带状态码和信息的响应

func GenerateSuccResp

func GenerateSuccResp(d interface{}) *Response

GenerateErrResp 生成成功响应 返回带数据的响应

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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