|
@@ -207,11 +207,15 @@ public class CameraServiceImpl extends MPJBaseServiceImpl<ICameraMapper, Camera>
|
|
|
|
|
|
@Override
|
|
|
public Object getByUser(SceneParam param) {
|
|
|
- if(param.getUserId() == null && param.getType() == null){
|
|
|
+ if(StringUtils.isBlank(param.getUserName()) && param.getType() == null){
|
|
|
throw new BusinessException(ResultCode.PARAM_ERROR);
|
|
|
}
|
|
|
+ User user = userService.getByUserName(param.getUserName());
|
|
|
+ if(user == null){
|
|
|
+ throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
|
+ }
|
|
|
Integer cameraType = CameraTypeUtils.getCameraType(param.getType());
|
|
|
- List<CameraDetail> cameraDetails = cameraDetailService.getByUserIdAndType(param.getUserId(),cameraType);
|
|
|
+ List<CameraDetail> cameraDetails = cameraDetailService.getByUserIdAndType(user.getId(),cameraType);
|
|
|
if(cameraDetails.isEmpty()){
|
|
|
return null;
|
|
|
}
|