package com.cusc.nirvana.user.rnr.fp.dto;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.*;

/**
 * Description: T1公共响应
 * <br />
 * CreateDate 2022-03-11 15:42:31
 *
 * @author yuyi
 **/
@ApiModel(value = "T1公共响应", description = "T1公共响应")
@Data
public class T1CommonResponseDTO implements Serializable {

    private static final long serialVersionUID = -36413222636238414L;

    @ApiModelProperty(value = "请求标识")
    @JSONField(name = "RequestID")
    private String RequestID;

    @ApiModelProperty(value = "操作结果")
    @JSONField(name = "OprRst")
    private String OprRst;

    @ApiModelProperty(value = "失败原因")
    @JSONField(name = "FailureCause")
    private String FailureCause;

    @ApiModelProperty(value = "文件系统响应的唯一id")
    @JSONField(name = "FileId")
    private String FileId;

    @ApiModelProperty(value = "一证十卡校验结果")
    @JSONField(name = "CustomerCheck")
    private String CustomerCheck;

    public T1CommonResponseDTO() {
    }

    public T1CommonResponseDTO(String requestID, String oprRst, String failureCause) {
        RequestID = requestID;
        OprRst = oprRst;
        FailureCause = failureCause;
    }

    public T1CommonResponseDTO(String requestID, String oprRst) {
        RequestID = requestID;
        OprRst = oprRst;
    }

    /**
     * Description: 创建成功响应对象
     * <br />
     * CreateDate 2022-03-11 16:18:13
     *
     * @author yuyi
     **/
    public static T1CommonResponseDTO createSuccess(String requestID) {
        return new T1CommonResponseDTO(requestID, "1");
    }

    /**
     * Description: 创建失败响应对象
     * <br />
     * CreateDate 2022-03-11 16:18:13
     *
     * @author yuyi
     **/
    public static T1CommonResponseDTO createError(String requestID, String failureCause) {
        return new T1CommonResponseDTO(requestID, "2", failureCause);
    }
}

