提交 5edb1db7 authored 作者: mry's avatar mry

fix(web): 修改了swaggerController,行为,接口

上级 1608d236
...@@ -152,13 +152,14 @@ public class MoveController { ...@@ -152,13 +152,14 @@ public class MoveController {
*/ */
@ApiOperation(value = "删除行为和动作") @ApiOperation(value = "删除行为和动作")
@DeleteMapping("/{moveId}") @DeleteMapping("/{moveId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<CommonResultObj<MoveAction>> deleteMoveAction(@PathVariable Long moveId) { public ResponseEntity<CommonResultObj<MoveAction>> deleteMoveAction(@PathVariable Long moveId) {
Boolean moveBoolean = Optional.of(moveService.removeById(moveId)) Boolean moveBoolean = Optional.of(moveService.removeById(moveId))
.orElseThrow(() -> new GlobalException(String.format("没有查到指定的行为,你提供的行为id是%d", moveId))); .orElseThrow(() -> new GlobalException(String.format("没有查到指定的行为,你提供的行为id是%d", moveId)));
Boolean actionBoolean = Optional.of(actionService.remove(Wrappers.lambdaQuery(Action.class) Boolean actionBoolean = Optional.of(actionService.remove(Wrappers.lambdaQuery(Action.class)
.eq(moveId != 0, Action::getMoveId, moveId))) .eq(moveId != 0, Action::getMoveId, moveId)))
.orElseThrow(() -> new GlobalException(String.format("没有查到指定的行为,你提供的行为id是%d", moveId))); .orElseThrow(() -> new GlobalException(String.format("没有查到指定的行为,你提供的行为id是%d", moveId)));
return moveBoolean && actionBoolean return moveBoolean
? CommonResult.success("删除成功") ? CommonResult.success("删除成功")
: CommonResult.failed("删除失败或不存在"); : CommonResult.failed("删除失败或不存在");
} }
......
...@@ -214,5 +214,4 @@ public class SwaggerController { ...@@ -214,5 +214,4 @@ public class SwaggerController {
listCommonPage.setPageSize(pageSize); listCommonPage.setPageSize(pageSize);
return listCommonPage; return listCommonPage;
} }
} }
...@@ -154,13 +154,14 @@ public class TestCaseController { ...@@ -154,13 +154,14 @@ public class TestCaseController {
*/ */
@ApiOperation(value = "删除行用例和数据组") @ApiOperation(value = "删除行用例和数据组")
@DeleteMapping("/{testCaseId}") @DeleteMapping("/{testCaseId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<CommonResultObj<MoveAction>> deleteTestCaseData(@PathVariable Long testCaseId) { public ResponseEntity<CommonResultObj<MoveAction>> deleteTestCaseData(@PathVariable Long testCaseId) {
Boolean testCaseBoolean = Optional.of(testCaseService.removeById(testCaseId)) Boolean testCaseBoolean = Optional.of(testCaseService.removeById(testCaseId))
.orElseThrow(() -> new GlobalException(String.format("没有查到指定的用例,你提供的用例id是%d", testCaseId))); .orElseThrow(() -> new GlobalException(String.format("没有查到指定的用例,你提供的用例id是%d", testCaseId)));
Boolean testDataBoolean = Optional.of(testDataService.remove(Wrappers.lambdaQuery(TestData.class) Boolean testDataBoolean = Optional.of(testDataService.remove(Wrappers.lambdaQuery(TestData.class)
.eq(TestData::getTestCaseId, testCaseId))) .eq(TestData::getTestCaseId, testCaseId)))
.orElseThrow(() -> new GlobalException(String.format("没有查到指定的数据组,你提供的数据组id是%d", testCaseId))); .orElseThrow(() -> new GlobalException(String.format("没有查到指定的数据组,你提供的数据组id是%d", testCaseId)));
return testCaseBoolean && testDataBoolean return testCaseBoolean
? CommonResult.success("删除成功") ? CommonResult.success("删除成功")
: CommonResult.failed("删除失败或不存在"); : CommonResult.failed("删除失败或不存在");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论