diff --git a/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java b/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java index 9dbecfb157..bc9016afc1 100644 --- a/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java +++ b/backend/src/main/java/io/metersphere/notice/controller/NoticeController.java @@ -1,5 +1,6 @@ package io.metersphere.notice.controller; +import io.metersphere.base.domain.MessageTask; import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.SessionUtils; @@ -39,5 +40,10 @@ public class NoticeController { public int deleteMessage(@PathVariable String identification) { return noticeService.delMessage(identification); } + + @PostMapping("/search/message/tasks/{projectId}") + public List getMessageByProjectId(@PathVariable String projectId, @RequestBody MessageDetail messageDetail) { + return noticeService.getMessageByProjectId(projectId, messageDetail); + } } diff --git a/backend/src/main/java/io/metersphere/notice/service/NoticeService.java b/backend/src/main/java/io/metersphere/notice/service/NoticeService.java index 350fe47db9..75c600ca34 100644 --- a/backend/src/main/java/io/metersphere/notice/service/NoticeService.java +++ b/backend/src/main/java/io/metersphere/notice/service/NoticeService.java @@ -192,4 +192,25 @@ public class NoticeService { StatusReference.statusMap.containsKey(task.getTaskType()) ? StatusReference.statusMap.get(task.getTaskType()) : task.getTaskType(), null, columns); return JSON.toJSONString(details); } + + public List getMessageByProjectId(String projectId, MessageDetail messageDetail) { + MessageTaskExample example = new MessageTaskExample(); + MessageTaskExample.Criteria criteria = example.createCriteria(); + if (StringUtils.isNotBlank(projectId)) { + criteria.andProjectIdEqualTo(projectId); + } + if (StringUtils.isNotBlank(messageDetail.getTaskType())) { + criteria.andTaskTypeEqualTo(messageDetail.getTaskType()); + } + if (StringUtils.isNotBlank(messageDetail.getEvent())) { + criteria.andEventEqualTo(messageDetail.getEvent()); + } + if (StringUtils.isNotBlank(messageDetail.getIdentification())) { + criteria.andIdentificationEqualTo(messageDetail.getIdentification()); + } + if (StringUtils.isNotBlank(messageDetail.getType())) { + criteria.andTypeEqualTo(messageDetail.getType()); + } + return messageTaskMapper.selectByExample(example); + } } diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue index 5e2b5fe340..cbad864dcd 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -182,26 +182,37 @@ - +
- {{ $t('api_test.definition.one_click_sync') + "case" }} + {{ $t('api_test.definition.one_click_sync') + "case" }}
- {{ $t('workstation.batch_sync_api_tips') }} +
+ {{ $t('workstation.batch_sync_api_tips') }}

+ + {{ $t('workstation.sync') + $t('commons.setting') }} + + +

+
+ +
- {{ $t('workstation.sync') + $t('commons.setting') }}
- - - - + +
- {{ $t('api_test.definition.change_notification') }} + {{ $t('api_test.definition.change_notification') }}
- {{ $t('api_test.definition.recipient_tips') }} - - {{ $t('api_test.definition.recipient') + ":" }} + + {{ $t('api_test.definition.recipient_tips') }} + + + {{ $t('api_test.definition.recipient') + ":" }} + {{ 'CASE' + $t('api_test.creator') }} {{ $t('commons.scenario') + $t('api_test.creator') }} @@ -309,11 +320,13 @@ export default { createNewVersionVisible: false, batchSyncApiVisible: false, syncCases: true, - specialReceivers: false, - caseCreator: false, - scenarioCreator: false, + specialReceivers: true, + caseCreator: true, + scenarioCreator: true, apiSyncCaseRequest: {}, - + isXpack: false, + showNotice: false, + showApiSyncConfig: true }; }, props: {moduleOptions: {}, request: {}, response: {}, basisData: {}, syncTabs: Array, projectId: String}, @@ -870,12 +883,32 @@ export default { this.apiSyncCaseRequest = JSON.parse(res.data.triggerUpdate); } }); + }, + getMessageList() { + let messageConfig = { + userIds: [], + taskType: 'API_DEFINITION_TASK', + event: 'UPDATE', + webhook: null, + type: 'IN_SITE', + identification: null, + isSet: null, + testId: null, + createTime: null, + template: null + } + this.$post('/notice/search/message/tasks/' + this.projectId, messageConfig, response => { + if (response.data && response.data.length > 0) { + this.showNotice = true; + } + }); } }, created() { this.getMaintainerOptions(); this.getApplication(); + this.isXpack = !!hasLicense(); if (!this.basisData.environmentId) { this.basisData.environmentId = ""; } @@ -901,6 +934,7 @@ export default { if (hasLicense()) { this.getVersionHistory(); + this.getMessageList(); } } }; @@ -911,6 +945,7 @@ export default { display: flex; flex-direction: row; justify-content: space-between; + margin-bottom: 5px; } .base-info .el-form-item { diff --git a/frontend/src/business/components/project/menu/appmanage/AppManage.vue b/frontend/src/business/components/project/menu/appmanage/AppManage.vue index b6457e3d2f..fed0a26ac3 100644 --- a/frontend/src/business/components/project/menu/appmanage/AppManage.vue +++ b/frontend/src/business/components/project/menu/appmanage/AppManage.vue @@ -165,7 +165,15 @@
- {{ $t('api_test.request.time') + $t('commons.setting') }} + + {{ $t('api_test.request.time') + $t('commons.setting') }} + + + + +
@@ -196,12 +204,28 @@
- {{ - $t('commons.pending_upgrade') + $t('api_test.request.condition') + $t('commons.setting') - }} + + {{ + $t('commons.pending_upgrade') + $t('api_test.request.condition') + $t('commons.setting') + }} + + + + + + -
- {{ $t('workstation.api_change') + $t('commons.setting') }} +
+ + {{ $t('workstation.api_change') + $t('commons.setting') }} + + + + {{ $t('api_test.mock.base_info') + ":" }} @@ -230,7 +254,12 @@ {{ $t('api_test.request.body') }} -