Browse Source

1.兼容可靠性测试系统-应用程序兼容性测试工具-检查示例程序状态

master
zhouyl 1 year ago
parent
commit
79fef5a7a6
  1. 9
      tp-functional/src/main/java/com/inscloudtech/functional/controller/FuncCarAppController.java

9
tp-functional/src/main/java/com/inscloudtech/functional/controller/FuncCarAppController.java

@ -99,12 +99,18 @@ public class FuncCarAppController extends BaseController {
return R.ok("数据源已切换为【" +DATA_SOURCE+ "】");
}
void checkDemoAppStatus(){
if(DEMO_APP_STATUS.equals("STOP")){
throw new RuntimeException("示例应用程序未启动!");
}
}
/**
* 数据库测试-3查询示例数据列表
*/
@GetMapping("/demoDataList")
public TableDataInfo list(FuncCarApp bo, PageQuery pageQuery) {
checkDemoAppStatus();
return iFuncCarAppService.queryPageList(bo, pageQuery,DATA_SOURCE);
}
@ -115,6 +121,7 @@ public class FuncCarAppController extends BaseController {
@RepeatSubmit()
@PostMapping("/demoData")
public R<Void> add(@Validated(AddGroup.class) @RequestBody FuncCarApp bo) {
checkDemoAppStatus();
return toAjax(iFuncCarAppService.insertByBo(bo,DATA_SOURCE));
}
@ -124,6 +131,7 @@ public class FuncCarAppController extends BaseController {
@RepeatSubmit()
@PutMapping("/demoData")
public R<Void> edit(@Validated(EditGroup.class) @RequestBody FuncCarApp bo) {
checkDemoAppStatus();
return toAjax(iFuncCarAppService.updateByBo(bo,DATA_SOURCE));
}
@ -135,6 +143,7 @@ public class FuncCarAppController extends BaseController {
@DeleteMapping("/demoData/{operIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] operIds) {
checkDemoAppStatus();
return toAjax(iFuncCarAppService.deleteWithValidByIds(Arrays.asList(operIds), true,DATA_SOURCE));
}

Loading…
Cancel
Save