YiTao/ecode/common_ecode.go
2024-11-09 14:59:27 +08:00

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
}