Compare commits
2 Commits
bcb03022d1
...
31e78c3c3c
Author | SHA1 | Date |
---|---|---|
|
31e78c3c3c | |
|
4488018bce |
|
@ -17,9 +17,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -33,5 +33,6 @@
|
|||
<artifactId>couplet-common-business</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -23,9 +23,6 @@ public class RedisService {
|
|||
public RedisTemplate redisTemplate;
|
||||
|
||||
|
||||
public List<CoupletVehicleData> getList () {
|
||||
return redisTemplate.opsForList().range("coupletMsgData", 0, -1);
|
||||
}
|
||||
|
||||
// ... 其他已有方法 ...
|
||||
|
||||
|
@ -309,8 +306,8 @@ public class RedisService {
|
|||
}
|
||||
|
||||
public void stopViewingData(String vin) {
|
||||
|
||||
String key = "vin:"+vin;
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,14 +15,17 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
rabbitmq:
|
||||
|
|
|
@ -110,6 +110,10 @@
|
|||
<groupId>com.couplet</groupId>
|
||||
<artifactId>couplet-common-event</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.couplet</groupId>
|
||||
<artifactId>couplet-analyze-msg</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.couplet.business.server.controller;
|
||||
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.business.server.service.VehicleDetectionService;
|
||||
import com.couplet.common.core.domain.Result;
|
||||
import com.couplet.common.domain.CoupletVehicleData;
|
||||
|
@ -58,7 +59,6 @@ public class VehicleDetectionController {
|
|||
public void monitorinData(@PathVariable String vin){
|
||||
vehicleDetectionService.monitorinData(vin);
|
||||
}
|
||||
|
||||
/*
|
||||
* @param :
|
||||
* @return Result<List<CoupletVehicleData>>
|
||||
|
@ -66,13 +66,14 @@ public class VehicleDetectionController {
|
|||
* @description 查看事实数据列表
|
||||
* @date
|
||||
*/
|
||||
@PostMapping("realData")
|
||||
public Result<List<CoupletVehicleData>> realData(){
|
||||
List<CoupletVehicleData> list = redisService.getList();
|
||||
Result<List<CoupletVehicleData>> success = Result.success(list);
|
||||
@PostMapping("/monitorinDataList/{vin}")
|
||||
public Result<List<CoupletMsgData>> monitorinDataList(@PathVariable String vin){
|
||||
List<CoupletMsgData> monitorinDataList = vehicleDetectionService.monitorinDataList(vin);
|
||||
Result<List<CoupletMsgData>> success = Result.success(monitorinDataList);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @param vin:
|
||||
* @return void
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.couplet.business.server.service;
|
||||
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.common.core.domain.Result;
|
||||
import com.couplet.common.domain.CoupletVehicleData;
|
||||
import com.couplet.common.domain.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -9,8 +11,9 @@ public interface VehicleDetectionService {
|
|||
|
||||
List<Vehicle> detectionList();
|
||||
|
||||
void monitorinData(String vin);
|
||||
|
||||
|
||||
void stopViewingData(String vin);
|
||||
|
||||
List<CoupletMsgData> monitorinDataList(String vin);
|
||||
|
||||
void monitorinData(String vin);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,13 @@ package com.couplet.business.server.service.impl;
|
|||
|
||||
import afu.org.checkerframework.checker.units.qual.A;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.analyze.common.event.AnalyzeEventCache;
|
||||
import com.couplet.business.server.mapper.VehicleDetectionMapper;
|
||||
import com.couplet.business.server.service.VehicleDetectionService;
|
||||
import com.couplet.business.server.service.VehicleManageService;
|
||||
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;
|
||||
|
@ -14,10 +16,12 @@ import com.couplet.common.security.utils.SecurityUtils;
|
|||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.mysql.cj.xdevapi.JsonString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import springfox.documentation.spring.web.json.Json;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -28,6 +32,7 @@ import java.util.concurrent.TimeUnit;
|
|||
* @date 2024/4/4 10:23
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
||||
|
||||
@Autowired
|
||||
|
@ -44,6 +49,16 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
|||
return vehicles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CoupletMsgData> monitorinDataList(String vin) {
|
||||
String key = "vin:query:" + vin;
|
||||
log.info("key为:"+key);
|
||||
CoupletMsgData coupletMsgData = redisService.getCacheObject(key);
|
||||
ArrayList<CoupletMsgData> coupletMsgDataArrayList = new ArrayList<>();
|
||||
coupletMsgDataArrayList.add(coupletMsgData);
|
||||
return coupletMsgDataArrayList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorinData(String vin) {
|
||||
RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest();
|
||||
|
@ -60,4 +75,5 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
|||
redisService.stopViewingData(vin);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,9 +16,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -17,9 +17,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -46,6 +48,7 @@ logging:
|
|||
# RabbitMQ配置
|
||||
mq:
|
||||
queueName: queue
|
||||
VinQueueName: vinQueueName
|
||||
exchangeName: exchange
|
||||
routingKey: routingKey
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue