فهرست منبع

更加sn查询相机详情内部使用

lyhzzz 1 سال پیش
والد
کامیت
8435f20ea0

+ 12 - 6
src/main/java/com/fdkankan/ucenter/controller/inner/InnerController.java

@@ -7,15 +7,17 @@ import com.fdkankan.ucenter.annotation.CheckInnerApiPermit;
 import com.fdkankan.ucenter.common.BaseController;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.service.IInnerService;
+import com.fdkankan.ucenter.vo.request.CameraDetailParam;
+import com.fdkankan.ucenter.vo.response.CameraVo;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 
 /**
  * <p>
@@ -96,7 +98,11 @@ public class InnerController extends BaseController {
         return Result.success(innerService.getSceneInfo(num));
     }
 
-    public static void main(String[] args) {
-        System.out.println(SecurityUtil.MD5(".\f\u0017\u0002\u0016\u001A\u0019E"));
+    @GetMapping(value = "/getSnCode/{snCode}")
+    public Result getSnCode( @PathVariable String snCode) {
+        if(StringUtils.isBlank(snCode)){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        return Result.success(innerService.getCameraDetail(snCode));
     }
 }

+ 1 - 1
src/main/java/com/fdkankan/ucenter/entity/CameraDetail.java

@@ -65,7 +65,7 @@ public class CameraDetail implements Serializable {
     private String agency;
 
     /**
-     * 相机类型,0表示双目,1四维看看pro,2 四维看看lite,9 双目转台,10 激光转台
+     * 相机类型,0表示双目,1四维看看pro,2 四维看看lite,9 看见,10 深时 11,深光
      */
     @TableField("type")
     private Integer type;

+ 2 - 0
src/main/java/com/fdkankan/ucenter/service/IInnerService.java

@@ -24,4 +24,6 @@ public interface IInnerService {
     Result querySceneNum(String path);
 
     LaserSceneInfoVo getSceneInfo(String num);
+
+    Object getCameraDetail(String snCode);
 }

+ 15 - 0
src/main/java/com/fdkankan/ucenter/service/impl/InnerServiceImpl.java

@@ -11,6 +11,7 @@ import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.common.constants.ConstantFilePath;
 import com.fdkankan.ucenter.common.constants.ResultCode;
+import com.fdkankan.ucenter.constant.LoginConstant;
 import com.fdkankan.ucenter.entity.*;
 import com.fdkankan.ucenter.service.*;
 import com.fdkankan.ucenter.vo.response.LaserSceneInfoVo;
@@ -48,6 +49,10 @@ public class InnerServiceImpl implements IInnerService {
     private IUserService userService;
     @Autowired
     private RedisUtil redisUtil;
+    @Autowired
+    private ICameraDetailService cameraDetailService;
+    @Autowired
+    private ICameraService cameraService;
 
     @Autowired
     private FYunFileServiceInterface fYunFileService;
@@ -199,4 +204,14 @@ public class InnerServiceImpl implements IInnerService {
         }
         throw new BusinessException(ResultCode.FAILURE_CODE_400002,ResultCode.FAILURE_MSG_400002);
     }
+
+
+    @Override
+    public Object getCameraDetail(String snCode) {
+        Camera camera = cameraService.getBySnCode(snCode);
+        if(camera == null){
+            throw new BusinessException(-1,"相机不存在");
+        }
+        return cameraDetailService.getByCameraId(camera.getId());
+    }
 }