body

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(w http.ResponseWriter, msg string, code int)

ErrorJSON 返回错误数据

func GetBody

func GetBody(r *http.Request) string

GetBody 获取body数据

func ReadJSON

func ReadJSON(r *http.Request, data interface{}) error

ReadJSON 读取 Json Body

func SuccessJSON

func SuccessJSON(w http.ResponseWriter, data interface{})

SuccessJSON 返回成功数据

Types

type FormatJSON

type FormatJSON struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

FormatJSON JSON格式数据

type IndexData

type IndexData struct {
	Items interface{} `json:"items"`
	Count int64       `json:"count"`
}

IndexData 列表数据

Jump to

Keyboard shortcuts

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