From 4101e76188128c8828de16e3878cc54cb9b96fa5 Mon Sep 17 00:00:00 2001 From: liuyunhu <3286117488@qq.com> Date: Tue, 9 Apr 2024 11:34:58 +0800 Subject: [PATCH 1/2] huhuhu --- couplet-auth/src/main/resources/bootstrap.yml | 4 ++-- couplet-gateway/src/main/resources/bootstrap.yml | 4 ++-- .../analyze/msg/model/ModelsKafkaMessage.java | 4 ++-- .../src/main/resources/bootstrap.yml | 12 ++++++------ .../business/server/CoupletBusinessApplication.java | 2 +- .../server/service/impl/VehicleServiceImpl.java | 4 ++-- .../src/main/resources/bootstrap.yml | 4 ++-- .../couplet-file/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-gen/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-job/src/main/resources/bootstrap.yml | 4 ++-- .../src/main/resources/bootstrap.yml | 4 ++-- .../java/com/couplet/online/utils/MqttMonitor.java | 2 +- .../src/main/resources/bootstrap.yml | 6 ++++-- .../couplet-system/src/main/resources/bootstrap.yml | 2 ++ .../couplet-monitor/src/main/resources/bootstrap.yml | 4 ++-- 15 files changed, 34 insertions(+), 30 deletions(-) diff --git a/couplet-auth/src/main/resources/bootstrap.yml b/couplet-auth/src/main/resources/bootstrap.yml index b89bb00..68c3c25 100644 --- a/couplet-auth/src/main/resources/bootstrap.yml +++ b/couplet-auth/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-gateway/src/main/resources/bootstrap.yml b/couplet-gateway/src/main/resources/bootstrap.yml index acd4642..6dc39fe 100644 --- a/couplet-gateway/src/main/resources/bootstrap.yml +++ b/couplet-gateway/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java index 429becb..4929831 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java @@ -36,7 +36,7 @@ import static java.lang.Thread.sleep; @Component @Slf4j public class ModelsKafkaMessage { - private static final String TOPIC_NAME = "online"; + private static final String TOPIC_NAME = "lyh"; private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092"; @@ -59,7 +59,7 @@ public class ModelsKafkaMessage { Properties props = new Properties(); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS); // props.put(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group"); - props.put(ConsumerConfig.GROUP_ID_CONFIG, "ddd"); + props.put(ConsumerConfig.GROUP_ID_CONFIG, "lll"); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer"); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer"); diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml index b36b039..ac437ce 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 @@ -53,7 +53,7 @@ mybatis-plus: map-underscore-to-camel-case: true # RabbitMQ配置 -mq: - queueName: queue - exchangeName: exchange - routingKey: routingKey +#mq: +# queueName: queue +# exchangeName: exchange +# routingKey: routingKey diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java index 2ef9e84..4333fca 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java @@ -17,7 +17,7 @@ import org.springframework.stereotype.Component; @EnableCustomConfig @EnableCustomSwagger2 @EnableMyFeignClients(basePackages = ("com.couplet")) -@SpringBootApplication(scanBasePackages = {"com.couplet", "com.couplet.mq.remote"}) +@SpringBootApplication(scanBasePackages = {"com.couplet"}) @EnableScheduling public class CoupletBusinessApplication { public static void main(String[] args) { diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java index e0bfe47..6b95720 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java @@ -427,7 +427,7 @@ public class VehicleServiceImpl extends ServiceImpl impl logos.add(logoId); //存入redis redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos); - redis.expire("车辆vin和标识:" + vehicle.getVin(), 2, TimeUnit.MINUTES); + redis.expire("车辆vin和标识:" + vehicle.getVin(), 5, TimeUnit.MINUTES); //通过标识id获取标识绑定的电子围栏集合 @@ -438,7 +438,7 @@ public class VehicleServiceImpl extends ServiceImpl impl fanceSet.add(fence); //存入redis redis.setCacheSet("车辆vin和电子围栏:" + vehicle.getVin(), fanceSet); - redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 2, TimeUnit.MINUTES); + redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 5, TimeUnit.MINUTES); }); }); }); diff --git a/couplet-modules/couplet-business/src/main/resources/bootstrap.yml b/couplet-modules/couplet-business/src/main/resources/bootstrap.yml index ff5fb2c..b88e464 100644 --- a/couplet-modules/couplet-business/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-business/src/main/resources/bootstrap.yml @@ -16,11 +16,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml index 8681657..b0d1d24 100644 --- a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml index fa5dcb3..d2113ff 100644 --- a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml index 108c695..41d1fef 100644 --- a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml b/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml index 8220b33..1de6dd7 100644 --- a/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java b/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java index 6f4bfc9..81ef1a9 100644 --- a/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java +++ b/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java @@ -76,7 +76,7 @@ public class MqttMonitor { //Kafka生产者配置 - private static final String TOPIC_NAME = "online"; + private static final String TOPIC_NAME = "lyh"; private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092"; //线程池,用于异步处理消息到来时的业务逻辑 diff --git a/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml b/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml index fc1f9a1..2d20009 100644 --- a/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml @@ -15,9 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 @@ -36,7 +38,7 @@ mqtt: # broker: mqtt://115.159.47.13:1883 username: password: - clientId: xiaoYao + clientId: liuyunhu qos: 0 - topic: xiaoYao + topic: liuyunhu diff --git a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml index d9315bd..91453d0 100644 --- a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml @@ -15,9 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml index 94d42fc..d219500 100644 --- a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml +++ b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 From f9ce3da77e828714c924ceae52f938c949c71cb7 Mon Sep 17 00:00:00 2001 From: liuyunhu <3286117488@qq.com> Date: Tue, 9 Apr 2024 15:17:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=99=8E=E8=99=8E=E8=99=8E=E4=BC=98?= =?UTF-8?q?=E5=8C=96set=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/service/impl/VehicleServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java index 6b95720..952b9d1 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java @@ -423,11 +423,12 @@ public class VehicleServiceImpl extends ServiceImpl impl bindLogoById.forEach(logoId -> { //存标识id 的set - HashSet logos = new HashSet<>(); - logos.add(logoId); - //存入redis - redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos); - redis.expire("车辆vin和标识:" + vehicle.getVin(), 5, TimeUnit.MINUTES); +// HashSet logos = new HashSet<>(); +// logos.add(logoId); +// //存入redis +// redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos); + +// redis.expire("车辆vin和标识:" + vehicle.getVin(), 5, TimeUnit.MINUTES); //通过标识id获取标识绑定的电子围栏集合 @@ -438,7 +439,7 @@ public class VehicleServiceImpl extends ServiceImpl impl fanceSet.add(fence); //存入redis redis.setCacheSet("车辆vin和电子围栏:" + vehicle.getVin(), fanceSet); - redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 5, TimeUnit.MINUTES); +// redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 5, TimeUnit.MINUTES); }); }); });