fufanruiCommit
parent
366d97e8d2
commit
e270770029
|
@ -280,4 +280,10 @@ public class RedisService {
|
||||||
String key = "vin:"+realTimeDataRequest.getVin()+"userId:"+realTimeDataRequest.getUserId();
|
String key = "vin:"+realTimeDataRequest.getVin()+"userId:"+realTimeDataRequest.getUserId();
|
||||||
redisTemplate.opsForValue().set(key, realTimeDataRequest);
|
redisTemplate.opsForValue().set(key, realTimeDataRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopViewingData(Long userId,String vin) {
|
||||||
|
|
||||||
|
String key = "vin:"+vin+"userId:"+userId;
|
||||||
|
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,10 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopViewingData(String vin) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
redisService.stopViewingData(userId,vin);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue