fix: 调用 pcap-common 接口时添加 url,id 参数项
This commit is contained in:
@@ -13,6 +13,6 @@ public interface PcapCommentClient {
|
|||||||
|
|
||||||
@RequestLine("POST /api/v1/pcap/comment")
|
@RequestLine("POST /api/v1/pcap/comment")
|
||||||
@Headers("Content-Type: multipart/form-data")
|
@Headers("Content-Type: multipart/form-data")
|
||||||
Response addCommon(@Param("file") File file);
|
Response addCommon(@Param("file") File file, @Param("url") String url, @Param("id") String pcapId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -91,6 +91,9 @@ public class PcapServiceImpl extends ServiceImpl<PcapDao, PcapEntity> implements
|
|||||||
@jakarta.annotation.Resource
|
@jakarta.annotation.Resource
|
||||||
private KibanaClient kibanaClient;
|
private KibanaClient kibanaClient;
|
||||||
|
|
||||||
|
@Value("${controller.url:http://127.0.0.1}")
|
||||||
|
private String aswControllerUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PcapEntity queryInfo(String id) {
|
public PcapEntity queryInfo(String id) {
|
||||||
PcapEntity pcap = this.getById(id);
|
PcapEntity pcap = this.getById(id);
|
||||||
@@ -212,6 +215,7 @@ public class PcapServiceImpl extends ServiceImpl<PcapDao, PcapEntity> implements
|
|||||||
// parse thread config properties
|
// parse thread config properties
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.setProperty("sharkdApiHostAddr", this.sharkdApiHostAddr);
|
properties.setProperty("sharkdApiHostAddr", this.sharkdApiHostAddr);
|
||||||
|
properties.setProperty("aswControllerUrl", this.aswControllerUrl);
|
||||||
|
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
PcapEntity pcapEntity = this.getById(id);
|
PcapEntity pcapEntity = this.getById(id);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class PcapParserThread implements Runnable {
|
|||||||
*/
|
*/
|
||||||
private void addCommonToPcap() throws IOException {
|
private void addCommonToPcap() throws IOException {
|
||||||
// pcap common
|
// pcap common
|
||||||
Response response = pcapCommentClient.addCommon(T.FileUtil.file(pcapEntity.getPath()));
|
Response response = pcapCommentClient.addCommon(T.FileUtil.file(pcapEntity.getPath()), properties.getProperty("aswControllerUrl"), pcapEntity.getId());
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("[addCommonToPcap] [response: {}]", null != response ? response.status() : RCode.ERROR.getCode());
|
log.debug("[addCommonToPcap] [response: {}]", null != response ? response.status() : RCode.ERROR.getCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user