记得上下班打卡 | git大法好,push需谨慎

Commit 7b46d39f authored by 张国柄's avatar 张国柄

~JOB;

parent 6ee73f70
......@@ -35,14 +35,10 @@ public class PlatformTaskHandler {
try {
String result = feignPlatformApiClient.overtimeRefund().getData();
log.info("overtimeRefund:结果:"+result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, result);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -51,14 +47,10 @@ public class PlatformTaskHandler {
try {
String result = feignPlatformAlipayBackClient.alipayActiveCallback().getData();
log.info("alipayActiveCallback:结果:"+result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, result);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -69,14 +61,10 @@ public class PlatformTaskHandler {
ResponseDto<String> dto = feignPlatformCandyTaskClient.mgtIssueCoupons();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -87,14 +75,10 @@ public class PlatformTaskHandler {
ResponseDto<String> dto = feignPlatformCandyTaskClient.dueProcessForRedeem();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -105,14 +89,10 @@ public class PlatformTaskHandler {
ResponseDto<String> dto = feignPlatformCandyTaskClient.dueProcessForCommon();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -123,14 +103,10 @@ public class PlatformTaskHandler {
ResponseDto<String> dto = feignPlatformCandyTaskClient.dueProcessForUser();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
//运费
......@@ -140,14 +116,10 @@ public class PlatformTaskHandler {
ResponseDto<Object> dto = feignPlatformFreightClient.getFreightCharge();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
......@@ -159,14 +131,10 @@ public class PlatformTaskHandler {
ResponseDto<String> dto = feignPlatformCandyTaskClient.doTask();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, dtoStr);
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.SUCCESS_CODE, e.getLocalizedMessage());
}
}
}
......@@ -26,7 +26,8 @@ public class SweetCityVoteTaskHandler {
log.info("jobParam = " + jobParam);
String[] paramArray = jobParam.split(",");
ReturnT<String> success = ReturnT.SUCCESS;
ReturnT<String> success = new ReturnT<>();
success.setCode(ReturnT.SUCCESS_CODE);
for (String type : paramArray) {
log.info("type = " + type);
......@@ -38,9 +39,7 @@ public class SweetCityVoteTaskHandler {
return success;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.FAIL_CODE, e.getLocalizedMessage());
}
}
......
......@@ -42,7 +42,8 @@ public class SweetTaskHandler {
log.info("jobParam = " + jobParam);
String[] paramArray = jobParam.split(",");
ReturnT<String> success = ReturnT.SUCCESS;
ReturnT<String> success = new ReturnT<>();
success.setCode(ReturnT.SUCCESS_CODE);
for (String id : paramArray) {
log.info("id = " + id);
......@@ -54,9 +55,7 @@ public class SweetTaskHandler {
return success;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.FAIL_CODE, e.getLocalizedMessage());
}
}
}
......@@ -24,14 +24,10 @@ public class SweetWechatTaskHandler {
try {
Object data = feignSweetWechatClient.send().getData();
log.info("sendWechatMsgHandler:结果:{}", data);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(String.valueOf(data));
return success;
return new ReturnT<>(ReturnT.SUCCESS_CODE, String.valueOf(data));
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.FAIL_CODE, e.getLocalizedMessage());
}
}
......@@ -42,7 +38,8 @@ public class SweetWechatTaskHandler {
log.info("jobParam = " + jobParam);
String[] paramArray = jobParam.split(":");
ReturnT<String> success = ReturnT.SUCCESS;
ReturnT<String> success = new ReturnT<>();
success.setCode(ReturnT.SUCCESS_CODE);
for (String typeAndTargetId : paramArray) {
String[] typeAndTargetIdArray = typeAndTargetId.split(",");
......@@ -56,9 +53,7 @@ public class SweetWechatTaskHandler {
return success;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
return new ReturnT<>(ReturnT.FAIL_CODE, e.getLocalizedMessage());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment