2、AlertMessage对象增加dynamicRuleId属性。需要发送时也携带dynamicRuleId字段 3、AlertMessageService添加获取dynamicRule对应的template,并根据template对AlertMessage中的FiveTupleWithMask进行筛选策略模板所需字段;添加生成TaskCommandInfo入Doris库 4、TaskCommandInfo新增templateId、protectLevel属性,方便AlertMessageService中查询任务的策略模板 5、前端响应字段的bug修复
29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
package com.realtime.protection.server.alertmessage;
|
|
|
|
import com.realtime.protection.configuration.entity.rule.dynamicrule.AlertMessage;
|
|
import com.realtime.protection.configuration.response.ResponseResult;
|
|
import jakarta.validation.Valid;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
@RequestMapping("alertmessage")
|
|
@Slf4j
|
|
public class AlertMessageController
|
|
{
|
|
private final AlertMessageService alertMessageService;
|
|
public AlertMessageController(final AlertMessageService alertMessageService) {
|
|
this.alertMessageService = alertMessageService;
|
|
}
|
|
|
|
@PostMapping("/new")
|
|
public ResponseResult receiveAlertMessage(@RequestBody @Valid AlertMessage alertMessage){
|
|
alertMessageService.processAlertMessage(alertMessage);
|
|
return ResponseResult.ok();
|
|
}
|
|
|
|
}
|