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.java
server_five_liuyunhu
lijiayao 2024-04-08 11:27:14 +08:00
commit de71107fe0
4 changed files with 32 additions and 3 deletions

View File

@ -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);
}
} }

View File

@ -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);
}
} }

View File

@ -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);
} }

View File

@ -47,4 +47,9 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
} }
@Override
public void stopViewingData(String vin) {
redisService.stopViewingData(vin);
}
} }