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;

@Data
@ApiModel(value = "指令上报结果")
public class InstructionRespDTO {

    @ApiModelProperty(value = "指令标识")
    @JSONField(name = "RequestID")
    private String RequestID;

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

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

    public static InstructionRespDTO createError(String requestId, String msg) {
        InstructionRespDTO instructionRespDTO = new InstructionRespDTO();
        instructionRespDTO.setRequestID(requestId);
        instructionRespDTO.setOprRst("2");
        instructionRespDTO.setFailureCause(msg);
        return instructionRespDTO;
    }

    public static InstructionRespDTO createSuccess(String requestId) {
        InstructionRespDTO instructionRespDTO = new InstructionRespDTO();
        instructionRespDTO.setRequestID(requestId);
        instructionRespDTO.setOprRst("1");
        return instructionRespDTO;
    }

}
