|
@@ -0,0 +1,177 @@
|
|
|
+package com.xingyue.atbird.cs.dto;
|
|
|
+
|
|
|
+public enum HttpStatus {
|
|
|
+ OK(2000, "Success"),
|
|
|
+ REDIRECTION(3000, "Redirection"),
|
|
|
+ CLIENT_ERROR(4000, "Client Error"),
|
|
|
+ UNAUTHORIZED(4001, "unauthorized"),
|
|
|
+ USER_NOT_EXIST(4002, "user not exist"),
|
|
|
+ USER_EMAIL_NOT_EXIST(4088, "The Email does not exist. Please try again."),
|
|
|
+ USER_EMAIL_NOT_ENABLED(4089, "Sorry, this email can not change password here, please check with your account manager."),
|
|
|
+ USER_DISABLED(4090, "This user is disabled now."),
|
|
|
+ USER_NOT_ACTIVATED(4091, "This user account hasn't been activated."),
|
|
|
+ INCORRECT_PASSWORD(4003, "incorrect password"),
|
|
|
+ USER_ALREADY_EXIST(4004, "user already exit"),
|
|
|
+ TIME_OUT(4005, "time out"),
|
|
|
+ USER_STATUS_UNAVAILABLE(4006, "user is not allowed to login"),
|
|
|
+ PARAM_INCORRECT(4007, "param is incorrect"),
|
|
|
+ INVALID_SERVICE_TYPE(4008, "invalid service type"),
|
|
|
+ NETWORK_ANOMALY(4009, "network anomaly"),
|
|
|
+ NOT_INCLUDED(4010, "not included"),
|
|
|
+ DATE_FORMAT_ERROR(4011, "date format error"),
|
|
|
+ MAIL_ANNEX_ERROR(4012, "annex filename and data not matche"),
|
|
|
+ FAILED_SEND_MAIL(4013, "failed to send mail"),
|
|
|
+ CONNECTION_FAILED(4014, "failed to connected sftp server"),
|
|
|
+ BIDDING_CONFIG_HEADER_NOT_EXIST(4015, "bidding config header not exist"),
|
|
|
+ BASE64_DECODE_DATA_TO_FILE_ERROR(4016, "base64 decode data to file error"),
|
|
|
+ BIDDING_CONFIG_NOT_EXIST(4017, "can not find this bidding config"),
|
|
|
+ FILE_EXIST_ERROR(4018, "file already exist."),
|
|
|
+ HOTEL_IS_EMPTY(4019, "hotel must can't be empty"),
|
|
|
+ UID_NOT_FIND(4020, "can not find uid"),
|
|
|
+ MAPPING_ALREADY_EXIST(4021, "mapping alread exist in this field"),
|
|
|
+ NOT_ALLOWED_DELETE(4022, "this field been used"),
|
|
|
+ UPLOAD_FAILED(4023, "Failed"),
|
|
|
+ UPLOAD_WARNING(4024, "Partial Successful"),
|
|
|
+ FEED_NAME_ALREADY_EXIST(4025, "feed name already exist"),
|
|
|
+ EXIST_FEED_NOT_COMPLETE(4026, "exist a feed not complete"),
|
|
|
+ FEED_NOT_ALLOW_CHANGE_STATUS(4027, "feed not allow change status"),
|
|
|
+ FEED_NOT_GENERATE(4028, "feed not gerenate"),
|
|
|
+ IP_OUT_OF_LIMIT(4029, "this ip visit time out of limit"),
|
|
|
+ FEED_NOT_ALLOW_DELETE_STATUS(4030, "feed not allow to be deleted"),
|
|
|
+ FEED_NOT_ALLOW_TO_VISIT(4031, "feed not allow to visit"),
|
|
|
+ BIDDING_CONFIG_NOT_ENABLED(4032, " status not open yet"),
|
|
|
+ FEED_NOT_ALLOW_TO_EDIT(4033, "feed not allow to edit"),
|
|
|
+ FEED_XML_SETTING_ALREADY_EXIST(4034, "feed xml setting node already exist"),
|
|
|
+ FEED_XML_SETTING_NOT_EXIST(4035, "feed xml setting node is not exist"),
|
|
|
+ EMPTY_OR_ILLEGAL_NAME(4036, "empty or illegal name"),
|
|
|
+ FEED_NOT_CONTAIN_TAX_RATE(4037, "The \"Tax Inclusive Rate\" or \"Tax Exclusive Rate\" field must be selected"),
|
|
|
+ FEED_NOTE_ALLOW_TO_ACCESS(4038, "feed not allowed to access this feed"),
|
|
|
+ BIDDING_CONFIG_NOT_CORRECT(4039, " bidding config not correct"),
|
|
|
+ GOOGLE_ACCOUNT_NOT_EXIST(4040, "can not find this google account"),
|
|
|
+ CAMPAIGN_NOT_EXIST(4041, "can not find this campaign"),
|
|
|
+ CAMPAIGN_NOT_CORRECT(4042, "campaign not correct"),
|
|
|
+ CHANNEL_CAMPAIGN_ID_NOT_EXIST(4043, "channel campaign id not exist"),
|
|
|
+ GROUP_NOT_EXIST(4044, "can not find this group"),
|
|
|
+ CAMPAIGN_NAME_REPEAT(4045, "campaign name repeat"),
|
|
|
+ GROUP_NAME_REPEAT(4046, "group name repeat"),
|
|
|
+ GROUP_NOT_EXIST_IN_CAMPAIGN(4047, "can not find this group in current campaign"),
|
|
|
+ GOOGLE_CAMPAIGN_ACCOUNT_MAPPING_NOT_FOUND(4048, "No account association relationships are found. Please try agian later or contact your account manager."),
|
|
|
+ GROUP_NOT_CORRECT(4049, "group not correct"),
|
|
|
+ CAMPAIGN_NUMBER_OVER_LIMIT(4050, "number of campaign exceeds the upper limit"),
|
|
|
+ GROUP_NUMBER_OVER_LIMIT(4051, "number of group exceeds the upper limit"),
|
|
|
+ GOOGLE_ACCOUNT_NOT_FOUND(4052, "no google account found for current user"),
|
|
|
+ PARAM_INCORRECT_LIST(4053, "param list is incorrect"),
|
|
|
+ GOOGLE_CAMPAIGN_FORBIDDEN(4054, "access forbidden"),
|
|
|
+ GOOGLE_CAMPAIGN_AUDIT_FAILED(4055, "audit failed"),
|
|
|
+ GOOGLE_CAMPAIGN_ACCOUNT_MAPPING_INCORRECT(4056, "Account association relationships are incorrect. Please try agian later or contact your account manager."),
|
|
|
+ GOOGLE_CAMPAIGN_NOT_SUPPORT_MULTIPLIER(4057, "This strategy not support multiplier"),
|
|
|
+ CLICK_ARI_INVALID_FILE_FORMAT(4060, "please upload the correct xls file or xlsx file"),
|
|
|
+ CLICK_ARI_INVALID_XLS_HEADER(4061, "The name or order of header is incorrect, please try again."),
|
|
|
+ CLICK_ARI_XLS_FILE_VALIDATION_ERROR(4062, "validation errors happen in the uploaded file"),
|
|
|
+ CLICK_ARI_CHANNEL_TBL_NOT_EXISTS(4063, "channel table not exists, try to upload the file first"),
|
|
|
+ BING_ACCOUNT_NOT_FOUND(4071, "We cannot detect a Bing account. Sync program may need more time. Please try again later or check with your account manager."),
|
|
|
+ BING_ACCOUNT_NOT_AVAILABLE(4072, "Oops! It seems you don't have available account to create a new campaign. Please add more account and try again. (* Kindly note one account can only create 1 campaign based on channel limitation.)"),
|
|
|
+ BING_CAMPAIGN_NAME_REPEAT(4073, "This Campaign Name already exists. Please give each Campaign a unique name."),
|
|
|
+ BING_DAILY_BUDGET_LT_LIMIT(4074, "daily budget must greater than 0.05"),
|
|
|
+ BING_CAMPAIGN_NOT_FOUND(4075, "no campaign found"),
|
|
|
+ BING_CAMPAIGN_SIZE_OVER_LIMIT(4076, "number of campaigns exceeds the upper limit"),
|
|
|
+ BING_GROUP_NOT_FOUND(4077, "no group found"),
|
|
|
+ BING_HOTEL_NOT_FOUND(4078, "We cannot detect any hotels at this moment. Please try again later or check with your account manager."),
|
|
|
+ BING_UNGROUP_NOT_FOUND(4079, "no ungroup found"),
|
|
|
+ BING_HOTEL_INVALID(4080, "hotel invalid"),
|
|
|
+ BING_ACCOUNT_BEEN_UPDATE(4081, "The channel account you selected has been updated, please reselect it."),
|
|
|
+ BING_CAMPAIGN_FORBIDDEN(4082, "access forbidden"),
|
|
|
+ BING_HOTEL_PARTIAL_FAILURE(4085, "Partially failure when bulk assign/push hotels to bing."),
|
|
|
+ BING_HOTEL_TOTAL_FAILURE(4086, "Totally failure when bulk assign/push hotels to bing."),
|
|
|
+ BING_UNGROUP_FOUND_WHEN_OPERATE_HOTEL(4087, "Ungrouped found when operate hotels."),
|
|
|
+ NOT_ALLOWD_TO_UPDATE(4048, "not allowed to edit"),
|
|
|
+ EMPTY_RELATIONSHIP(4049, "empty relationship"),
|
|
|
+ ACCOUNT_HOTEL_NOT_EXIST(4050, " can't not found account_hotel list"),
|
|
|
+ ACCOUNT_CHANNEL_NOT_EXIST(4051, " can't not found account_channel list"),
|
|
|
+ ACCOUNT_CHANNEL_HOTEL_NOT_EXIST(4052, " can't not found account_channel_hotel list"),
|
|
|
+ SUPPLIER_CODE_ALREADY_EXIST(4053, "supplier code already exist"),
|
|
|
+ EMPTY_FILE(4054, "File is empty"),
|
|
|
+ PNB_FILE_HEADER_NOT_MATCH(4055, "Upload failed. Header changed, please revise the value and upload again. "),
|
|
|
+ UNAUTHORIZED_IP(4100, "this ip is not allowed to visit resource"),
|
|
|
+ TRANSACTION_TIMEOUT(4084, "transaction timeout"),
|
|
|
+ SERVER_ERROR(5000, "Server Error"),
|
|
|
+ ERROR_IN_DATABASE(5001, "a problem has occurred in database"),
|
|
|
+ ERROR_IN_CACHE(5002, "a problem has occurred in cache"),
|
|
|
+ INTERNAL_SERVER_ERROR(5003, "Service unavailable"),
|
|
|
+ ANALYZE_FAILED(5004, "can not analyze such ip"),
|
|
|
+ BIDDING_EXECUTION_ERROR(5005, "Error in bidding execution"),
|
|
|
+ NOT_GET_REDIS_POOL(5006, "can not get redis connection from pool"),
|
|
|
+ USER_SUPPLIER_IS_EMPTY(6001, "current user don't binding any suppliers"),
|
|
|
+ NOT_ANY_FEED_GENERATE(6002, "there is not any feed to gengerate");
|
|
|
+
|
|
|
+ private final int code;
|
|
|
+ private final String message;
|
|
|
+
|
|
|
+ private HttpStatus(int code, String message) {
|
|
|
+ this.code = code;
|
|
|
+ this.message = message;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getCode() {
|
|
|
+ return this.code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMessage() {
|
|
|
+ return this.message;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String toString() {
|
|
|
+ return "HttpStatus{code=" + this.code + ", message='" + this.message + '\'' + '}';
|
|
|
+ }
|
|
|
+
|
|
|
+ public HttpStatus.Series series() {
|
|
|
+ return HttpStatus.Series.valueOf(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static HttpStatus valueOf(int statusCode) {
|
|
|
+ HttpStatus[] var1 = values();
|
|
|
+ int var2 = var1.length;
|
|
|
+
|
|
|
+ for(int var3 = 0; var3 < var2; ++var3) {
|
|
|
+ HttpStatus status = var1[var3];
|
|
|
+ if (status.code == statusCode) {
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static enum Series {
|
|
|
+ INFORMATIONAL(1),
|
|
|
+ SUCCESSFUL(2),
|
|
|
+ REDIRECTION(3),
|
|
|
+ CLIENT_ERROR(4),
|
|
|
+ SERVER_ERROR(5);
|
|
|
+
|
|
|
+ private final int value;
|
|
|
+
|
|
|
+ private Series(int value) {
|
|
|
+ this.value = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int value() {
|
|
|
+ return this.value;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static HttpStatus.Series valueOf(HttpStatus status) {
|
|
|
+ int seriesCode = status.getCode() / 1000;
|
|
|
+ HttpStatus.Series[] var2 = values();
|
|
|
+ int var3 = var2.length;
|
|
|
+
|
|
|
+ for(int var4 = 0; var4 < var3; ++var4) {
|
|
|
+ HttpStatus.Series series = var2[var4];
|
|
|
+ if (series.value == seriesCode) {
|
|
|
+ return series;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new IllegalArgumentException("No matching constant for [" + status + "]");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|