关于result统一json响应实体类的封装
public static <T> Result<T> success(T t){ Result<T> result = new Result<>(); result.setCode(1); result.setMsg("请求成功"); result.setData(t); return result; }
是不是这样写会好一点?
public static <T> Result<T> success(T t){ Result<T> result = new Result<>(); result.setCode(1); result.setMsg("请求成功"); result.setData(t); return result; }
是不是这样写会好一点?
2018-05-22
举报