办学质量监测教学评价系统
康鲁杰
昨天 3e9c71e2940d675e030ee29dbb70194c6e1102e4
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
33
34
35
36
37
38
39
40
package org.ruoyi.common.web.core;
 
import org.ruoyi.common.core.domain.R;
import org.ruoyi.common.core.utils.StringUtils;
 
/**
 * 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();
    }
 
    /**
     * 页面跳转
     */
    public String redirect(String url) {
        return StringUtils.format("redirect:{}", url);
    }
 
}