response

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 14

Documentation

Index

Constants

View Source
const (
	ResponseOkMessage    = "操作成功"
	ResponseErrorMessage = "操作失败"
)

Variables

This section is empty.

Functions

func Fail

func Fail(ctx *gin.Context)

func FailWithDetailed

func FailWithDetailed(data interface{}, message string, ctx *gin.Context)

func FailWithMessage

func FailWithMessage(message string, ctx *gin.Context)

func ForbiddenFailWithMessage

func ForbiddenFailWithMessage(message string, ctx *gin.Context)

func Ok

func Ok(ctx *gin.Context)

func OkWithData

func OkWithData(data interface{}, ctx *gin.Context)

func OkWithDetailed

func OkWithDetailed(data interface{}, message string, ctx *gin.Context)

func OkWithMessage

func OkWithMessage(message string, ctx *gin.Context)

func Result

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

func UnauthorizedFailWithDetailed

func UnauthorizedFailWithDetailed(data interface{}, message string, ctx *gin.Context)

func UnauthorizedFailWithMessage

func UnauthorizedFailWithMessage(message string, ctx *gin.Context)

Types

type BaseResponse

type BaseResponse struct {
	Id        uint       `json:"id"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
}

type PageResult

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

type Response

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

type SelectOption

type SelectOption struct {
	Id   uint   `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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