|
|
@ -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)); |
|
|
|
} |
|
|
|
|
|
|
|