refactor: 修改框架
parent
2734077121
commit
f2463c9753
|
@ -301,8 +301,8 @@ public class RedisService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) {
|
public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) {
|
||||||
String key = "vin:"+realTimeDataRequest.getVin();
|
String key = "vin:" + realTimeDataRequest.getVin();
|
||||||
redisTemplate.opsForValue().set(key, realTimeDataRequest);
|
redisTemplate.opsForSet().add(key,realTimeDataRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopViewingData(String vin) {
|
public void stopViewingData(String vin) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static java.lang.Thread.sleep;
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ModelsKafkaMessage {
|
public class ModelsKafkaMessage {
|
||||||
private static final String TOPIC_NAME = "online";
|
private static final String TOPIC_NAME = "fufanrui";
|
||||||
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ public class ElectronicFenceServiceImpl implements IncidentService {
|
||||||
if (redisService.hasKey(fenceKey)) {
|
if (redisService.hasKey(fenceKey)) {
|
||||||
Set<Fence> cacheSet = redisService.getCacheSet(fenceKey);
|
Set<Fence> cacheSet = redisService.getCacheSet(fenceKey);
|
||||||
log.info("电子围栏事件redis存在.......");
|
log.info("电子围栏事件redis存在.......");
|
||||||
// jingdu;
|
//jingdu;
|
||||||
// longitude;
|
//longitude;
|
||||||
// weidu;
|
//weidu;
|
||||||
// latitude;
|
//latitude;
|
||||||
for (Fence fence : cacheSet) {
|
for (Fence fence : cacheSet) {
|
||||||
String fenceLongitudeLatitude = fence.getFenceLongitudeLatitude();
|
String fenceLongitudeLatitude = fence.getFenceLongitudeLatitude();
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,8 +21,11 @@ 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.lang.reflect.Array;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,10 +56,9 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
||||||
public List<CoupletMsgData> monitorinDataList(String vin) {
|
public List<CoupletMsgData> monitorinDataList(String vin) {
|
||||||
String key = "vin:query:" + vin;
|
String key = "vin:query:" + vin;
|
||||||
log.info("key为:"+key);
|
log.info("key为:"+key);
|
||||||
CoupletMsgData coupletMsgData = redisService.getCacheObject(key);
|
Set<CoupletMsgData> cacheSet = redisService.getCacheSet(key);
|
||||||
ArrayList<CoupletMsgData> coupletMsgDataArrayList = new ArrayList<>();
|
ArrayList<CoupletMsgData> coupletMsgData = new ArrayList<>(cacheSet);
|
||||||
coupletMsgDataArrayList.add(coupletMsgData);
|
return coupletMsgData;
|
||||||
return coupletMsgDataArrayList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class MqttMonitor {
|
||||||
|
|
||||||
|
|
||||||
//Kafka生产者配置
|
//Kafka生产者配置
|
||||||
private static final String TOPIC_NAME = "xiaoYao";
|
private static final String TOPIC_NAME = "fufanrui";
|
||||||
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
||||||
|
|
||||||
//线程池,用于异步处理消息到来时的业务逻辑
|
//线程池,用于异步处理消息到来时的业务逻辑
|
||||||
|
|
|
@ -36,7 +36,7 @@ mqtt:
|
||||||
# broker: mqtt://115.159.47.13:1883
|
# broker: mqtt://115.159.47.13:1883
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
clientId: xiaoYao
|
clientId: fufanrui44
|
||||||
qos: 0
|
qos: 0
|
||||||
topic: xiaoYao
|
topic: test898
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue