19 lines
250 B
Go
19 lines
250 B
Go
package ecode
|
|
|
|
const (
|
|
COMMON_OK = iota
|
|
PARAM_ERROR
|
|
)
|
|
|
|
var COMMON_MEG = map[int]string{
|
|
COMMON_OK: "OK",
|
|
PARAM_ERROR: "参数错误",
|
|
}
|
|
|
|
func Common(id int) *Ecode {
|
|
code := new(Ecode)
|
|
code.Code = id
|
|
code.Msg = COMMON_MEG[id]
|
|
return code
|
|
}
|