作者 yangfu

message fix

package protocol
import "github.com/prometheus/common/log"
var errmessge ErrorMap = map[int]string{
1: "系统异常",
101: "clientId或clientSecret无效",
... ... @@ -22,25 +20,6 @@ var errmessge ErrorMap = map[int]string{
4142: "Uuid已存在,请求失败",
}
func SearchErr(code int) ErrorCode {
return errmessge.Search(code)
}
func NewReturnResponse(data interface{}, eRR error) *ResponseMessage {
var msg *ResponseMessage
if eRR == nil {
msg = NewMesage(0)
msg.Data = data
return msg
} else {
log.Error("sys error:", eRR)
}
// fmt.Println("日志:" + eRR.Error())
if x, ok := eRR.(CustomErrParse); ok {
return x.ParseToMessage()
}
return NewMesage(1)
}
func InitMessageCode() {
// messages := []struct {
... ...