1. 完成新建任务功能,但是未完成静态关键信息功能和动态关键信息功能的关联,需要相关人员沟通

2. 完成新建配置模板功能
3. 修改configuration文件夹中全局异常处理器,添加了几种专门处理数据库异常和Valid异常的处理器。
4. 修改application.yml文件,将hikari自动提交设置为false,此项设置可用于避免数据库发生脏读
This commit is contained in:
松岳 陈
2024-01-03 09:13:22 +08:00
parent 66c710c034
commit 68cd466c9f
16 changed files with 521 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ spring:
username: root
password: aiihhbfcsy123!@#
url: jdbc:mysql://localhost:3306/realtime_protection
hikari:
auto-commit: false
mvc:
servlet:
path: /api/v1

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.realtime.protection.server.task.TaskMapper">
<insert id="newTask" useGeneratedKeys="true" keyProperty="taskId"
parameterType="com.realtime.protection.configuration.entity.task.Task">
INSERT INTO t_task(task_name, task_start_time, task_end_time,
task_act, task_type,
task_create_time, task_modify_time,
task_create_userid, task_create_username, task_create_depart)
VALUE(#{task.taskName}, #{task.taskStartTime}, #{task.taskEndTime},
#{task.taskAct}, #{task.taskType},
#{task.taskCreateTime}, #{task.taskModifyTime},
#{task.taskCreateUserId}, #{task.taskCreateUsername}, #{task.taskCreateDepart})
</insert>
<insert id="newTaskProobjConcat">
<if test="proobj_ids != null">
INSERT INTO t_task_project_object(task_id, protect_object_id)
VALUES
<foreach collection="proobj_ids" item="proobj_id" separator=",">
(#{task_id}, #{proobj_id})
</foreach>
</if>
</insert>
<update id="newTaskStaticRuleConcat">
UPDATE t_static_rule
SET static_rule_used_task_id = #{task_id}
WHERE static_rule_id IN
<foreach collection="rule_ids" item="rule_id" open="(" close=")" separator=",">
#{rule_id}
</foreach>
</update>
<update id="newTaskDynamicRuleConcat"/>
</mapper>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.realtime.protection.server.defense.template.TemplateMapper">
<insert id="newTemplate" useGeneratedKeys="true" keyProperty="templateId">
INSERT INTO t_strategy_template(strategy_template_name,
has_protect_object_ip, has_protect_object_port,
has_peer_ip, has_peer_port,
has_protocol, has_url, has_dns,
strategy_template_create_user_id,
strategy_template_create_username, strategy_template_create_depart,
default_op)
VALUE (#{template.templateName},
#{template.hasProtectObjectIP}, #{template.hasProtectObjectPort},
#{template.hasPeerIP}, #{template.hasPeerPort},
#{template.hasProtocol}, #{template.hasURL}, #{template.hasDNS},
0,
#{template.templateName}, #{template.templateName},
#{template.defaultOp})
</insert>
</mapper>