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

Commit 87bb2d3f authored by jiangxiulong's avatar jiangxiulong

人体检测-task

parent a5e686b2
...@@ -19,4 +19,7 @@ public interface FeignPlatformApiClient { ...@@ -19,4 +19,7 @@ public interface FeignPlatformApiClient {
@GetMapping("refund/overtimeRefund") @GetMapping("refund/overtimeRefund")
ResponseDto<String> overtimeRefund(); ResponseDto<String> overtimeRefund();
@GetMapping("detectPedestrian")
ResponseDto<String> detectPedestrian();
} }
...@@ -30,6 +30,22 @@ public class PlatformTaskHandler { ...@@ -30,6 +30,22 @@ public class PlatformTaskHandler {
@Autowired @Autowired
FeignPlatformApiClient feignPlatformApiClient; FeignPlatformApiClient feignPlatformApiClient;
@XxlJob(value = "sev-platform:detectPedestrian")
public ReturnT<String> detectPedestrian() {
try {
String result = feignPlatformApiClient.detectPedestrian().getData();
log.info("detectPedestrian:结果:"+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:overtimeRefund") @XxlJob(value = "sev-platform:overtimeRefund")
public ReturnT<String> overtimeRefund() { public ReturnT<String> overtimeRefund() {
try { try {
......
...@@ -17,9 +17,9 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -17,9 +17,9 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.KylinCameraDevicesVo; import com.liquidnet.service.kylin.dto.vo.KylinCameraDevicesVo;
import com.liquidnet.service.kylin.entity.KylinCamera; import com.liquidnet.service.kylin.entity.KylinCamera;
import com.liquidnet.service.kylin.entity.KylinCameraRecord; import com.liquidnet.service.kylin.entity.KylinCameraRecord;
...@@ -38,7 +38,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -38,7 +38,6 @@ import org.springframework.web.bind.annotation.*;
import java.io.InputStream; import java.io.InputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Optional;
/** /**
* <p> * <p>
...@@ -82,13 +81,13 @@ public class KylinCameraController { ...@@ -82,13 +81,13 @@ public class KylinCameraController {
} }
} }
@GetMapping(value = "describeDevices") @GetMapping("describeDevices")
@ApiOperation("获取设备列表") @ApiOperation("获取设备列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "pageNum", value = "页码"), @ApiImplicitParam(type = "query", dataType = "Integer", name = "pageNum", value = "页码"),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "pageSize", value = "数量") @ApiImplicitParam(type = "query", dataType = "Integer", name = "pageSize", value = "数量")
}) })
public String describeDevices( public ResponseDto describeDevices(
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize
) { ) {
...@@ -138,16 +137,16 @@ public class KylinCameraController { ...@@ -138,16 +137,16 @@ public class KylinCameraController {
} }
return "success"; return ResponseDto.success();
} catch (ClientException | JsonProcessingException e) { } catch (ClientException | JsonProcessingException e) {
log.error("获取设备列表Exception:[msg={}, e={}]", e.getMessage(), e); log.error("获取设备列表Exception:[msg={}, e={}]", e.getMessage(), e);
return "error"; return ResponseDto.failure();
} }
} }
@GetMapping(value = "detectPedestrian") @GetMapping(value = "detectPedestrian")
@ApiOperation("人体识别") @ApiOperation("人体识别")
public String detectPedestrian() { public ResponseDto detectPedestrian() {
long startTime1 = System.currentTimeMillis(); long startTime1 = System.currentTimeMillis();
List<KylinCamera> cameraList = cameraMapper.selectList( List<KylinCamera> cameraList = cameraMapper.selectList(
Wrappers.lambdaQuery(KylinCamera.class) Wrappers.lambdaQuery(KylinCamera.class)
...@@ -188,7 +187,7 @@ public class KylinCameraController { ...@@ -188,7 +187,7 @@ public class KylinCameraController {
} }
} }
} }
return "success"; return ResponseDto.success();
} }
} }
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