xuekang
2024-05-10 1a8ae5789b0b66e42b6af8a44251d8359e9d410b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package org.dromara.common.web.core;
 
import org.dromara.common.core.domain.R;
 
/**
 * web层通用数据处理
 *
 * @author Lion Li
 */
public class BaseController {
 
    /**
     * 响应返回结果
     *
     * @param rows 影响行数
     * @return 操作结果
     */
    protected R<Void> toAjax(int rows) {
        return rows > 0 ? R.ok() : R.fail();
    }
 
    /**
     * 响应返回结果
     *
     * @param result 结果
     * @return 操作结果
     */
    protected R<Void> toAjax(boolean result) {
        return result ? R.ok() : R.fail();
    }
 
}