修正R.fail忘记添加return的bug

This commit is contained in:
dataprince 2024-01-18 17:22:06 +08:00
parent b06857e8c8
commit 32ef43f198
12 changed files with 48 additions and 36 deletions

View File

@ -28,11 +28,23 @@ Ruoyi-Flex秉承“写的更少、性能更好、出错更低、交流通畅、
### 4交流通畅 ### 4交流通畅
“非我族类其心必异”。Ruoyi-Flex集成了一大波国产开源软件MyBatis-Flex、Sa-Token、Hutool、PowerJob、Element-Plus等同根同源交流自然顺畅开发中遇到问题可联系作者快速得到解决。例如同一个领域的安全框架一个中国人只需半天就可学会Sa-Token干活如果是学Spring Security的话七天也不一定能学会。 “非我族类其心必异”。Ruoyi-Flex集成了一大波国产开源软件MyBatis-Flex、Sa-Token、Hutool、PowerJob、Element-Plus等同根同源交流自然顺畅开发中遇到问题可联系作者快速得到解决。例如同一个领域的安全框架一个中国人只需半天就可学会Sa-Token干活如果是学Spring Security的话七天也不一定能学会。
### 5入门快速 ### 5多端同步
Ruoyi-Flex提供“1+3”端1个后台端、3个前台端熟悉js的可使用flex-elementplus-ui前端熟悉ts的可使用ruoyiflex-elementplus-ts前端既熟悉ts有熟悉antdesign的请使用ruoyiflex-antdesign-vben前端总有一款适合您的前端供您选择
### 6入门快速
Ruoyi-Flex已集成各种开源开发框架扫平了技术障碍可直接上手干活。使用者只需要设计好数据库表结构系统能可视化生成前后端本地代码单表、树表、主子表任你选10分钟就能开发一个模块快速入门开发高效。 Ruoyi-Flex已集成各种开源开发框架扫平了技术障碍可直接上手干活。使用者只需要设计好数据库表结构系统能可视化生成前后端本地代码单表、树表、主子表任你选10分钟就能开发一个模块快速入门开发高效。
## 3、前端项目 ## 3、前端项目
Ruoyi-Flex实行前后端分离仓库本项目是java后端部分前端项目是flex-elementplus-ui前端项目地址: [flex-elementplus-ui](https://gitee.com/dataprince/flex-elementplus-ui) Ruoyi-Flex实行前后端分离仓库本项目是java后端部分目前有3个前端项目
### 1flex-elementplus-ui
使用elementplus、js构建项目地址: [flex-elementplus-ui](https://gitee.com/dataprince/flex-elementplus-ui)
### 2ruoyiflex-elementplus-ts
使用elementplus、typescript构建项目地址: [ruoyiflex-elementplus-ts](https://gitee.com/dataprince/ruoyiflex-elementplus-ts)
### 3ruoyiflex-antdesign-vben
使用antdesign、vben、typescript构建项目地址: [ruoyiflex-antdesign-vben](https://gitee.com/dataprince/ruoyiflex-antdesign-vben)
## 4、内置功能 ## 4、内置功能

View File

@ -96,9 +96,9 @@ public class SysClientController {
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated @RequestBody SysClientBo sysClientBo) { public R<Void> edit(@Validated @RequestBody SysClientBo sysClientBo) {
Boolean updated = sysClientService.update(sysClientBo); boolean updated = sysClientService.update(sysClientBo);
if (!updated) { if (!updated) {
R.fail("修改客户端管理记录失败!"); return R.fail("修改客户端管理记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -110,9 +110,9 @@ public class SysClientController {
@Log(title = "客户端管理", businessType = BusinessType.UPDATE) @Log(title = "客户端管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus") @PutMapping("/changeStatus")
public R<Void> changeStatus(@RequestBody SysClientBo sysClientBo) { public R<Void> changeStatus(@RequestBody SysClientBo sysClientBo) {
Boolean updated = sysClientService.updateStatus(sysClientBo); boolean updated = sysClientService.updateStatus(sysClientBo);
if (!updated) { if (!updated) {
R.fail("修改客户端管理状态失败!"); return R.fail("修改客户端管理状态失败!");
} }
return R.ok(); return R.ok();
} }
@ -129,7 +129,7 @@ public class SysClientController {
@PathVariable Long[] ids) { @PathVariable Long[] ids) {
boolean deleted = sysClientService.deleteByIds(List.of(ids)); boolean deleted = sysClientService.deleteByIds(List.of(ids));
if (!deleted) { if (!deleted) {
R.fail("删除客户端管理记录失败!"); return R.fail("删除客户端管理记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -105,7 +105,7 @@ public class SysConfigController extends BaseController {
} }
boolean updated = configService.updateConfig(config); boolean updated = configService.updateConfig(config);
if (!updated) { if (!updated) {
R.fail("修改参数'" + config.getConfigName() + "'失败!"); return R.fail("修改参数'" + config.getConfigName() + "'失败!");
} }
return R.ok(); return R.ok();
} }
@ -119,7 +119,7 @@ public class SysConfigController extends BaseController {
public R<Void> updateByKey(@RequestBody SysConfigBo config) { public R<Void> updateByKey(@RequestBody SysConfigBo config) {
boolean updated = configService.updateConfigByKey(config); boolean updated = configService.updateConfigByKey(config);
if (!updated) { if (!updated) {
R.fail("修改参数'" + config.getConfigName() + "'失败!"); return R.fail("修改参数'" + config.getConfigName() + "'失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -107,7 +107,7 @@ public class SysDictTypeController extends BaseController
{ {
boolean deleted = dictTypeService.deleteDictTypeByIds(dictIds); boolean deleted = dictTypeService.deleteDictTypeByIds(dictIds);
if (!deleted) { if (!deleted) {
R.fail("删除字典类型记录失败!"); return R.fail("删除字典类型记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -186,7 +186,7 @@ public class SysMenuController extends BaseController
} }
boolean deleted = menuService.deleteMenuById(menuId); boolean deleted = menuService.deleteMenuById(menuId);
if (!deleted) { if (!deleted) {
R.fail("删除菜单记录失败!"); return R.fail("删除菜单记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -87,9 +87,9 @@ public class SysNoticeController extends BaseController
@PutMapping @PutMapping
public R<Void> edit(@Validated @RequestBody SysNoticeBo noticeBo) public R<Void> edit(@Validated @RequestBody SysNoticeBo noticeBo)
{ {
Boolean updated = noticeService.updateNotice(noticeBo); boolean updated = noticeService.updateNotice(noticeBo);
if (!updated) { if (!updated) {
R.fail("修改通知公告记录失败!"); return R.fail("修改通知公告记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -104,7 +104,7 @@ public class SysNoticeController extends BaseController
{ {
boolean deleted = noticeService.deleteNoticeByIds(noticeIds); boolean deleted = noticeService.deleteNoticeByIds(noticeIds);
if (!deleted) { if (!deleted) {
R.fail("删除通知公告记录失败!"); return R.fail("删除通知公告记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -84,9 +84,9 @@ public class SysOssConfigController extends BaseController {
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated @RequestBody SysOssConfigBo bo) { public R<Void> edit(@Validated @RequestBody SysOssConfigBo bo) {
Boolean updated = ossConfigService.updateByBo(bo); boolean updated = ossConfigService.updateByBo(bo);
if (!updated) { if (!updated) {
R.fail("修改对象存储配置记录失败!"); return R.fail("修改对象存储配置记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -103,7 +103,7 @@ public class SysOssConfigController extends BaseController {
@PathVariable Long[] ossConfigIds) { @PathVariable Long[] ossConfigIds) {
boolean deleted = ossConfigService.deleteWithValidByIds(List.of(ossConfigIds), true); boolean deleted = ossConfigService.deleteWithValidByIds(List.of(ossConfigIds), true);
if (!deleted) { if (!deleted) {
R.fail("删除对象存储配置记录失败!"); return R.fail("删除对象存储配置记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -117,7 +117,7 @@ public class SysOssConfigController extends BaseController {
public R<Void> changeStatus(@RequestBody SysOssConfigBo bo) { public R<Void> changeStatus(@RequestBody SysOssConfigBo bo) {
boolean updated = ossConfigService.updateOssConfigStatus(bo); boolean updated = ossConfigService.updateOssConfigStatus(bo);
if (!updated) { if (!updated) {
R.fail("状态修改失败!"); return R.fail("状态修改失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -100,9 +100,9 @@ public class SysOssController extends BaseController {
@DeleteMapping("/{ossIds}") @DeleteMapping("/{ossIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ossIds) { @PathVariable Long[] ossIds) {
Boolean deleted = ossService.deleteWithValidByIds(List.of(ossIds), true); boolean deleted = ossService.deleteWithValidByIds(List.of(ossIds), true);
if (!deleted) { if (!deleted) {
R.fail("删除OSS对象存储记录失败!"); return R.fail("删除OSS对象存储记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -115,9 +115,9 @@ public class SysPostController extends BaseController
&& userPostService.countUserPostById(postBo.getPostId()) > 0) { && userPostService.countUserPostById(postBo.getPostId()) > 0) {
return R.fail("该岗位下存在已分配用户,不能禁用!"); return R.fail("该岗位下存在已分配用户,不能禁用!");
} }
Boolean updated = postService.updatePost(postBo); boolean updated = postService.updatePost(postBo);
if (!updated) { if (!updated) {
R.fail("修改岗位记录失败!"); return R.fail("修改岗位记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -132,7 +132,7 @@ public class SysPostController extends BaseController
{ {
boolean deleted = postService.deletePostByIds(postIds); boolean deleted = postService.deletePostByIds(postIds);
if (!deleted) { if (!deleted) {
R.fail("删除岗位记录失败!"); return R.fail("删除岗位记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -109,7 +109,7 @@ public class SysTenantController extends BaseController {
tenantService.checkTenantAllowed(sysTenantBo.getTenantId()); tenantService.checkTenantAllowed(sysTenantBo.getTenantId());
boolean updated = tenantService.update(sysTenantBo); boolean updated = tenantService.update(sysTenantBo);
if (!updated) { if (!updated) {
R.fail("修改租户记录失败!"); return R.fail("修改租户记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -125,7 +125,7 @@ public class SysTenantController extends BaseController {
tenantService.checkTenantAllowed(sysTenantBo.getTenantId()); tenantService.checkTenantAllowed(sysTenantBo.getTenantId());
boolean updated = tenantService.updateTenantStatus(sysTenantBo); boolean updated = tenantService.updateTenantStatus(sysTenantBo);
if (!updated) { if (!updated) {
R.fail("修改租户状态失败!"); return R.fail("修改租户状态失败!");
} }
return R.ok(); return R.ok();
} }
@ -142,7 +142,7 @@ public class SysTenantController extends BaseController {
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] tenantIds) { public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] tenantIds) {
boolean deleted = tenantService.deleteByIds(List.of(tenantIds), true); boolean deleted = tenantService.deleteByIds(List.of(tenantIds), true);
if (!deleted) { if (!deleted) {
R.fail("删除租户记录失败!"); return R.fail("删除租户记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -184,7 +184,7 @@ public class SysTenantController extends BaseController {
@NotNull(message = "套餐ID不能为空") Long packageId) { @NotNull(message = "套餐ID不能为空") Long packageId) {
boolean synced = tenantService.syncTenantPackage(tenantId, packageId); boolean synced = tenantService.syncTenantPackage(tenantId, packageId);
if (!synced) { if (!synced) {
R.fail("同步租户套餐失败!"); return R.fail("同步租户套餐失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -108,9 +108,9 @@ public class SysTenantPackageController extends BaseController
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated @RequestBody SysTenantPackageBo sysTenantPackageBo) { public R<Void> edit(@Validated @RequestBody SysTenantPackageBo sysTenantPackageBo) {
Boolean updated = tenantPackageService.update(sysTenantPackageBo); boolean updated = tenantPackageService.update(sysTenantPackageBo);
if (!updated) { if (!updated) {
R.fail("修改租户套餐记录失败!"); return R.fail("修改租户套餐记录失败!");
} }
return R.ok(); return R.ok();
} }
@ -123,9 +123,9 @@ public class SysTenantPackageController extends BaseController
@Log(title = "租户套餐", businessType = BusinessType.UPDATE) @Log(title = "租户套餐", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus") @PutMapping("/changeStatus")
public R<Void> changeStatus(@RequestBody SysTenantPackageBo sysTenantPackageBo) { public R<Void> changeStatus(@RequestBody SysTenantPackageBo sysTenantPackageBo) {
Boolean updated = tenantPackageService.updatePackageStatus(sysTenantPackageBo); boolean updated = tenantPackageService.updatePackageStatus(sysTenantPackageBo);
if (!updated) { if (!updated) {
R.fail("修改租户套餐记录状态失败!"); return R.fail("修改租户套餐记录状态失败!");
} }
return R.ok(); return R.ok();
} }
@ -143,7 +143,7 @@ public class SysTenantPackageController extends BaseController
@PathVariable Long[] packageIds) { @PathVariable Long[] packageIds) {
boolean deleted = tenantPackageService.deleteByIds(packageIds, true); boolean deleted = tenantPackageService.deleteByIds(packageIds, true);
if (!deleted) { if (!deleted) {
R.fail("删除租户套餐记录失败!"); return R.fail("删除租户套餐记录失败!");
} }
return R.ok(); return R.ok();
} }

View File

@ -34,6 +34,7 @@ public class SysClientServiceImpl extends ServiceImpl<SysClientMapper, SysClient
@Resource @Resource
private SysClientMapper clientMapper; private SysClientMapper clientMapper;
@Override @Override
public QueryWrapper query() { public QueryWrapper query() {
return super.query().from(SYS_CLIENT); return super.query().from(SYS_CLIENT);
@ -125,7 +126,6 @@ public class SysClientServiceImpl extends ServiceImpl<SysClientMapper, SysClient
Date createTime = new Date(); Date createTime = new Date();
sysClient.setUpdateBy(loginUserId); sysClient.setUpdateBy(loginUserId);
sysClient.setUpdateTime(createTime); sysClient.setUpdateTime(createTime);
return this.updateById(sysClient); return this.updateById(sysClient);
} }