update 返回体 统一

This commit is contained in:
疯狂的狮子li
2022-02-11 17:53:15 +08:00
parent 2b4de7c5ea
commit 1b7cde73f3
5 changed files with 6 additions and 33 deletions

View File

@@ -6,7 +6,7 @@ import lombok.extern.slf4j.Slf4j;
/**
* web层通用数据处理
*
* @author ruoyi
* @author Lion Li
*/
@Slf4j
public class BaseController {
@@ -28,34 +28,7 @@ public class BaseController {
* @return 操作结果
*/
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);
}
}