response

package
v0.0.0-...-3576a75 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(c *gin.Context, code int)

func ErrorDetailed

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

func ErrorMessage

func ErrorMessage(c *gin.Context, code int, msg string)

func Success

func Success(c *gin.Context)

func SuccessData

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

func SuccessDetailed

func SuccessDetailed(c *gin.Context, msg string, data interface{})

func SuccessMessage

func SuccessMessage(c *gin.Context, msg string)

Types

type PageResponse

type PageResponse struct {
	Total   int64       `json:"total"`   // 总记录数
	Size    int         `json:"size"`    // 每页的记录数
	Pages   int         `json:"pages"`   // 总页数
	Records interface{} `json:"records"` // 分页返回的具体记录
	Current int         `json:"current"` // 当前页码
}

type Response

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

type UserLoginResponse

type UserLoginResponse struct {
	User      model.User `json:"user"`
	Token     string     `json:"token"`
	ExpiresAt int64      `json:"expiresAt"`
}

Jump to

Keyboard shortcuts

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