package com.jeequan.jeepay.core.model.device;

import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * TODO
 *
 * @author crystal
 * @date 2023/12/25 11:26
 */
@Data
public class LklsParams extends DeviceParams {

    public ProviderParams providerParams;

    public DeviceParams deviceParams;

    public BizConfigParams bizConfigParams;

    public ExtParams extParams;

    public LklsParams(ProviderParams providerParams) {
        this.providerParams = providerParams;
    }

    public LklsParams(ProviderParams providerParams, DeviceParams deviceParams, BizConfigParams bizConfigParams,ExtParams extParams) {
        this.providerParams = providerParams;
        this.deviceParams = deviceParams;
        this.bizConfigParams = bizConfigParams;
        this.extParams = extParams;
    }

    @Data
    public static class ProviderParams {
        /**
         * 支付成功语音播报内容
         */
        private String customContent;

        /**
         * appId
         */
        private String appId;

        /**
         * appSecret
         */
        private String appSecret;
    }

    @Data
    public static class DeviceParams {

        /**
         * 设备号
         */
        private String deviceNo;

    }

    @Data
    public static class BizConfigParams {

        /**
         * 打印联数
         */
        private Integer printNum;

        /**
         * 打印机模式
         */
        private Byte printMode;

    }

    @Data
    public static class ExtParams {

        /**
         * 绑定状态
         */
        private Integer bindState;
        /**
         * 用户号
         */
        private String mchNo;

        /**
         * 通道号
         */
        private String isvNo;

        /**
         * 门店编号
         */
        private Long storeId;


        /**
         * 通道商编
         */
        private String merchantId;
    }

    @Override
    public String deSenData() {
        ProviderParams params = this.getProviderParams();
        return JSONObject.toJSONString(params);
    }
}
