蜜雪冰城三个视频墙

chengdu-mixuebingcheng
yiming 3 years ago
parent f51a058865
commit 4cbc3a719f

@ -40,6 +40,27 @@ public class RealTimeController {
return Result.success(cameraService.allCameras());
}
@GetMapping("/allCameras1")
@ApiOperation(value = "全部球机1")
//@SessionHandler
public Result<List<Camera>> allCameras1() {
return Result.success(cameraService.allCameras1());
}
@GetMapping("/allCameras2")
@ApiOperation(value = "全部球机2")
//@SessionHandler
public Result<List<Camera>> allCameras2() {
return Result.success(cameraService.allCameras2());
}
@GetMapping("/allCameras3")
@ApiOperation(value = "全部球机3")
//@SessionHandler
public Result<List<Camera>> allCameras3() {
return Result.success(cameraService.allCameras3());
}
@GetMapping("/wallStyle")
@ApiOperation(value = "视频墙样式")
//@SessionHandler

@ -36,6 +36,7 @@ import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;
@Service
@Slf4j
@ -160,9 +161,44 @@ public class CameraService {
}
public List<Camera> allCameras(){
return cameraMapper.selectByMap(new HashMap<>());
}
/**
* HD01 - HD05
* @return
*/
public List<Camera> allCameras1(){
List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>());
return cameras.stream().filter(camera -> {
int index = Integer.valueOf(camera.getName().substring(2, 4));
boolean b = index >= 1 && index <= 5;
return b;
}).collect(Collectors.toList());
}
public List<Camera> allCameras2(){
List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>());
return cameras.stream().filter(camera -> {
int index = Integer.valueOf(camera.getName().substring(2, 4));
boolean b = index >= 6 && index <= 10;
return b;
}).collect(Collectors.toList());
}
public List<Camera> allCameras3(){
List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>());
return cameras.stream().filter(camera -> {
int index = Integer.valueOf(camera.getName().substring(2, 4));
boolean b = index >= 11 && index <= 15;
return b;
}).collect(Collectors.toList());
}
/**
* IO
*

Loading…
Cancel
Save