package cn.pluss.platform.alidevice;

import cn.pluss.platform.api.Result;
import cn.pluss.platform.util.StringUtil;
import lombok.Data;

/**
 *
 *阿里云扫码设备收款参数
 *@author: bzg
 *@time: 2021/12/22 14:26
 */
@Data
public class AliScanCodeDevicePayEntity {


    public static Integer SCAN_PAY_TYPE = 2;

    /**
     * 设备SN号
     * @date: 2021/12/22 14:29
     */
    private String code;

    /**
     * 收款金额
     * @date: 2021/12/22 14:29
     */
    private Double fee;

    /**
     * 付款类型 扫码收款固定为2
     * @date: 2021/12/22 14:29
     */
    private Integer type;

    /**
     * 付款码
     * @date: 2021/12/22 14:31
     */
    private String auth;

    /**
     * 备注
     * @date: 2021/12/22 14:35
     */
    private String remark;

    /**
     * sn
     */
    private String sn;

    /**
     * 支付方式
     * @date: 2021/12/23 18:46
     */
    private String p_type;

    private String trace;

    public static Result success(String message,Object data){
        return new Result(0,message,data);
    }

    public static Result fail(String message){
        return new Result(1,message);
    }

    public static Result fail(String message,Object data){
        return new Result(1,message,data);
    }

    public static Result await(String message,Object data){
        return new Result(2,message,data);
    }

    public String getCode() {
        if (StringUtil.isEmpty(code)){
            return sn;
        }
        return code;
    }
}
