package com.ruoyi.ss.transactionBill.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 提前结束订单VO
 * @author wjh
 * 2024/9/29
 */
@Data
public class EndUseVO {

    @ApiModelProperty("订单关闭结果")
    private Integer result;

    @ApiModelProperty("设备是否关闭")
    private Boolean deviceResult;

    @ApiModelProperty("设备关闭结果描述")
    private String deviceMsg;

    public static EndUseVO toResult(Integer result, boolean deviceResult, String deviceMsg){
        EndUseVO endUseVO = new EndUseVO();
        endUseVO.setResult(result == null ? 0 : result);
        endUseVO.setDeviceResult(deviceResult);
        endUseVO.setDeviceMsg(deviceMsg);
        return endUseVO;
    }

    public static EndUseVO fail() {
        EndUseVO endUseVO = new EndUseVO();
        endUseVO.setResult(0);
        return endUseVO;
    }


}
