package com.jg.common; /** *

* REST API 通用控制器 *

* * @author lxp * @version V1.0 * @since 2022/7/20 0:04 */ public class ApiController { /** * 请求成功 * * @param data 数据内容 * @param 对象泛型 * @return ignore */ protected Result ok(T data) { return Result.ok(data); } /** * 请求失败 * * @param msg 提示内容 * @return ignore */ protected Result failed(String msg) { return Result.failed(msg); } /** * 请求失败 * * @param errorCode 请求错误码 * @return ignore */ protected Result failed(ErrorCode errorCode) { return Result.failed(errorCode); } }