From 8186a259fad21da6ea54051ec7a1c08c89393ca0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 22 Jan 2024 20:03:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5):=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=96=B0=E5=A2=9E=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3MOCK=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/3.0.0/dml/V3.0.0_11_1__data.sql | 21 +++- .../main/resources/i18n/project.properties | 14 +++ .../resources/i18n/project_en_US.properties | 14 +++ .../resources/i18n/project_zh_CN.properties | 14 +++ .../resources/i18n/project_zh_TW.properties | 14 +++ .../service/CreateRobotResourceService.java | 2 +- .../src/main/resources/message_task.json | 110 ++++++++++++++++++ .../NoticeMessageTaskControllerTests.java | 2 +- .../ProjectRobotControllerTests.java | 2 +- .../notice/constants/NoticeConstants.java | 36 ++++++ 10 files changed, 225 insertions(+), 4 deletions(-) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql index 5394ad1609..698ac142ab 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql @@ -569,7 +569,7 @@ INSERT INTO message_task_blob(id, template) VALUES (@api_case_update_id, 'messag SET @api_case_delete_id = UUID_SHORT(); Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_case_delete_id, 'CASE_DELETE', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_case_delete'); -INSERT INTO message_task_blob(id, template) VALUES (@api_case_delete_id, 'message.api_definition_task_delete'); +INSERT INTO message_task_blob(id, template) VALUES (@api_case_delete_id, 'message.api_definition_task_case_delete'); SET @api_execute_success_id = UUID_SHORT(); Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_execute_success_id, 'CASE_EXECUTE_SUCCESSFUL', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_case_execute_successful'); @@ -583,6 +583,25 @@ SET @api_execute_failed_id = UUID_SHORT(); Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_execute_failed_id, 'CASE_EXECUTE_FAILED', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_case_execute_failed'); INSERT INTO message_task_blob(id, template) VALUES (@api_execute_failed_id, 'message.api_definition_task_case_execute'); +SET @api_mock_update_id = UUID_SHORT(); +Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_mock_update_id, 'MOCK_UPDATE', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_mock_update'); +INSERT INTO message_task_blob(id, template) VALUES (@api_mock_update_id, 'message.api_definition_task_mock_update'); + +SET @api_mock_delete_id = UUID_SHORT(); +Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_mock_delete_id, 'MOCK_DELETE', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_mock_delete'); +INSERT INTO message_task_blob(id, template) VALUES (@api_mock_delete_id, 'message.api_definition_task_mock_delete'); + +SET @api_mock_execute_success_id = UUID_SHORT(); +Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_mock_execute_success_id, 'MOCK_EXECUTE_SUCCESSFUL', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_mock_execute_successful'); +INSERT INTO message_task_blob(id, template) VALUES (@api_mock_execute_success_id, 'message.api_definition_task_mock_execute'); + +SET @api_fake_error_id = UUID_SHORT(); +INSERT INTO message_task_blob(id, template) VALUES (@api_fake_error_id, 'message.api_definition_task_case_execute'); + +SET @api_mock_execute_failed_id = UUID_SHORT(); +Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_mock_execute_failed_id, 'MOCK_EXECUTE_FAILED', 'CREATE_USER', @robot_in_site_id, 'API_DEFINITION_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_definition_task_mock_execute_failed'); +INSERT INTO message_task_blob(id, template) VALUES (@api_mock_execute_failed_id, 'message.api_definition_task_mock_execute'); + -- 初始化接口场景消息设置数据 SET @api_scenario_update_id = UUID_SHORT(); Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject) VALUES (@api_scenario_update_id, 'UPDATE', 'CREATE_USER', @robot_in_site_id, 'API_SCENARIO_TASK', 'NONE', '100001100001', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.api_scenario_task_update'); diff --git a/backend/framework/sdk/src/main/resources/i18n/project.properties b/backend/framework/sdk/src/main/resources/i18n/project.properties index de667b38f6..3cc53b7792 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project.properties @@ -174,6 +174,11 @@ message.case_delete=删除用例 message.case_execute_successful=用例执行成功 message.case_execute_fake_error=用例执行误报 message.case_execute_failed=用例执行失败 +message.mock_create=创建MOCK +message.mock_update=更新MOCK +message.mock_delete=删除MOCK +message.mock_execute_successful=MOCK执行成功 +message.mock_execute_failed=MOCK执行失败 message.scenario_execute_successful=场景执行成功 message.scenario_execute_fake_error=场景执行误报 message.scenario_execute_failed=场景执行失败 @@ -227,6 +232,10 @@ message.api_definition_task_case_create=${OPERATOR}创建了接口用例:${name} message.api_definition_task_case_update=${OPERATOR}更新了接口用例:${name} message.api_definition_task_case_delete=${OPERATOR}删除了接口用例:${name} message.api_definition_task_case_execute=${OPERATOR}执行了接口用例:${name} +message.api_definition_task_mock_create=${OPERATOR}创建了接口MOCK:${name} +message.api_definition_task_mock_update=${OPERATOR}更新了接口MOCK:${name} +message.api_definition_task_mock_delete=${OPERATOR}删除了接口MOCK:${name} +message.api_definition_task_mock_execute=${OPERATOR}执行了接口MOCK:${name} message.api_scenario_task_create=${OPERATOR}创建了接口场景:${name} message.api_scenario_task_update=${OPERATOR}更新了接口场景:${name} message.api_scenario_task_delete=${OPERATOR}删除了接口场景:${name} @@ -283,6 +292,11 @@ message.title.api_definition_task_case_delete=接口用例删除通知 message.title.api_definition_task_case_execute_successful=接口用例执行成功通知 message.title.api_definition_task_case_execute_fake_error=接口用例执行误报通知 message.title.api_definition_task_case_execute_failed=接口用例执行失败通知 +message.title.api_definition_task_mock_create=MOCK创建通知 +message.title.api_definition_task_mock_update=MOCK更新通知 +message.title.api_definition_task_mock_delete=MOCK删除通知 +message.title.api_definition_task_mock_execute_successful=MOCK执行成功通知 +message.title.api_definition_task_mock_execute_failed=MOCK执行失败通知 message.title.api_scenario_task_create=接口场景创建通知 message.title.api_scenario_task_update=接口场景更新通知 message.title.api_scenario_task_delete=接口场景删除通知 diff --git a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties index e9196e8b45..8b72aa960a 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties @@ -210,6 +210,11 @@ message.case_delete=Delete case message.case_execute_successful=Case executed successfully message.case_execute_fake_error=Case execution fake error message.case_execute_failed=Case execution failed +message.mock_create=Create MOCK +message.mock_update=Update MOCK +message.mock_delete=Delete MOCK +message.mock_execute_successful=MOCK executed successfully +message.mock_execute_failed=MOCK execution failed message.scenario_execute_successful=Scenario executed successfully message.scenario_execute_fake_error=Scenario execution fake error message.scenario_execute_failed=Scenario execution failed @@ -264,6 +269,10 @@ message.api_definition_task_case_create=${OPERATOR} created the API case: ${name message.api_definition_task_case_update=${OPERATOR} updated the API case: ${name} message.api_definition_task_case_delete=${OPERATOR} deleted the API case: ${name} message.api_definition_task_case_execute=${OPERATOR} executed the API case: ${name} +message.api_definition_task_mock_create=${OPERATOR} created the API MOCK: ${name} +message.api_definition_task_mock_update=${OPERATOR} updated the API MOCK: ${name} +message.api_definition_task_mock_delete=${OPERATOR} deleted the API MOCK: ${name} +message.api_definition_task_mock_execute=${OPERATOR} executed the API MOCK: ${name} message.api_scenario_task_create=${OPERATOR} created the API scenario: ${name} message.api_scenario_task_update=${OPERATOR} updated the API scenario: ${name} message.api_scenario_task_delete=${OPERATOR} deleted the API scenario: ${name} @@ -317,6 +326,11 @@ message.title.api_definition_task_case_delete=API case deletion notification message.title.api_definition_task_case_execute_successful=API case execution success notification message.title.api_definition_task_case_execute_fake_error=API case execution fake error notification message.title.api_definition_task_case_execute_failed=API case execution failure notification +message.title.api_definition_task_mock_create=MOCK creation notification +message.title.api_definition_task_mock_update=MOCK update notification +message.title.api_definition_task_mock_delete=MOCK deletion notification +message.title.api_definition_task_mock_execute_successful=MOCK execution success notification +message.title.api_definition_task_mock_execute_failed=MOCK execution failure notification message.title.api_scenario_task_create=API scenario creation notification message.title.api_scenario_task_update=API scenario update notification message.title.api_scenario_task_delete=API scenario deletion notification diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties index b81a64c834..3bdeaf66e9 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties @@ -210,6 +210,11 @@ message.case_delete=删除用例 message.case_execute_successful=用例执行成功 message.case_execute_fake_error=用例执行误报 message.case_execute_failed=用例执行失败 +message.mock_create=创建MOCK +message.mock_update=更新MOCK +message.mock_delete=删除MOCK +message.mock_execute_successful=MOCK执行成功 +message.mock_execute_failed=MOCK执行失败 message.scenario_execute_successful=场景执行成功 message.scenario_execute_fake_error=场景执行误报 message.scenario_execute_failed=场景执行失败 @@ -264,6 +269,10 @@ message.api_definition_task_case_create=${OPERATOR}创建了接口用例:${name} message.api_definition_task_case_update=${OPERATOR}更新了接口用例:${name} message.api_definition_task_case_delete=${OPERATOR}删除了接口用例:${name} message.api_definition_task_case_execute=${OPERATOR}执行了接口用例:${name} +message.api_definition_task_mock_create=${OPERATOR}创建了接口MOCK:${name} +message.api_definition_task_mock_update=${OPERATOR}更新了接口MOCK:${name} +message.api_definition_task_mock_delete=${OPERATOR}删除了接口MOCK:${name} +message.api_definition_task_mock_execute=${OPERATOR}执行了接口MOCK:${name} message.api_scenario_task_create=${OPERATOR}创建了接口场景:${name} message.api_scenario_task_update=${OPERATOR}更新了接口场景:${name} message.api_scenario_task_delete=${OPERATOR}删除了接口场景:${name} @@ -317,6 +326,11 @@ message.title.api_definition_task_case_delete=接口用例删除通知 message.title.api_definition_task_case_execute_successful=接口用例执行成功通知 message.title.api_definition_task_case_execute_fake_error=接口用例执行误报通知 message.title.api_definition_task_case_execute_failed=接口用例执行失败通知 +message.title.api_definition_task_mock_create=MOCK创建通知 +message.title.api_definition_task_mock_update=MOCK更新通知 +message.title.api_definition_task_mock_delete=MOCK删除通知 +message.title.api_definition_task_mock_execute_successful=MOCK执行成功通知 +message.title.api_definition_task_mock_execute_failed=MOCK执行失败通知 message.title.api_scenario_task_create=接口场景创建通知 message.title.api_scenario_task_update=接口场景更新通知 message.title.api_scenario_task_delete=接口场景删除通知 diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties index e15c646e3a..1ef5acac2e 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties @@ -210,6 +210,11 @@ message.case_delete=刪除用例 message.case_execute_successful=用例執行成功 message.case_execute_fake_error=用例執行誤報 message.case_execute_failed=用例執行失敗 +message.mock_create=創建MOCK +message.mock_update=更新MOCK +message.mock_delete=删除MOCK +message.mock_execute_successful=MOCK執行成功 +message.mock_execute_failed=MOCK執行失败 message.scenario_execute_successful=場景執行成功 message.scenario_execute_fake_error=場景執行誤報 message.scenario_execute_failed=場景執行失敗 @@ -264,6 +269,10 @@ message.api_definition_task_case_create=${OPERATOR}創建了介面用例:${name} message.api_definition_task_case_update=${OPERATOR}更新了介面用例:${name} message.api_definition_task_case_delete=${OPERATOR}刪除了介面用例:${name} message.api_definition_task_case_execute=${OPERATOR}執行了介面用例:${name} +message.api_definition_task_mock_create=${OPERATOR}創建了介面MOCK:${name} +message.api_definition_task_mock_update=${OPERATOR}更新了介面MOCK:${name} +message.api_definition_task_mock_delete=${OPERATOR}删除了介面MOCK:${name} +message.api_definition_task_mock_execute=${OPERATOR}執行了介面MOCK:${name} message.api_scenario_task_create=${OPERATOR}創建了介面場景:${name} message.api_scenario_task_update=${OPERATOR}更新了介面場景:${name} message.api_scenario_task_delete=${OPERATOR}刪除了介面場景:${name} @@ -318,6 +327,11 @@ message.title.api_definition_task_case_delete=介面用例刪除通知 message.title.api_definition_task_case_execute_successful=介面用例執行成功通知 message.title.api_definition_task_case_execute_fake_error=介面用例執行誤報通知 message.title.api_definition_task_case_execute_failed=介面用例執行失敗通知 +message.title.api_definition_task_mock_create=MOCK創建通知 +message.title.api_definition_task_mock_update=MOCK更新通知 +message.title.api_definition_task_mock_delete=MOCK删除通知 +message.title.api_definition_task_mock_execute_successful=MOCK執行成功通知 +message.title.api_definition_task_mock_execute_failed=MOCK執行失敗通知 message.title.api_scenario_task_create=介面場景創建通知 message.title.api_scenario_task_update=介面場景更新通知 message.title.api_scenario_task_delete=介面場景刪除通知 diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/CreateRobotResourceService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/CreateRobotResourceService.java index edbfcbcf0a..6ca9bd5816 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/CreateRobotResourceService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/CreateRobotResourceService.java @@ -114,7 +114,7 @@ public class CreateRobotResourceService implements CreateProjectResourceService for (MessageTaskDetailDTO messageTaskDetailDTO : messageTaskDetailDTOList) { String event = messageTaskDetailDTO.getEvent(); List receivers = messageTaskDetailDTO.getReceivers(); - if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || CollectionUtils.isEmpty(receivers)) { + if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.MOCK_CREATE) || CollectionUtils.isEmpty(receivers)) { continue; } for (OptionDTO receiver : receivers) { diff --git a/backend/services/project-management/src/main/resources/message_task.json b/backend/services/project-management/src/main/resources/message_task.json index 88bc7c6eda..524ee07027 100644 --- a/backend/services/project-management/src/main/resources/message_task.json +++ b/backend/services/project-management/src/main/resources/message_task.json @@ -784,6 +784,116 @@ "useDefaultSubject":true } ] + }, + { + "event":"MOCK_CREATE", + "eventName":"", + "receivers":[ + { + "id": "", + "name": "" + } + ], + "projectRobotConfigList":[ + { + "robotId":"", + "enable":"", + "template":"", + "defaultTemplate":"", + "useDefaultTemplate":true, + "subject":"", + "defaultSubject":"", + "useDefaultSubject":true + } + ] + }, + { + "event":"MOCK_UPDATE", + "eventName":"", + "receivers":[ + { + "id": "CREATE_USER", + "name": "" + } + ], + "projectRobotConfigList":[ + { + "robotId":"", + "enable":"", + "template":"", + "defaultTemplate":"", + "useDefaultTemplate":true, + "subject":"", + "defaultSubject":"", + "useDefaultSubject":true + } + ] + }, + { + "event":"MOCK_DELETE", + "eventName":"", + "receivers":[ + { + "id": "CREATE_USER", + "name": "" + } + ], + "projectRobotConfigList":[ + { + "robotId":"", + "enable":"", + "template":"", + "defaultTemplate":"", + "useDefaultTemplate":true, + "subject":"", + "defaultSubject":"", + "useDefaultSubject":true + } + ] + }, + { + "event":"MOCK_EXECUTE_SUCCESSFUL", + "eventName":"", + "receivers":[ + { + "id": "CREATE_USER", + "name": "" + } + ], + "projectRobotConfigList":[ + { + "robotId":"", + "enable":"", + "template":"", + "defaultTemplate":"", + "useDefaultTemplate":true, + "subject":"", + "defaultSubject":"", + "useDefaultSubject":true + } + ] + }, + { + "event":"MOCK_EXECUTE_FAILED", + "eventName":"", + "receivers":[ + { + "id": "CREATE_USER", + "name": "" + } + ], + "projectRobotConfigList":[ + { + "robotId":"", + "enable":"", + "template":"", + "defaultTemplate":"", + "useDefaultTemplate":true, + "subject":"", + "defaultSubject":"", + "useDefaultSubject":true + } + ] } ] }, diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/NoticeMessageTaskControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/NoticeMessageTaskControllerTests.java index abe738b01c..bc8d58f3c9 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/NoticeMessageTaskControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/NoticeMessageTaskControllerTests.java @@ -624,7 +624,7 @@ public class NoticeMessageTaskControllerTests extends BaseTest { for (MessageTaskDetailDTO messageTaskDetailDTO : messageTaskDetailDTOList) { String event = messageTaskDetailDTO.getEvent(); List receivers = messageTaskDetailDTO.getReceivers(); - if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || CollectionUtils.isEmpty(receivers)) { + if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.MOCK_CREATE) || CollectionUtils.isEmpty(receivers)) { continue; } for (OptionDTO receiver : receivers) { diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java index 0fcdf0e782..416afdc7a9 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectRobotControllerTests.java @@ -544,7 +544,7 @@ public class ProjectRobotControllerTests extends BaseTest { for (MessageTaskDetailDTO messageTaskDetailDTO : messageTaskDetailDTOList) { String event = messageTaskDetailDTO.getEvent(); List receivers = messageTaskDetailDTO.getReceivers(); - if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || CollectionUtils.isEmpty(receivers)) { + if (StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.CASE_CREATE) || StringUtils.equalsIgnoreCase(event, NoticeConstants.Event.MOCK_CREATE) || CollectionUtils.isEmpty(receivers)) { continue; } for (OptionDTO receiver : receivers) { diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/constants/NoticeConstants.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/constants/NoticeConstants.java index e37f6a81fd..507053f808 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/constants/NoticeConstants.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/constants/NoticeConstants.java @@ -180,6 +180,21 @@ public interface NoticeConstants { @Schema(description = "message.case_execute_failed") String CASE_EXECUTE_FAILED = "CASE_EXECUTE_FAILED"; + @Schema(description = "message.mock_create") + String MOCK_CREATE = "MOCK_CREATE"; + + @Schema(description = "message.mock_update") + String MOCK_UPDATE = "MOCK_UPDATE"; + + @Schema(description = "message.mock_delete") + String MOCK_DELETE = "MOCK_DELETE"; + + @Schema(description = "message.mock_execute_successful") + String MOCK_EXECUTE_SUCCESSFUL = "MOCK_EXECUTE_SUCCESSFUL"; + + @Schema(description = "message.mock_execute_failed") + String MOCK_EXECUTE_FAILED = "MOCK_EXECUTE_FAILED"; + @Schema(description = "message.scenario_execute_successful") String SCENARIO_EXECUTE_SUCCESSFUL = "SCENARIO_EXECUTE_SUCCESSFUL"; @@ -302,6 +317,17 @@ public interface NoticeConstants { @Schema(description = "message.api_definition_task_case_execute") String API_DEFINITION_TASK_CASE_EXECUTE_FAILED = "API_DEFINITION_TASK_CASE_EXECUTE_FAILED";//${OPERATOR}执行了接口用例:${name} + @Schema(description = "message.api_definition_task_mock_create") + String API_DEFINITION_TASK_MOCK_CREATE = "API_DEFINITION_TASK_MOCK_CREATE";//${OPERATOR}创建了接口MOCK:${name} + @Schema(description = "message.api_definition_task_mock_update") + String API_DEFINITION_TASK_MOCK_UPDATE = "API_DEFINITION_TASK_MOCK_UPDATE";//${OPERATOR}更新了接口MOCK:${name} + @Schema(description = "message.api_definition_task_mock_delete") + String API_DEFINITION_TASK_MOCK_DELETE = "API_DEFINITION_TASK_MOCK_DELETE";//${OPERATOR}删除了接口MOCK:${name} + @Schema(description = "message.api_definition_task_mock_execute") + String API_DEFINITION_TASK_MOCK_EXECUTE_SUCCESSFUL = "API_DEFINITION_TASK_MOCK_EXECUTE_SUCCESSFUL";//${OPERATOR}执行了接口MOCK:${name} + @Schema(description = "message.api_definition_task_mock_execute") + String API_DEFINITION_TASK_MOCK_EXECUTE_FAILED = "API_DEFINITION_TASK_MOCK_EXECUTE_FAILED";//${OPERATOR}执行了接口MOCK:${name} + @Schema(description = "message.api_scenario_task_create") String API_SCENARIO_TASK_CREATE = "API_SCENARIO_TASK_CREATE";//${OPERATOR}创建了接口场景:${name} @Schema(description = "message.api_scenario_task_update") @@ -437,6 +463,16 @@ public interface NoticeConstants { String API_DEFINITION_TASK_CASE_EXECUTE_FAKE_ERROR = "API_DEFINITION_TASK_CASE_EXECUTE_FAKE_ERROR"; @Schema(description = "message.title.api_definition_task_case_execute_failed")//接口用例执行失败通知 String API_DEFINITION_TASK_CASE_EXECUTE_FAILED = "API_DEFINITION_TASK_CASE_EXECUTE_FAILED"; + @Schema(description = "message.title.api_definition_task_mock_create") + String API_DEFINITION_TASK_MOCK_CREATE = "API_DEFINITION_TASK_MOCK_CREATE"; + @Schema(description = "message.title.api_definition_task_mock_update") + String API_DEFINITION_TASK_MOCK_UPDATE = "API_DEFINITION_TASK_MOCK_UPDATE"; + @Schema(description = "message.title.api_definition_task_mock_delete") + String API_DEFINITION_TASK_MOCK_DELETE = "API_DEFINITION_TASK_MOCK_DELETE"; + @Schema(description = "message.title.api_definition_task_case_execute_successful") + String API_DEFINITION_TASK_MOCK_EXECUTE_SUCCESSFUL = "API_DEFINITION_TASK_MOCK_EXECUTE_SUCCESSFUL"; + @Schema(description = "message.title.api_definition_task_case_execute_failed") + String API_DEFINITION_TASK_MOCK_EXECUTE_FAILED = "API_DEFINITION_TASK_MOCK_EXECUTE_FAILED"; @Schema(description = "message.title.api_scenario_task_create")//接口场景创建通知 String API_SCENARIO_TASK_CREATE = "API_SCENARIO_TASK_CREATE";