refactor: 修改框架
parent
0c1cfb8f28
commit
ad5626f0af
|
@ -17,11 +17,9 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -108,7 +108,7 @@ public class ModelMessage {
|
|||
});
|
||||
mqttClient.subscribe("test",0);
|
||||
|
||||
Thread.sleep(1000*60*10);
|
||||
Thread.sleep(1000*6*10);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
//package com.couplet.analyze.msg.service.impl;
|
||||
//
|
||||
//import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
//import com.couplet.analyze.msg.service.IncidentService;
|
||||
//import com.couplet.common.log.annotation.Log;
|
||||
//import lombok.extern.log4j.Log4j2;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
///**
|
||||
// * @Author: LiJiaYao
|
||||
// * @Date: 2024/4/2
|
||||
// * @Description: 故障事件
|
||||
// */
|
||||
//@Service("breakdown")
|
||||
//@Log4j2
|
||||
//public class BreakdownServiceImpl implements IncidentService {
|
||||
// /**
|
||||
// * 故障事件
|
||||
// *
|
||||
// * @param coupletMsgData
|
||||
// */
|
||||
// @Override
|
||||
// public void incident(CoupletMsgData coupletMsgData) {
|
||||
//
|
||||
// log.info("故障事件开始.....");
|
||||
// log.info("故障事件结束.....");
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @return 获取事件名称
|
||||
// */
|
||||
// @Override
|
||||
// public String getName() {
|
||||
// return "breakdown";
|
||||
// }
|
||||
//}
|
||||
package com.couplet.analyze.msg.service.impl;
|
||||
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.analyze.msg.service.IncidentService;
|
||||
import com.couplet.common.log.annotation.Log;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: LiJiaYao
|
||||
* @Date: 2024/4/2
|
||||
* @Description: 故障事件
|
||||
*/
|
||||
@Service("breakdown")
|
||||
@Log4j2
|
||||
public class BreakdownServiceImpl implements IncidentService {
|
||||
/**
|
||||
* 故障事件
|
||||
*
|
||||
* @param coupletMsgData
|
||||
*/
|
||||
@Override
|
||||
public void incident(CoupletMsgData coupletMsgData) {
|
||||
|
||||
log.info("故障事件开始.....");
|
||||
log.info("故障事件结束.....");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 获取事件名称
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "breakdown";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,40 @@
|
|||
//package com.couplet.analyze.msg.service.impl;
|
||||
//
|
||||
//import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
//import com.couplet.analyze.msg.service.IncidentService;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
///**
|
||||
// * @Author: LiJiaYao
|
||||
// * @Date: 2024/4/2
|
||||
// * @Description: 电子围栏事件服务实现类
|
||||
// */
|
||||
//@Service("electronic-fence")
|
||||
//public class ElectronicFenceServiceImpl implements IncidentService {
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 电子围栏事件
|
||||
// *
|
||||
// * @param coupletMsgData
|
||||
// */
|
||||
// @Override
|
||||
// public void incident(CoupletMsgData coupletMsgData) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @return 电子围栏service 名称
|
||||
// */
|
||||
// @Override
|
||||
// public String getName() {
|
||||
// return "electronic-fence";
|
||||
// }
|
||||
//}
|
||||
package com.couplet.analyze.msg.service.impl;
|
||||
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.analyze.msg.service.IncidentService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: LiJiaYao
|
||||
* @Date: 2024/4/2
|
||||
* @Description: 电子围栏事件服务实现类
|
||||
*/
|
||||
@Service("electronic-fence")
|
||||
@Log4j2
|
||||
public class ElectronicFenceServiceImpl implements IncidentService {
|
||||
|
||||
|
||||
/**
|
||||
* 电子围栏事件
|
||||
*
|
||||
* @param coupletMsgData
|
||||
*/
|
||||
@Override
|
||||
public void incident(CoupletMsgData coupletMsgData) {
|
||||
|
||||
log.info("电子围栏事件开始.......");
|
||||
log.info("电子围栏事件结束.......");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 电子围栏service 名称
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "electronic-fence";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,38 @@
|
|||
//package com.couplet.analyze.msg.service.impl;
|
||||
//
|
||||
//import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
//import com.couplet.analyze.msg.service.IncidentService;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
///**
|
||||
// * @Author: LiJiaYao
|
||||
// * @Date: 2024/4/2
|
||||
// * @Description: 实时数据事件
|
||||
// */
|
||||
//@Service("real-time-data")
|
||||
//public class RealTimeDataServiceImpl implements IncidentService {
|
||||
//
|
||||
// /**
|
||||
// * 实时数据事件
|
||||
// *
|
||||
// * @param coupletMsgData
|
||||
// */
|
||||
// @Override
|
||||
// public void incident(CoupletMsgData coupletMsgData) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 实时数据事件
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public String getName() {
|
||||
// return "real-time-data";
|
||||
// }
|
||||
//}
|
||||
package com.couplet.analyze.msg.service.impl;
|
||||
|
||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.analyze.msg.service.IncidentService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: LiJiaYao
|
||||
* @Date: 2024/4/2
|
||||
* @Description: 实时数据事件
|
||||
*/
|
||||
@Service("real-time-data")
|
||||
@Log4j2
|
||||
public class RealTimeDataServiceImpl implements IncidentService {
|
||||
|
||||
/**
|
||||
* 实时数据事件
|
||||
*
|
||||
* @param coupletMsgData
|
||||
*/
|
||||
@Override
|
||||
public void incident(CoupletMsgData coupletMsgData) {
|
||||
|
||||
log.info("实时数据事件开始.....");
|
||||
log.info("实时数据事件结束.....");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时数据事件
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "real-time-data";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
com.couplet.analyze.msg.config.RabbitMQConfig
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
<insert id="reportMapper">
|
||||
INSERT INTO `vehicle-resolver`.`resolver_report_data`
|
||||
INSERT INTO `couplet-cloud`.`couplet_msg_data`
|
||||
(`vin`, `create_time`, `longitude`, `latitude`,
|
||||
`speed`, `mileage`, `voltage`, `current`, `resistance`, `gear`,
|
||||
`acceleration_pedal`, `fuel_consumption_rate`,
|
||||
|
|
|
@ -16,11 +16,9 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue