background/vendor/wapi/config/rsp.go

35 lines
565 B
Go

package config
const (
//php 状态响应码原样复制
STATUSOK = 0
STATUS1 = 1
STATUS99 = 99
STATUS100 = 100
STATUS119 = 119
STATUS120 = 120
STATUS200 = 200
STATUS500 = 500
STATUS101 = 101
ISNEWRECORD = false
STATUSSQL = 1045
STATUSATOI = 1025
STATUSJSON = 1026
)
var mRsp = map[int]string{
STATUSOK: "ok",
STATUSATOI:"PARAMETER INTERGER ERROR",
STATUSSQL:"DATABASE ERROR",
STATUSJSON:"JSON ERR",
}
// 获取错误码消息值
func Msg(code int) string {
if v, ok := mRsp[code]; ok {
return v
}
return "unknow"
}