Compare commits

...

2 Commits

Author SHA1 Message Date
ffr 31e78c3c3c Merge branch 'server_five' of https://gitea.qinmian.online/five-groups/five-groups-couplet into server_five_fufanrui
# Conflicts:
#	couplet-modules/couplet-business/pom.xml
#	couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java
#	couplet-modules/couplet-business/src/main/resources/bootstrap.yml
#	couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml
2024-04-08 21:55:12 +08:00
ffr 4488018bce commit upd ffr 2024-04-08 21:53:13 +08:00
15 changed files with 55 additions and 15 deletions

View File

@ -17,9 +17,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -33,5 +33,6 @@
<artifactId>couplet-common-business</artifactId> <artifactId>couplet-common-business</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -23,9 +23,6 @@ public class RedisService {
public RedisTemplate redisTemplate; 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) { public void stopViewingData(String vin) {
String key = "vin:"+vin; String key = "vin:"+vin;
redisTemplate.delete(key); redisTemplate.delete(key);
} }
} }

View File

@ -15,9 +15,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -15,14 +15,17 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
shared-configs: shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
rabbitmq: rabbitmq:

View File

@ -110,6 +110,10 @@
<groupId>com.couplet</groupId> <groupId>com.couplet</groupId>
<artifactId>couplet-common-event</artifactId> <artifactId>couplet-common-event</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.couplet</groupId>
<artifactId>couplet-analyze-msg</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,5 +1,6 @@
package com.couplet.business.server.controller; package com.couplet.business.server.controller;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.business.server.service.VehicleDetectionService; import com.couplet.business.server.service.VehicleDetectionService;
import com.couplet.common.core.domain.Result; import com.couplet.common.core.domain.Result;
import com.couplet.common.domain.CoupletVehicleData; import com.couplet.common.domain.CoupletVehicleData;
@ -58,7 +59,6 @@ public class VehicleDetectionController {
public void monitorinData(@PathVariable String vin){ public void monitorinData(@PathVariable String vin){
vehicleDetectionService.monitorinData(vin); vehicleDetectionService.monitorinData(vin);
} }
/* /*
* @param : * @param :
* @return Result<List<CoupletVehicleData>> * @return Result<List<CoupletVehicleData>>
@ -66,13 +66,14 @@ public class VehicleDetectionController {
* @description * @description
* @date * @date
*/ */
@PostMapping("realData") @PostMapping("/monitorinDataList/{vin}")
public Result<List<CoupletVehicleData>> realData(){ public Result<List<CoupletMsgData>> monitorinDataList(@PathVariable String vin){
List<CoupletVehicleData> list = redisService.getList(); List<CoupletMsgData> monitorinDataList = vehicleDetectionService.monitorinDataList(vin);
Result<List<CoupletVehicleData>> success = Result.success(list); Result<List<CoupletMsgData>> success = Result.success(monitorinDataList);
return success; return success;
} }
/* /*
* @param vin: * @param vin:
* @return void * @return void

View File

@ -1,6 +1,8 @@
package com.couplet.business.server.service; package com.couplet.business.server.service;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.common.core.domain.Result; import com.couplet.common.core.domain.Result;
import com.couplet.common.domain.CoupletVehicleData;
import com.couplet.common.domain.Vehicle; import com.couplet.common.domain.Vehicle;
import java.util.List; import java.util.List;
@ -9,8 +11,9 @@ public interface VehicleDetectionService {
List<Vehicle> detectionList(); List<Vehicle> detectionList();
void monitorinData(String vin);
void stopViewingData(String vin); void stopViewingData(String vin);
List<CoupletMsgData> monitorinDataList(String vin);
void monitorinData(String vin);
} }

View File

@ -2,11 +2,13 @@ package com.couplet.business.server.service.impl;
import afu.org.checkerframework.checker.units.qual.A; import afu.org.checkerframework.checker.units.qual.A;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.analyze.common.event.AnalyzeEventCache; import com.couplet.analyze.common.event.AnalyzeEventCache;
import com.couplet.business.server.mapper.VehicleDetectionMapper; import com.couplet.business.server.mapper.VehicleDetectionMapper;
import com.couplet.business.server.service.VehicleDetectionService; import com.couplet.business.server.service.VehicleDetectionService;
import com.couplet.business.server.service.VehicleManageService; import com.couplet.business.server.service.VehicleManageService;
import com.couplet.common.core.domain.Result; import com.couplet.common.core.domain.Result;
import com.couplet.common.domain.CoupletVehicleData;
import com.couplet.common.domain.Vehicle; import com.couplet.common.domain.Vehicle;
import com.couplet.common.domain.request.RealTimeDataRequest; import com.couplet.common.domain.request.RealTimeDataRequest;
import com.couplet.common.redis.service.RedisService; 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.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.mysql.cj.xdevapi.JsonString; import com.mysql.cj.xdevapi.JsonString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import springfox.documentation.spring.web.json.Json; import springfox.documentation.spring.web.json.Json;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -28,6 +32,7 @@ import java.util.concurrent.TimeUnit;
* @date 2024/4/4 10:23 * @date 2024/4/4 10:23
*/ */
@Service @Service
@Slf4j
public class VehicleDetectionServiceImpl implements VehicleDetectionService{ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
@Autowired @Autowired
@ -44,6 +49,16 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
return vehicles; 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 @Override
public void monitorinData(String vin) { public void monitorinData(String vin) {
RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest(); RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest();
@ -60,4 +75,5 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
redisService.stopViewingData(vin); redisService.stopViewingData(vin);
} }
} }

View File

@ -16,9 +16,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -15,9 +15,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -17,9 +17,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -15,9 +15,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -15,9 +15,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
@ -46,6 +48,7 @@ logging:
# RabbitMQ配置 # RabbitMQ配置
mq: mq:
queueName: queue queueName: queue
VinQueueName: vinQueueName
exchangeName: exchange exchangeName: exchange
routingKey: routingKey routingKey: routingKey

View File

@ -15,11 +15,11 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 121.89.211.230:8848 server-addr: 121.89.211.230:8848
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置