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

Commit 9e4cd135 authored by jiangxiulong's avatar jiangxiulong

人体检测-获取设备列表写成task

parent 51adf01c
......@@ -5,6 +5,7 @@ import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Component
@FeignClient(
......@@ -22,4 +23,10 @@ public interface FeignPlatformApiClient {
@GetMapping("camera/detectPedestrian")
ResponseDto<String> detectPedestrian();
@GetMapping("camera/describeDevices")
ResponseDto<String> describeDevices(
@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize
);
}
......@@ -7,6 +7,7 @@ import com.liquidnet.service.feign.platform.api.FeignPlatformApiClient;
import com.liquidnet.service.feign.platform.kylin.FeignPlatformFreightClient;
import com.liquidnet.service.feign.platform.task.FeignPlatformCandyTaskClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -30,11 +31,31 @@ public class PlatformTaskHandler {
@Autowired
FeignPlatformApiClient feignPlatformApiClient;
@XxlJob(value = "sev-platform:describeDevices")
public ReturnT<String> describeDevices() {
try {
String jobParam = XxlJobHelper.getJobParam();//执行参数
log.info("jobParam = " + jobParam);
String[] paramArray = jobParam.split(",");
String result = feignPlatformApiClient.describeDevices(Integer.parseInt(paramArray[0]), Integer.parseInt(paramArray[1])).getData();
log.info("describeDevices:结果:" + result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
}
}
@XxlJob(value = "sev-platform:detectPedestrian")
public ReturnT<String> detectPedestrian() {
try {
String result = feignPlatformApiClient.detectPedestrian().getData();
log.info("detectPedestrian:结果:"+result);
log.info("detectPedestrian:结果:" + result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
......@@ -50,7 +71,7 @@ public class PlatformTaskHandler {
public ReturnT<String> overtimeRefund() {
try {
String result = feignPlatformApiClient.overtimeRefund().getData();
log.info("overtimeRefund:结果:"+result);
log.info("overtimeRefund:结果:" + result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
......@@ -66,7 +87,7 @@ public class PlatformTaskHandler {
public ReturnT<String> alipayActiveCallbackHandler() {
try {
String result = feignPlatformAlipayBackClient.alipayActiveCallback().getData();
log.info("alipayActiveCallback:结果:"+result);
log.info("alipayActiveCallback:结果:" + result);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(result);
return success;
......@@ -149,6 +170,7 @@ public class PlatformTaskHandler {
return fail;
}
}
//运费
@XxlJob(value = "sev-platform:getFreightChargeHandler")
public ReturnT<String> getFreightChargeHandler() {
......
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