推送给林火

This commit is contained in:
liuchengqian 2023-01-05 11:27:02 +08:00
parent bdfc4a7bea
commit 4e37081075

View File

@ -1,5 +1,6 @@
package com.xkrs.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.*;
import com.xkrs.model.entity.*;
@ -121,6 +122,7 @@ public class FirePointServiceImpl implements FirePointService {
}
log.info("-------发现新火点");
firePointDao.save(firePointEntity);
forwardPoint(firePointEntity);
//发送消息通知
sendBroadcast(firePointEntity);
return true;
@ -140,6 +142,15 @@ public class FirePointServiceImpl implements FirePointService {
// }
}
private void forwardPoint(FirePointEntity firePointEntity) {
try {
String url = "http://121.36.229.60:6811/insertfirepointchannelThree";
HttpClientUtils.sendHttpPostTextPlain(url, new ObjectMapper().writeValueAsString(firePointEntity));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 检查重复数据
*