首页>代码>基于Spring Boot+Layui+mybatis开发垃圾分类管理系统>/garbage-collection-project/src/main/java/com/garbage/demo/common/Result.java
package com.garbage.demo.common;
import lombok.Data;
@Data
public class Result<T> {
/**
* 错误码
*/
private Integer code;
/**
* 提示信息
*/
private String msg;
/**
* 返回的具体内容
*/
private Integer count;
private T data;
public Result(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Result setData(T data) {
this.data = data;
return this;
}
public Result setData(T data,Integer count) {
this.data = data;
this.count = count;
return this;
}
public Result setMsg(String msg) {
this.msg = msg;
return this;
}
public static Result getSuccess() {
return new Result(200,"成功");
}
public static Result getFailure() {
return new Result(400,"失败");
} }
最近下载更多
最近浏览更多
梁小贤 LV1
5月22日
sbsjsk
2024年10月24日
暂无贡献等级
krispeng LV15
2024年9月30日
黄志琴 LV1
2024年9月29日
yimaoermao LV1
2024年9月14日
kgl234 LV2
2024年8月17日
微信网友_7096619637297152
2024年7月26日
暂无贡献等级
17380184110
2024年6月20日
暂无贡献等级
计科一班 LV7
2024年6月19日
fengst
2024年6月18日
暂无贡献等级

