办学质量监测教学评价系统
ageer
2024-01-16 1f7f97e86a79ee4f1515d753e84a1e20a3ec41fb
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 com.xmzs.common.web.core;
 
import com.xmzs.common.core.domain.R;
import com.xmzs.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);
    }
 
}