api_result

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Result      = "result"
	Total       = "total"
	CurrentPage = "currentPage"
	PageSize    = "pageSize"
)

Variables

This section is empty.

Functions

func NewApiResult

func NewApiResult(ctx *gin.Context) *apiResultJson

func NewPage

func NewPage(data interface{}, total, currentPage, pageSize int) gin.H

Types

type ApiResult

type ApiResult struct {
	Success bool        `json:"success"`
	Msg     string      `json:"msg"`
	Obj     interface{} `json:"obj"`
	Code    string      `json:"code"`
}

func Error

func Error(errCode string, errMsg string) ApiResult

返回ApiResult对象

func Success

func Success(data interface{}) ApiResult

Jump to

Keyboard shortcuts

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