update 返回体 统一

2.X
疯狂的狮子li 3 years ago
parent 2b4de7c5ea
commit 1b7cde73f3

@ -6,7 +6,7 @@ import lombok.extern.slf4j.Slf4j;
/** /**
* web * web
* *
* @author ruoyi * @author Lion Li
*/ */
@Slf4j @Slf4j
public class BaseController { public class BaseController {
@ -28,34 +28,7 @@ public class BaseController {
* @return * @return
*/ */
protected R<Void> toAjax(boolean result) { protected R<Void> toAjax(boolean result) {
return result ? success() : error(); return result ? R.ok() : R.fail();
} }
/**
*
*/
public R<Void> success() {
return R.ok();
}
/**
*
*/
public R<Void> error() {
return R.fail();
}
/**
*
*/
public R<Void> success(String message) {
return R.ok(message);
}
/**
*
*/
public R<Void> error(String message) {
return R.fail(message);
}
} }

@ -119,7 +119,7 @@ public class SysConfigController extends BaseController {
@DeleteMapping("/{configIds}") @DeleteMapping("/{configIds}")
public R<Void> remove(@PathVariable Long[] configIds) { public R<Void> remove(@PathVariable Long[] configIds) {
configService.deleteConfigByIds(configIds); configService.deleteConfigByIds(configIds);
return success(); return R.ok();
} }
/** /**

@ -107,6 +107,6 @@ public class SysDictDataController extends BaseController {
@DeleteMapping("/{dictCodes}") @DeleteMapping("/{dictCodes}")
public R<Void> remove(@PathVariable Long[] dictCodes) { public R<Void> remove(@PathVariable Long[] dictCodes) {
dictDataService.deleteDictDataByIds(dictCodes); dictDataService.deleteDictDataByIds(dictCodes);
return success(); return R.ok();
} }
} }

@ -97,7 +97,7 @@ public class SysDictTypeController extends BaseController {
@DeleteMapping("/{dictIds}") @DeleteMapping("/{dictIds}")
public R<Void> remove(@PathVariable Long[] dictIds) { public R<Void> remove(@PathVariable Long[] dictIds) {
dictTypeService.deleteDictTypeByIds(dictIds); dictTypeService.deleteDictTypeByIds(dictIds);
return success(); return R.ok();
} }
/** /**

@ -255,6 +255,6 @@ public class SysUserController extends BaseController {
public R<Void> insertAuthRole(Long userId, Long[] roleIds) { public R<Void> insertAuthRole(Long userId, Long[] roleIds) {
userService.checkUserDataScope(userId); userService.checkUserDataScope(userId);
userService.insertUserAuth(userId, roleIds); userService.insertUserAuth(userId, roleIds);
return success(); return R.ok();
} }
} }

Loading…
Cancel
Save