Merge branch 'server_five_fufanrui' of https://gitea.qinmian.online/five-groups/five-groups-couplet into server_five
# Conflicts: # couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.javaserver_five_liuyunhu
commit
de71107fe0
|
@ -304,9 +304,13 @@ public class RedisService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) {
|
public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) {
|
||||||
String key = "vin:"+realTimeDataRequest.getVin()+"userId:"+realTimeDataRequest.getUserId();
|
String key = "vin:"+realTimeDataRequest.getVin();
|
||||||
redisTemplate.opsForValue().set(key, realTimeDataRequest);
|
redisTemplate.opsForValue().set(key, realTimeDataRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopViewingData(String vin) {
|
||||||
|
|
||||||
|
String key = "vin:"+vin;
|
||||||
|
redisTemplate.delete(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,13 @@ public class VehicleDetectionController {
|
||||||
vehicleDetectionService.monitorinData(vin);
|
vehicleDetectionService.monitorinData(vin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param :
|
||||||
|
* @return Result<List<CoupletVehicleData>>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 查看事实数据列表
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
@PostMapping("realData")
|
@PostMapping("realData")
|
||||||
public Result<List<CoupletVehicleData>> realData(){
|
public Result<List<CoupletVehicleData>> realData(){
|
||||||
List<CoupletVehicleData> list = redisService.getList();
|
List<CoupletVehicleData> list = redisService.getList();
|
||||||
|
@ -68,4 +73,16 @@ public class VehicleDetectionController {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param vin:
|
||||||
|
* @return void
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 停止传送实时数据
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@PostMapping("stopViewingData/{vin}")
|
||||||
|
public void stopViewingData(@PathVariable String vin){
|
||||||
|
vehicleDetectionService.stopViewingData(vin);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,7 @@ public interface VehicleDetectionService {
|
||||||
List<Vehicle> detectionList();
|
List<Vehicle> detectionList();
|
||||||
|
|
||||||
void monitorinData(String vin);
|
void monitorinData(String vin);
|
||||||
|
|
||||||
|
|
||||||
|
void stopViewingData(String vin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,9 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopViewingData(String vin) {
|
||||||
|
redisService.stopViewingData(vin);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue