| | |
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.TaoKeLogHelper;
|
| | | import com.yeshi.fanli.util.EmergencyUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoHttpUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | String result = TaoBaoHttpUtil.taoKeGet(params);
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | | if (data != null) {
|
| | | if (data.optJSONObject("error_response") != null
|
| | | && data.optJSONObject("error_response").optInt("code") == 7) {
|
| | | if (data.optJSONObject("error_response") != null && data.optJSONObject("error_response").optInt("code") == 7
|
| | | && "accesscontrol.limited-by-app-access-count"
|
| | | .equalsIgnoreCase(data.optJSONObject("error_response").optString("sub_code"))) {
|
| | | reportAppInvalid(app.getAppKey());
|
| | | TaoKeLogHelper.error(params, result);
|
| | | try {
|
| | | EmergencyUtil.baoJin("monitor-error-tb-app-limit-" + params.get("app_key"),
|
| | | "淘宝APPKey请求限制【" + params.get("app_key") + "】", new String[] { "18581318252" });
|
| | | } catch (Exception e1) {
|
| | | }
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_APPKEY_LIMIT, "淘宝请求限制:" + result, params);
|
| | | } else if (data.optJSONObject("error_response") != null) {
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_API_ERROR, result, params);
|
| | |
| | | String result = TaoBaoHttpUtil.taoKeGet(params);
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | | if (data != null) {
|
| | | if (data.optJSONObject("error_response") != null
|
| | | && data.optJSONObject("error_response").optInt("code") == 7) {
|
| | | if (data.optJSONObject("error_response") != null && data.optJSONObject("error_response").optInt("code") == 7
|
| | | && "accesscontrol.limited-by-app-access-count"
|
| | | .equalsIgnoreCase(data.optJSONObject("error_response").optString("sub_code"))) {
|
| | | reportAppInvalid(app.getAppKey());
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_APPKEY_LIMIT, "淘宝请求限制:" + result, params);
|
| | | } else if (data.optJSONObject("error_response") != null) {
|