自定义
/** * @Description: TODO:定义统一的响应对象类 */ @Data @AllArgsConstructor @NoArgsConstructor public class ResultVO<T> implements Serializable { private static final long serialVersionUID = -2548645345465031121L; private Integer code; private String message; private T data; /** * 功能描述:定义统一返回数据 */ public static <T> ResultVO success(T data){ ResultVO resultVO = new ResultVO( AppHttpCodeEnum.SUCCESS.getCode(), AppHttpCodeEnum.SUCCESS.getMessage(), data); return resultVO; } /** * 功能描述:定义统一返回数据并自定义一message消息 */ public static <T> ResultVO success(String message,T data){ ResultVO resultVO = new ResultVO( AppHttpCodeEnum.SUCCESS.getCode(), message, data); return resultVO; } /** * 功能描述:抛出异常 返回错误信息 */ public static <T> ResultVO<T> fail(String message) { return new ResultVO<T>( AppHttpCodeEnum.FAIL.getCode(), message, null); } }
标签:集成,ResultVO,private,SpringSecurity,---,static,message,data,resultVO From: https://www.cnblogs.com/wangdch/p/18438041