status

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/*
		1: 登陆认证失败
		2:用户请求数据处理失败
		3:服务端处理失败
	*/
	StatusOK           = StatusCode(0)
	StatusInvalidSign  = StatusCode(1100)
	StatusLoginFailed  = StatusCode(1103)
	StatusAccessDenied = StatusCode(2100)
	// 请求参数合法性验证(GET)
	StatusNotLegalInput = StatusCode(2101)
	// 地址错误
	StatusNotFound = StatusCode(2404)
	// json请求校验失败(PUT,POST)
	StatusBodyInvalid          = StatusCode(2104)
	StatusDataProcessingFailed = StatusCode(3100)
	StatusSaveDataFailed       = StatusCode(3101)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMsg

type BaseMsg struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type ErrMsg

type ErrMsg struct {
	BaseMsg
	Detail interface{} `json:"detail"`
}

type RespData

type RespData struct {
	BaseMsg
	DataList    interface{} `json:"dataList"`
	TotalRecord int         `json:"totalRecord"`
	PageSize    int         `json:"pagesize"`
	PageNo      int         `json:"pageno"`
}

func NewRespData

func NewRespData(data interface{}, tr int) *RespData

type StatusCode

type StatusCode int

func (StatusCode) Msg

func (sc StatusCode) Msg(msg ...interface{}) *ErrMsg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳