|
@@ -0,0 +1,53 @@
|
|
|
|
+package com.fdkankan.ucenter.controller.api;
|
|
|
|
+import com.fdkankan.ucenter.common.BaseController;
|
|
|
|
+import com.fdkankan.ucenter.common.Result;
|
|
|
|
+import com.fdkankan.ucenter.entity.User;
|
|
|
|
+import com.fdkankan.ucenter.service.ICameraDetailService;
|
|
|
|
+import com.fdkankan.ucenter.service.ICameraService;
|
|
|
|
+import com.fdkankan.ucenter.service.ISceneProService;
|
|
|
|
+import com.fdkankan.ucenter.service.IUserService;
|
|
|
|
+import com.fdkankan.ucenter.vo.response.CameraAppVo;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 激光使用接口
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/laser")
|
|
|
|
+public class LaserController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ ISceneProService sceneProService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICameraService cameraService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IUserService userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICameraDetailService cameraDetailService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据手机号码获取 相机 sncode
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/getSnCodeByPhone",method = RequestMethod.GET)
|
|
|
|
+ public Result getSnCodeByUserName(@RequestParam(required = false)String phone) throws Exception {
|
|
|
|
+ User userEntity = userService.getByUserName(phone);
|
|
|
|
+ List<CameraAppVo> cameraAppVos = cameraDetailService.getListByUserAndType(userEntity.getId(), 10);//深时相机
|
|
|
|
+ Set<String> collect = cameraAppVos.stream().map(CameraAppVo::getSnCode).collect(Collectors.toSet());
|
|
|
|
+ HashMap<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("phone",phone);
|
|
|
|
+ map.put("snCodes",collect);
|
|
|
|
+ return Result.success(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|