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 toAjax(int rows) { return rows > 0 ? R.ok() : R.fail(); } /** * 响应返回结果 * * @param result 结果 * @return 操作结果 */ protected R toAjax(boolean result) { return result ? R.ok() : R.fail(); } /** * 页面跳转 */ public String redirect(String url) { return StringUtils.format("redirect:{}", url); } }