package com.trade.service.contract.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ESignConfigHolder {

    private static String apiHost;
    private static String redirectUrl;
    private static String callbackUrl;
    private static String projectId;
    private static String projectSecret;

    @Value("${esign.apiHost}")
    public void setApiHost(String apiHost) {
        ESignConfigHolder.apiHost = apiHost;
    }

    @Value("${esign.redirectUrl}")
    public void setRedirectUrl(String redirectUrl) {
        ESignConfigHolder.redirectUrl = redirectUrl;
    }

    @Value("${esign.callbackUrl}")
    public void setCallbackUrl(String callbackUrl) {
        ESignConfigHolder.callbackUrl = callbackUrl;
    }

    @Value("${esign.projectId}")
    public void setProjectId(String projectId) {
        ESignConfigHolder.projectId = projectId;
    }

    @Value("${esign.projectSecret}")
    public void setProjectSecret(String projectSecret) {
        ESignConfigHolder.projectSecret = projectSecret;
    }

    public static String getApiHost() {
        return apiHost;
    }

    public static String getRedirectUrl() {
        return redirectUrl;
    }

    public static String getCallbackUrl() {
        return callbackUrl;
    }

    public static String getProjectId() {
        return projectId;
    }

    public static String getProjectSecret() {
        return projectSecret;
    }
}
