package com.binge.myblogsystem.util; import lombok.Data; import java.io.Serializable; @Data public class ResultVo<T> implements Serializable { private static final long serialVersionUID = 1L; //状态码 private int code; //状态码描述 private String message; //数据结果,泛型,可以是列表、单个对象、数字、布尔值等 private T data; public ResultVo() { } public ResultVo(int code, String message) { this.code = code; this.message = message; } public static <T> ResultVo<T> success(T data) { ResultVo<T> resultVo = new ResultVo<>(); resultVo.setCode(200); resultVo.setMessage("OK"); resultVo.setData(data); return resultVo; } }
标签:code,请求,resultVo,private,public,响应,Ajax,message,ResultVo From: https://www.cnblogs.com/ywzh/p/17742419.html