package com.example.erp.common;
|
//返回结果包装类
|
import lombok.AllArgsConstructor;
|
import lombok.Data;
|
import lombok.NoArgsConstructor;
|
|
@Data
|
@NoArgsConstructor
|
@AllArgsConstructor
|
public class Result {
|
private String code;
|
private String msg;
|
private Object data;
|
|
public static Result seccess(){
|
return new Result(Constants.Code_200,"",null);
|
}
|
public static Result seccess(Object data){
|
return new Result(Constants.Code_200,"",data);
|
}
|
|
public static Result error(String code ,String msg){
|
return new Result(code,msg,null);
|
}
|
public static Result error(){
|
return new Result(Constants.Code_500,"服务器发生异常",null);
|
}
|
|
}
|