|
| 1 | +package com.example.demo.util; |
| 2 | + |
| 3 | +public class ErrorResponseBuilder { |
| 4 | + /** |
| 5 | + * success |
| 6 | + */ |
| 7 | + public static int SUCCESS=0; |
| 8 | + |
| 9 | + |
| 10 | + /* |
| 11 | + * user service error prefix 500 |
| 12 | + */ |
| 13 | + public static int InvalidLoginAccountType = 50001; |
| 14 | + |
| 15 | + public static String InvalidLoginAccountType_Message() |
| 16 | + { |
| 17 | + return String.format("{retCode:%d,uid:null}",InvalidLoginAccountType); |
| 18 | + } |
| 19 | + |
| 20 | + public static int InvalidPhoneNumberformat = 50002; |
| 21 | + |
| 22 | + public static String InvalidPhoneNumberformat_Message() |
| 23 | + { |
| 24 | + return String.format("{retCode:%d,uid:null}", InvalidPhoneNumberformat); |
| 25 | + } |
| 26 | + |
| 27 | + public static int AccountTypeNotProvided = 50003; |
| 28 | + |
| 29 | + public static String AccountTypeNotProvided_Message() |
| 30 | + { |
| 31 | + return String.format("{retCode:%d,uid:null}", AccountTypeNotProvided); |
| 32 | + } |
| 33 | + |
| 34 | + public static int AccountNotProvided = 50004; |
| 35 | + |
| 36 | + public static String AccountNotProvided_Message() |
| 37 | + { |
| 38 | + return String.format("{retCode:%d,uid:null}", AccountNotProvided); |
| 39 | + } |
| 40 | + |
| 41 | + public static int PasswordNotProvided = 50005; |
| 42 | + |
| 43 | + public static String PasswordNotProvided_Message() |
| 44 | + { |
| 45 | + return String.format("{retCode:%d,uid:null}", PasswordNotProvided); |
| 46 | + } |
| 47 | + |
| 48 | + public static int PasswordOrUserNameNotMatch = 50006; |
| 49 | + |
| 50 | + public static int DBError = 50007; |
| 51 | + |
| 52 | + public static int CacheLimitReached = 50008; |
| 53 | + |
| 54 | + public static int UserAlreadyExist = 50009; |
| 55 | + |
| 56 | + /** |
| 57 | + * health service error prefix 600 |
| 58 | + */ |
| 59 | + public static int ParameterNotProvided = 60001; |
| 60 | + |
| 61 | + /** |
| 62 | + * sport data error prefix 600 |
| 63 | + */ |
| 64 | + public static int InvalidUidOrTokenType = 60001; |
| 65 | + |
| 66 | + public static String InvalidUidOrTokenType_message() { |
| 67 | + return String.format("{retcode:%d,msg:invalid token}", InvalidUidOrTokenType); |
| 68 | + } |
| 69 | + |
| 70 | + public static int UploadDatasIsEmpty = 60002; |
| 71 | + |
| 72 | + public static String UploadDatasIsEmpty_message() { |
| 73 | + return String.format("retcode:%d,msg:upload empty data", UploadDatasIsEmpty); |
| 74 | + } |
| 75 | + |
| 76 | + public static int InvalidParams = 60003; |
| 77 | + |
| 78 | + public static String InvalidParamsHadSend() { |
| 79 | + return String.format("{retcode:%d,msg:InvalidParamsHadSend}", InvalidParams); |
| 80 | + } |
| 81 | + |
| 82 | + public static int InsertOrUpdateError = 60004; |
| 83 | + public static int NoData = 60404; |
| 84 | + public static String InsertOrUpdateTryCatch() { |
| 85 | + return String.format("retcode:%d,msg:InsertOrUpdateTryCatch}", InsertOrUpdateError); |
| 86 | + } |
| 87 | + |
| 88 | + |
| 89 | +} |
0 commit comments