antd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Silent       = "0"
	MessageWarn  = "1"
	MessageError = "2"
	Notification = "4"
	Page         = "9"
)

Variables

This section is empty.

Functions

func Custum

func Custum(c *gin.Context, data gin.H)

Custum 兼容函数

func Error

func Error(c *gin.Context, errCode int, errMsg string, showType string)

Error 失败数据处理

func ListOK

func ListOK(c *gin.Context, result interface{}, total int, current int, pageSize int)

func OK

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

OK 通常成功数据处理

func PageOK

func PageOK(c *gin.Context, result interface{}, total int, current int, pageSize int)

PageOK 分页数据处理

func UpFileOK

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

Types

type ListData

type ListData struct {
	List     interface{} `json:"list,omitempty"` // response data
	Total    int         `json:"total,omitempty"`
	Current  int         `json:"current,omitempty"`
	PageSize int         `json:"pageSize,omitempty"`
}

type Pages

type Pages struct {
	Response
	Data     interface{} `json:"data,omitempty"` // response data
	Total    int         `json:"total,omitempty"`
	Current  int         `json:"current,omitempty"`
	PageSize int         `json:"pageSize,omitempty"`
}

type Response

type Response struct {
	Success      bool   `json:"success,omitempty"`      // if request is success
	ErrorCode    int    `json:"errorCode,omitempty"`    // code for errorType
	ErrorMessage string `json:"errorMessage,omitempty"` // message display to user
	ShowType     string `json:"showType,omitempty"`     // error display type: 0 silent; 1 message.warn; 2 message.error; 4 notification; 9 page
	TraceId      string `json:"traceId,omitempty"`      // Convenient for back-end Troubleshooting: unique request ID
	Host         string `json:"host,omitempty"`         // onvenient for backend Troubleshooting: host of current access server
	Status       string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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