fix(接口自动化): 修复回收站恢复缺陷

This commit is contained in:
fit2-zhao 2020-12-18 10:28:28 +08:00
parent 855f96a25a
commit 3db39fb276
7 changed files with 34 additions and 19 deletions

View File

@ -59,8 +59,8 @@ public class ApiAutomationController {
} }
@PostMapping("/reduction") @PostMapping("/reduction")
public void reduction(@RequestBody List<String> ids) { public void reduction(@RequestBody List<SaveApiScenarioRequest> requests) {
apiAutomationService.reduction(ids); apiAutomationService.reduction(requests);
} }
@GetMapping("/getApiScenario/{id}") @GetMapping("/getApiScenario/{id}")

View File

@ -63,8 +63,8 @@ public class ApiDefinitionController {
} }
@PostMapping("/reduction") @PostMapping("/reduction")
public void reduction(@RequestBody List<String> ids) { public void reduction(@RequestBody List<SaveApiDefinitionRequest> requests) {
apiDefinitionService.reduction(ids); apiDefinitionService.reduction(requests);
} }
@GetMapping("/get/{id}") @GetMapping("/get/{id}")

View File

@ -179,7 +179,12 @@ public class ApiAutomationService {
extApiScenarioMapper.removeToGc(apiIds); extApiScenarioMapper.removeToGc(apiIds);
} }
public void reduction(List<String> apiIds) { public void reduction(List<SaveApiScenarioRequest> requests) {
List<String> apiIds = new ArrayList<>();
requests.forEach(item->{
checkNameExist(item);
apiIds.add(item.getId());
});
extApiScenarioMapper.reduction(apiIds); extApiScenarioMapper.reduction(apiIds);
} }

View File

@ -158,7 +158,12 @@ public class ApiDefinitionService {
extApiDefinitionMapper.removeToGc(apiIds); extApiDefinitionMapper.removeToGc(apiIds);
} }
public void reduction(List<String> apiIds) { public void reduction(List<SaveApiDefinitionRequest> requests) {
List<String> apiIds = new ArrayList<>();
requests.forEach(item -> {
checkNameExist(item);
apiIds.add(item.getId());
});
extApiDefinitionMapper.reduction(apiIds); extApiDefinitionMapper.reduction(apiIds);
} }
@ -386,6 +391,7 @@ public class ApiDefinitionService {
/** /**
* 数据统计-接口类型 * 数据统计-接口类型
*
* @param projectId 项目ID * @param projectId 项目ID
* @return * @return
*/ */
@ -395,6 +401,7 @@ public class ApiDefinitionService {
/** /**
* 统计本周创建的数据总量 * 统计本周创建的数据总量
*
* @param projectId * @param projectId
* @return * @return
*/ */

@ -1 +1 @@
Subproject commit efb49c9b4be136ce48e9550dc9c8a2975d9f4d7f Subproject commit 61397c16728a63493507679f7e0940d9099f337f

View File

@ -219,8 +219,9 @@
this.$emit('edit', row); this.$emit('edit', row);
}, },
reductionApi(row) { reductionApi(row) {
let obj = [row.id]; row.scenarioDefinition = null;
this.$post("/api/automation/reduction", obj, response => { let rows = [row];
this.$post("/api/automation/reduction", rows, response => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
this.search(); this.search();
}) })

View File

@ -268,8 +268,10 @@
this.$emit('editApi', row); this.$emit('editApi', row);
}, },
reductionApi(row) { reductionApi(row) {
let ids = [row.id]; row.request = null;
this.$post('/api/definition/reduction/', ids, () => { row.response = null;
let rows = [row];
this.$post('/api/definition/reduction/', rows, () => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
this.search(); this.search();
}); });