|
@@ -1,5 +1,10 @@
|
|
|
package com.fdkankan.contro.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.contro.entity.Camera;
|
|
|
+import com.fdkankan.contro.service.ICameraService;
|
|
|
import com.fdkankan.contro.service.ICommonService;
|
|
|
import com.fdkankan.contro.service.IScene3dNumService;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
@@ -9,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* TODO
|
|
@@ -27,10 +34,20 @@ public class TestController {
|
|
|
private ICommonService commonService;
|
|
|
@Value("${4dkk.laserService.bucket}")
|
|
|
private String bucket;
|
|
|
+ @Autowired
|
|
|
+ private ICameraService cameraService;
|
|
|
|
|
|
@GetMapping("/test")
|
|
|
- public ResultData test(String num) throws Exception {
|
|
|
- return ResultData.ok(bucket);
|
|
|
+ public ResultData test(String mac) throws Exception {
|
|
|
+ Camera camera = cameraService.getBySnCode(mac);
|
|
|
+ if(Objects.isNull(camera)){
|
|
|
+ camera = cameraService.getOne(new LambdaQueryWrapper<Camera>()
|
|
|
+ .like(Camera::getChildName, mac)
|
|
|
+ .or().like(Camera::getSnCode, mac)
|
|
|
+ .or().like(Camera::getWifiName, mac));
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
|
|
|
+ }
|
|
|
+ return ResultData.ok(camera);
|
|
|
}
|
|
|
|
|
|
}
|