作者 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 {
... ...
... ... @@ -49,11 +49,11 @@ func init() {
beego.GlobalControllerRouter["opp/controllers/v1:CommendController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:CommendController"],
beego.ControllerComments{
Method: "Company",
Router: `/company`,
Method: "Company",
Router: `/company`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"],
beego.ControllerComments{
... ...