diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java index cdba39cc4..8dc4876ef 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java @@ -66,7 +66,7 @@ public class SysOssConfigController extends BaseController { @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) { - return toAjax(iSysOssConfigService.insertByBo(bo) ? 1 : 0); + return toAjax(iSysOssConfigService.insertByBo(bo)); } /** @@ -77,7 +77,7 @@ public class SysOssConfigController extends BaseController { @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) { - return toAjax(iSysOssConfigService.updateByBo(bo) ? 1 : 0); + return toAjax(iSysOssConfigService.updateByBo(bo)); } /** @@ -90,7 +90,7 @@ public class SysOssConfigController extends BaseController { @DeleteMapping("/{ossConfigIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ossConfigIds) { - return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true) ? 1 : 0); + return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true)); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java index fac5ddef6..9b9b4d8cc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java @@ -125,7 +125,7 @@ public class SysOssController extends BaseController { @DeleteMapping("/{ossIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ossIds) { - return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0); + return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true)); } } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java index caed9756c..3bd2867ee 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java @@ -46,7 +46,7 @@ public class TestBatchController extends BaseController { testDemo.setValue("测试新增"); list.add(testDemo); } - return toAjax(testDemoMapper.insertBatch(list) ? 1 : 0); + return toAjax(testDemoMapper.insertBatch(list)); } /** @@ -74,7 +74,7 @@ public class TestBatchController extends BaseController { testDemo.setId(null); } } - return toAjax(testDemoMapper.insertOrUpdateBatch(list) ? 1 : 0); + return toAjax(testDemoMapper.insertOrUpdateBatch(list)); } /** diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java index 33b341282..873facc3b 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java @@ -119,7 +119,7 @@ public class TestDemoController extends BaseController { // 使用校验工具对标 @Validated(AddGroup.class) 注解 // 用于在非 Controller 的地方校验对象 ValidatorUtils.validate(bo, AddGroup.class); - return toAjax(iTestDemoService.insertByBo(bo) ? 1 : 0); + return toAjax(iTestDemoService.insertByBo(bo)); } /** @@ -130,7 +130,7 @@ public class TestDemoController extends BaseController { @RepeatSubmit @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody TestDemoBo bo) { - return toAjax(iTestDemoService.updateByBo(bo) ? 1 : 0); + return toAjax(iTestDemoService.updateByBo(bo)); } /** @@ -143,6 +143,6 @@ public class TestDemoController extends BaseController { @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) { - return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true)); } } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java index 52d881edd..db54230c6 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java @@ -78,7 +78,7 @@ public class TestTreeController extends BaseController { @RepeatSubmit @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody TestTreeBo bo) { - return toAjax(iTestTreeService.insertByBo(bo) ? 1 : 0); + return toAjax(iTestTreeService.insertByBo(bo)); } /** @@ -89,7 +89,7 @@ public class TestTreeController extends BaseController { @RepeatSubmit @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody TestTreeBo bo) { - return toAjax(iTestTreeService.updateByBo(bo) ? 1 : 0); + return toAjax(iTestTreeService.updateByBo(bo)); } /** @@ -102,6 +102,6 @@ public class TestTreeController extends BaseController { @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) { - return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true)); } } diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm index 1b2bc136b..3edbc3382 100644 --- a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -89,7 +89,7 @@ public class ${ClassName}Controller extends BaseController { @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) { - return toAjax(i${ClassName}Service.insertByBo(bo) ? 1 : 0); + return toAjax(i${ClassName}Service.insertByBo(bo)); } /** @@ -100,7 +100,7 @@ public class ${ClassName}Controller extends BaseController { @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) { - return toAjax(i${ClassName}Service.updateByBo(bo) ? 1 : 0); + return toAjax(i${ClassName}Service.updateByBo(bo)); } /** @@ -113,6 +113,6 @@ public class ${ClassName}Controller extends BaseController { @DeleteMapping("/{${pkColumn.javaField}s}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { - return toAjax(i${ClassName}Service.deleteWithValidByIds(Arrays.asList(${pkColumn.javaField}s), true) ? 1 : 0); + return toAjax(i${ClassName}Service.deleteWithValidByIds(Arrays.asList(${pkColumn.javaField}s), true)); } }