|
@@ -5,7 +5,10 @@ import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.ucenter.common.BaseController;
|
|
|
import com.fdkankan.ucenter.common.Result;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
+import com.fdkankan.ucenter.entity.Camera;
|
|
|
import com.fdkankan.ucenter.exception.BusinessException;
|
|
|
+import com.fdkankan.ucenter.service.ICameraDetailService;
|
|
|
+import com.fdkankan.ucenter.service.ICameraService;
|
|
|
import com.fdkankan.ucenter.service.IScenePlusService;
|
|
|
import com.fdkankan.ucenter.service.ISceneProService;
|
|
|
import com.fdkankan.ucenter.service.impl.AppSceneService;
|
|
@@ -31,6 +34,8 @@ public class DeviceSceneController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
ISceneProService sceneProService;
|
|
|
+ @Autowired
|
|
|
+ ICameraService cameraService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -46,9 +51,13 @@ public class DeviceSceneController extends BaseController {
|
|
|
}
|
|
|
String username = JwtUtil.getUsername(getToken());
|
|
|
if(StringUtils.isBlank(username)){
|
|
|
- throw new BusinessException(ResultCode.PARAM_MISS);
|
|
|
+ throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
|
+ }
|
|
|
+ Camera camera = cameraService.getBySnCode(username);
|
|
|
+ if(camera == null){
|
|
|
+ throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
|
}
|
|
|
- param.setSnCode(username);
|
|
|
+ param.setCameraId(camera.getId());
|
|
|
JSONObject data = sceneProService.newList(param, null);
|
|
|
JSONObject pageInfo = data.getJSONObject("pageInfo");
|
|
|
pageInfo.put("sceneNum",pageInfo.getInteger("total"));
|