服务器响应枚举类设计(与ServerResponse共用)

 1 public enum ResponseCode {
 2   //请求成功唯一标志
 3     SUCCESS(000000,"SUCESS"),
 4     ERROR(999999,"ERROR"),
 5     ILLEGAL_ARGUMENT(200001,"ILLEGAL_ARGUMENT"),
 6     NEED_LOGIN(100001,"NEED_LOGIN");
 7 
 8     private final  int code;
 9     private final  String dec;
10 
11 
12 
13     ResponseCode(int code,String dec) {
14         this.code = code;
15         this.dec = dec;
16     }
17 
18     public  int getCode(){return  code;}
19 
20     public  String getDec(){return  dec;}
21 }

 

posted @ 2019-01-21 16:15  chc24w  阅读(898)  评论(0)    收藏  举报