|
@@ -8,6 +8,7 @@ import com.sooka.sponest.mobile.remoteapi.RemoteMonitorBaseService;
|
|
|
import com.sooka.sponest.mobile.remoteapi.RemoteSystemBaseService;
|
|
|
import com.sooka.sponest.mobile.system.camera.domain.*;
|
|
|
import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
+import com.sooka.sponest.mobile.utils.PictureReplaceAll;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -262,16 +263,35 @@ public class AppCameraController extends AppBaseController {
|
|
|
*/
|
|
|
@GetMapping("/getCameraById")
|
|
|
public AjaxResult getCameraByCameraId(@RequestParam("id") String id, @RequestParam("type") String type){
|
|
|
+ AjaxResult result;
|
|
|
if("1".equals(type)){
|
|
|
- return remoteMonitorBaseService.selectByCameraId(id);
|
|
|
+ result = remoteMonitorBaseService.selectByCameraId(id);
|
|
|
}else if("2".equals(type)){
|
|
|
- return remoteMonitorBaseService.selectByDeviceId(id);
|
|
|
+ result = remoteMonitorBaseService.selectByDeviceId(id);
|
|
|
}else if("3".equals(type)){
|
|
|
- return remoteMonitorBaseService.selectByBroadcastId(id);
|
|
|
+ result = remoteMonitorBaseService.selectByBroadcastId(id);
|
|
|
}else{
|
|
|
return AjaxResult.error("Request type is not found!");
|
|
|
}
|
|
|
|
|
|
+ if("200".equals(result.get("code").toString())){
|
|
|
+ StringBuilder urlType = new StringBuilder();
|
|
|
+ Map<String, Object> data = (Map<String, Object>) result.get("data");
|
|
|
+ if("1".equals(type)){
|
|
|
+ urlType.append("cameraImagesList");
|
|
|
+ }else if("2".equals(type)){
|
|
|
+ urlType.append("deviceImagesList");
|
|
|
+ }else if("3".equals(type)){
|
|
|
+ urlType.append("broadcastImagesList");
|
|
|
+ }
|
|
|
+ List<LinkedHashMap<String, Object>> dataList = (List<LinkedHashMap<String, Object>>) data.get(urlType.toString());
|
|
|
+ PictureReplaceAll.replaceAllPictureUrl(dataList, "url");
|
|
|
+ data.put(urlType.toString(),dataList);
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ }else{
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|