Merge branch 'server_five_fufanrui' of https://gitea.qinmian.online/five-groups/five-groups-couplet into server_five
commit
b3bc515135
|
@ -1,2 +1,2 @@
|
|||
com.couplet.remote.factory.RemoteVehicleFallbackFactory
|
||||
com.couplet.remote.factory.RemoteTroubleFallbackFactory
|
||||
com.couplet.remote.factory.RemoteVehicleFallbackFactory
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
<groupId>com.couplet</groupId>
|
||||
<artifactId>couplet-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.couplet</groupId>
|
||||
<artifactId>couplet-common-business</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.couplet.common.redis.service;
|
||||
|
||||
import com.couplet.common.domain.CoupletVehicleData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -19,6 +20,12 @@ public class RedisService {
|
|||
@Resource
|
||||
public RedisTemplate redisTemplate;
|
||||
|
||||
|
||||
public List<CoupletVehicleData> getList () {
|
||||
return redisTemplate.opsForList().range("coupletMsgData", 0, -1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 缓存基本的对象,Integer、String、实体类等
|
||||
*
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.couplet.common.core.domain.Result;
|
|||
import com.couplet.common.domain.CoupletVehicleData;
|
||||
import com.couplet.common.domain.Vehicle;
|
||||
import com.couplet.common.domain.request.RealTimeDataRequest;
|
||||
import com.couplet.common.redis.service.RedisService;
|
||||
import com.couplet.common.security.utils.SecurityUtils;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -31,6 +32,8 @@ public class VehicleDetectionController {
|
|||
private VehicleDetectionService vehicleDetectionService;
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
private final String REDIS_LIST_KEY = "coupletMsgData";
|
||||
/*
|
||||
* @param :
|
||||
|
@ -65,7 +68,11 @@ public class VehicleDetectionController {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("realData")
|
||||
public Result<List<CoupletVehicleData>> realData(){
|
||||
List<CoupletVehicleData> list = redisService.getList();
|
||||
Result<List<CoupletVehicleData>> success = Result.success(list);
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.couplet.business.server.service;
|
|||
import com.couplet.common.core.domain.Result;
|
||||
import com.couplet.common.core.web.page.TableDataInfo;
|
||||
import com.couplet.common.system.domain.SysUser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
Loading…
Reference in New Issue