package cn.pluss.platform.ysExtension.v20220615;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Data
@Component
@ConfigurationProperties(prefix = "ys-extension")
public class YsConfigExtensionV2 {

    private String agentNoV2;

    /**
     * 发起方编号
     */
    private String srcMerchantNo;

    /**
     * 进件链接前缀
     */
    private String auditDomainV2;

    /**
     * 合作方商编
     */
    private String src;

    /**
     * 私钥
     */
    private String priKeyV2;

    /**
     * 公钥v2
     */
    private String pubKeyV2;

    /**
     * 加密秘钥
     */
    private String encryptPwd;

    /**
     * 进件，图片上传的接口链接
     */
    public static String IMG_UPLOAD;

    /**
     * 进件, 商户信息提交的接口
     */
    public static String MER_AUDIT;

    /**
     * 进件驳回后, 商户信息修改的接口
     */
    public static String MER_FAILED_EDIT;

    /**
     * 进件审核接口
     */
    public static String MER_APPLY;

    /**
     * 进件结果查询接口
     */
    public static String MER_RESULT;

    /**
     * 商户信息变更结果查询
     */
    public static String MER_EDIT_RESULT;

    /**
     * (重新)发送签约短信
     */
    public static String MER_PROTOCOL_MSG;

    /**
     * 查询签约状态
     */
    public static String MER_PROTOCOL_STATUS;

    /**
     * 线上支付开通， T1, 线上支付只分两种，T1和D0
     */
    public static String MER_T1_REQ;

    /**
     * 线上支付开通，D0
     */
    public static String MER_D0_REQ;

    /**
     * 修改银行卡信息的链接
     */
    public static String MER_BANK_CHANGE;

    /**
     * 修改信息上传图片
     */
    public static String MER_EDIT_PIC_UPLOAD;

    /**
     * 修改费率
     */
    public static String MER_RATE_CHANGE;

    /**
     * 图片上传口令接口
     */
    public static String MER_UPLOAD_TOKEN = "https://register.ysepay.com:2443/register_gateway/gateway.do";

    /**
     * 微信认证上传图片
     */
    public static String MER_IMG_UPLOAD = "https://uploadApi.ysepay.com:2443/yspay-upload-service?method=upload";

    /**
     * 微信认证发起, 申请单状态查询
     */
    public static String MER_WX_CERT = "https://openapi.ysepay.com/gateway.do";


    @PostConstruct
    public void init() {
        dataInit(this);
    }

    public static synchronized void dataInit(YsConfigExtensionV2 ysConfigExtensionV2) {
        IMG_UPLOAD = ysConfigExtensionV2.auditDomainV2 + "saas/org/uploadPic";

        MER_AUDIT = ysConfigExtensionV2.auditDomainV2 + "saas/org/addScanMerchant";

        MER_FAILED_EDIT = ysConfigExtensionV2.auditDomainV2 + "saas/org/updateScanMerchant";

        MER_APPLY = ysConfigExtensionV2.auditDomainV2 + "saas/org/autoAuditTerm";

        MER_RESULT = ysConfigExtensionV2.auditDomainV2 + "saas/org/queryMerchant";

        MER_PROTOCOL_MSG = ysConfigExtensionV2.auditDomainV2 + "saas/orgSign/sendScanSmsCode";

        MER_PROTOCOL_STATUS = ysConfigExtensionV2.auditDomainV2 + "saas/orgSign/querySignSts";

        MER_T1_REQ = ysConfigExtensionV2.auditDomainV2 + "saas/orgScan/onlineTrading";

        MER_D0_REQ = ysConfigExtensionV2.auditDomainV2 + "saas/orgScan/optOnlineD0";

        MER_BANK_CHANGE = ysConfigExtensionV2.auditDomainV2 + "saas/org/changeMerAccInfo";

        MER_EDIT_RESULT = ysConfigExtensionV2.auditDomainV2 + "saas/org/queryModifyStatus";

        MER_RATE_CHANGE = ysConfigExtensionV2.auditDomainV2 + "saas/org/changeMerOnlineFee";

        MER_EDIT_PIC_UPLOAD = ysConfigExtensionV2.auditDomainV2 + "saas/org/changeMerPic";
    }
}