Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package com.realtime.protection.configuration.entity.rule.dynamicrule;
|
||||
|
||||
public class DynamicRuleObject {
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.realtime.protection.configuration.entity.rule.staticrule;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class StaticRuleObject {
|
||||
@JsonProperty("static_rule_id")
|
||||
private int staticRuleId;
|
||||
|
||||
@NotNull
|
||||
@JsonProperty("static_rule_name")
|
||||
private String staticRuleName;
|
||||
|
||||
private LocalDateTime staticRuleCreateTime;
|
||||
private String StaticRuleCreateUsername;
|
||||
private int StaticRuleAuditStatus;
|
||||
private String StaticRuleCreateDepart;
|
||||
private int StaticRuleCreateUserId;
|
||||
private String StaticRuleSip;
|
||||
private String StaticRuleMsip;
|
||||
private int StaticRuleSport;
|
||||
private int StaticRuleMsport;
|
||||
private String StaticRuleDip;
|
||||
private String StaticRuleMdip;
|
||||
private int StaticRuleDport;
|
||||
private int StaticRuleMdport;
|
||||
private String StaticRuleProtocol;
|
||||
private String StaticRuleMprotocol;
|
||||
private String StaticRuleDns;
|
||||
private String StaticRuleURL;
|
||||
private int StaticRulePriority;
|
||||
private String StaticRuleRange;
|
||||
private int StaticRuleFrequency;
|
||||
private int StaticRuleProtectLevel;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.realtime.protection.server.rule.staticrule;
|
||||
|
||||
|
||||
import com.realtime.protection.configuration.entity.rule.staticrule.StaticRuleObject;
|
||||
import com.realtime.protection.configuration.response.ResponseResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/staticrule")
|
||||
public class StaticRuleController {
|
||||
|
||||
@Autowired
|
||||
private StaticRuleService staticRuleService;
|
||||
|
||||
/**
|
||||
* 新增静态规则
|
||||
*/
|
||||
@RequestMapping("/new")
|
||||
public ResponseResult newStaticRuleObject(@RequestBody StaticRuleObject object){
|
||||
// log.info("新增部门: {}" , dept);
|
||||
//调用service新增
|
||||
staticRuleService.newStaticRuleObject(object);
|
||||
return ResponseResult.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.realtime.protection.server.rule.staticrule;
|
||||
|
||||
import com.realtime.protection.configuration.entity.rule.staticrule.StaticRuleObject;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface StaticRuleMapper {
|
||||
Integer newStaticRuleObject(@Param("object") StaticRuleObject object);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.realtime.protection.server.rule.staticrule;
|
||||
|
||||
import com.realtime.protection.configuration.entity.rule.staticrule.StaticRuleObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Service
|
||||
public class StaticRuleService {
|
||||
@Autowired
|
||||
private StaticRuleMapper staticRuleMapper;
|
||||
|
||||
|
||||
/*
|
||||
新建静态规则
|
||||
*/
|
||||
public Integer newStaticRuleObject(StaticRuleObject object) {
|
||||
|
||||
object.setStaticRuleCreateTime(LocalDateTime.now());
|
||||
object.setStaticRuleAuditStatus(0);
|
||||
/*
|
||||
待开发:设置静态规则对象的创建用户、用户所属部门等属性
|
||||
*/
|
||||
|
||||
staticRuleMapper.newStaticRuleObject(object);
|
||||
|
||||
return object.getStaticRuleId();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user