respx

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS     errcode = "00000" //成功
	SUCCESS_MSG errmsg  = "成功"    //成功
)
View Source
const (
	ERR000_01     errcode = "00001"       //通用错误
	ERR000_01_MSG errmsg  = "网络错误,请稍后重试!" //通用错误

	ERR000_02     errcode = "00002" //无操作权限
	ERR000_02_MSG errmsg  = "无操作权限" //无操作权限

	ERR000_03     errcode = "00003"   //请求格式不正确
	ERR000_03_MSG errmsg  = "请求格式不正确" //请求格式不正确

	ERR000_04     errcode = "00004" //无访问权限
	ERR000_04_MSG errmsg  = "无访问权限" //无访问权限

	ERR000_05     errcode = "00005"  //请登录后操作
	ERR000_05_MSG errmsg  = "请登录后操作" //请登录后操作

	ERR000_06     errcode = "00006"   //请求类型未定义
	ERR000_06_MSG errmsg  = "请求类型未定义" //请求类型未定义

	ERR000_07     errcode = "00007" //令牌过期
	ERR000_07_MSG errmsg  = "令牌过期"  //令牌过期

	ERR000_08     errcode = "00008"    //帐号已在别处登陆
	ERR000_08_MSG errmsg  = "帐号已在别处登陆" //帐号已在别处登陆

	ERR000_09     errcode = "00009"      //权限被修改请重新登录
	ERR000_09_MSG errmsg  = "权限被修改请重新登录" //权限被修改请重新登录
)

errcode 000_00~99

View Source
const (
	ERR100_00 errcode = "10000" //弹出提醒用户

	ERR100_01     errcode = "10001" //数据不存在
	ERR100_01_MSG errmsg  = "数据不存在" //数据不存在

	ERR100_02 errcode = "10002" //提示用户,不是弹出,前端自定义提示
)

errcode 100_00~99

View Source
const (
	ERR211_00     errcode = "21100"  //物联网关错误
	ERR211_00_MSG errmsg  = "物联网关错误" //物联网关错误

	ERR211_01     errcode = "21101" //编号不存在
	ERR211_01_MSG errmsg  = "编号不存在" //编号不存在

	ERR211_02     errcode = "21102" //编号已激活
	ERR211_02_MSG errmsg  = "编号已激活" //编号已激活

	ERR211_03     errcode = "21103" //编号已停用
	ERR211_03_MSG errmsg  = "编号已停用" //编号已停用
)

errcode 211_00~99

Variables

This section is empty.

Functions

func Errmsg

func Errmsg(msg string) errmsg

func Resp

func Resp(p *RespCode) string

func Resp00001

func Resp00001() string

func Resp00001Byte

func Resp00001Byte() []byte

00001

func Resp00001Msg

func Resp00001Msg(msg string) string

func Resp00001MsgByte

func Resp00001MsgByte(msg string) string

func Resp00002

func Resp00002() string

00002

func Resp00003

func Resp00003() string

00003

func Resp00004

func Resp00004() string

func Resp00004Byte

func Resp00004Byte() []byte

00004

func Resp00005

func Resp00005() string

func Resp00005Byte

func Resp00005Byte(msgs ...string) []byte

00005

func Resp00006

func Resp00006() string

00006

func Resp00007

func Resp00007() string

func Resp00007Byte

func Resp00007Byte() []byte

00007

func Resp00008

func Resp00008() string

00008

func Resp00009

func Resp00009() string

00009

func Resp10000

func Resp10000(msg string) string

func Resp10001

func Resp10001() string

func Resp10002

func Resp10002(msg string) string

func Resp21100

func Resp21100() string

func Resp21101

func Resp21101() string

func Resp21102

func Resp21102() string

func Resp21103

func Resp21103() string

func RespByte

func RespByte(p *RespCode) []byte

func RespData

func RespData(data interface{}) string

func RespDatas

func RespDatas(datas interface{}) string

func RespPageDatas

func RespPageDatas(datas, page interface{}) string

func RespSuccess

func RespSuccess() string

func RespSuccessByte

func RespSuccessByte() []byte

func RespSuccessMsg

func RespSuccessMsg(msg string) string

func RespSuccessMsgByte

func RespSuccessMsgByte(msg string) string

func SErrmsg

func SErrmsg(f string, msgs ...interface{}) errmsg

Types

type RespCode

type RespCode struct {
	Errcode errcode `json:"errcode"`          //错误代码
	Errmsg  errmsg  `json:"errmsg,omitempty"` //错误信息

	Page  interface{} `json:"page,omitempty"`  //分页参数
	Data  interface{} `json:"data,omitempty"`  //数据内容
	Datas interface{} `json:"datas,omitempty"` //数据数组
}

func (RespCode) Resp

func (p RespCode) Resp() string

Jump to

Keyboard shortcuts

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