package com.dxhy.erp.entity.V5;

import com.dxhy.common.enums.RespStatusEnum;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 校验返回
 *
 * @author ZSC-DXHY
 * @date 创建时间: 2021-12-13 11:27
 */
@Getter
@Setter
public class CheckResult implements Serializable {
    private String code;
    private String msg;
    
    public CheckResult() {
    }
    
    public CheckResult(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    
    public CheckResult(RespStatusEnum respStatusEnum) {
        this.code = respStatusEnum.getCode();
        this.msg = respStatusEnum.getDescribe();
    }
    
    public static CheckResult error(String code, String msg) {
        return new CheckResult(code, msg);
    }
}
