作者 yangfu

message fix

1 package protocol 1 package protocol
2 2
3 -import "github.com/prometheus/common/log"  
4 -  
5 var errmessge ErrorMap = map[int]string{ 3 var errmessge ErrorMap = map[int]string{
6 1: "系统异常", 4 1: "系统异常",
7 101: "clientId或clientSecret无效", 5 101: "clientId或clientSecret无效",
@@ -22,25 +20,6 @@ var errmessge ErrorMap = map[int]string{ @@ -22,25 +20,6 @@ var errmessge ErrorMap = map[int]string{
22 4142: "Uuid已存在,请求失败", 20 4142: "Uuid已存在,请求失败",
23 } 21 }
24 22
25 -func SearchErr(code int) ErrorCode {  
26 - return errmessge.Search(code)  
27 -}  
28 -func NewReturnResponse(data interface{}, eRR error) *ResponseMessage {  
29 - var msg *ResponseMessage  
30 - if eRR == nil {  
31 - msg = NewMesage(0)  
32 - msg.Data = data  
33 - return msg  
34 - } else {  
35 - log.Error("sys error:", eRR)  
36 - }  
37 - // fmt.Println("日志:" + eRR.Error())  
38 - if x, ok := eRR.(CustomErrParse); ok {  
39 - return x.ParseToMessage()  
40 - }  
41 - return NewMesage(1)  
42 -}  
43 -  
44 23
45 func InitMessageCode() { 24 func InitMessageCode() {
46 // messages := []struct { 25 // messages := []struct {
@@ -49,11 +49,11 @@ func init() { @@ -49,11 +49,11 @@ func init() {
49 49
50 beego.GlobalControllerRouter["opp/controllers/v1:CommendController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:CommendController"], 50 beego.GlobalControllerRouter["opp/controllers/v1:CommendController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:CommendController"],
51 beego.ControllerComments{ 51 beego.ControllerComments{
52 - Method: "Company",  
53 - Router: `/company`, 52 + Method: "Company",
  53 + Router: `/company`,
54 AllowHTTPMethods: []string{"post"}, 54 AllowHTTPMethods: []string{"post"},
55 - MethodParams: param.Make(),  
56 - Params: nil}) 55 + MethodParams: param.Make(),
  56 + Params: nil})
57 57
58 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"], 58 beego.GlobalControllerRouter["opp/controllers/v1:UploadController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UploadController"],
59 beego.ControllerComments{ 59 beego.ControllerComments{