response

package
v0.0.0-...-6d7266f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SqlKeyDuplicateCode = 1062
	DataTooLongError    = 1406
)

mysql 错误码

View Source
const (
	ERROR   = 504
	SUCCESS = 200
)

Variables

This section is empty.

Functions

func Response

func Response(c *gin.Context, code int64, msg string, data interface{})

func ResponseError

func ResponseError(c *gin.Context, err error)

func ResponseOk

func ResponseOk(c *gin.Context, data interface{})

func ResponseStream

func ResponseStream(c *gin.Context, data string)

Types

type BatchResult

type BatchResult struct {
	SuccessCount int64 `json:"success_count"` // 成功数量
}

批量操作结果

type Body

type Body struct {
	Code    int64       `json:"code"`
	Message string      `json:"message" `
	Data    interface{} `json:"data"`
	TraceId string      `json:"trace_id"`
}

type EmptyResp

type EmptyResp struct {
}

type PageResult

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

分页查询结果

Jump to

Keyboard shortcuts

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