NNowhZzU
2023-12-25 bc7fc7214a00a4d5e84e6962126dbcb91dd7a6b2
north-glass-erp/src/main/java/com/example/erp/common/Result.java
New file
@@ -0,0 +1,29 @@
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);
    }
}