restjson

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PagingData

type PagingData struct {
	*utils.Pagination
	Total int64       `json:"total"`
	Data  interface{} `json:"data"`
}

PagingData 四有云分页数据

type Response

type Response[T any] struct {
	Code string `json:"code"`
	Data *T     `json:"data"`
	Msg  string `json:"msg"`
}

Response 四有云响应结构体

func ErrorResJson

func ErrorResJson(code string, errMsg string) Response[any]

func ErrorResJsonWithMsg

func ErrorResJsonWithMsg(errMsg string) Response[any]

func ResJson

func ResJson[T any](code string, data *T, msg string) Response[T]

func SuccessResJson

func SuccessResJson(msg string) Response[any]

func SuccessResJsonWithData

func SuccessResJsonWithData[T any](data *T, msg string) Response[T]

func SuccessResJsonWithPagingData

func SuccessResJsonWithPagingData(data *PagingData, msg string) Response[PagingData]

Jump to

Keyboard shortcuts

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