package com.dxhy.auth.config;

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

/**
 * @author jiaohongyang（焦红阳）
 * @date 2020-12-14
 */
@Component
public class AuthConfig {
    public static String userTokenHeader;

    public static String clientId;

    public static String clientSecret;

    public static String clientTokenHeader;

    public static String userSecret;

    public static String serviceSecret;

    @Value("${jwt.token-header}")
    public void setUserTokenHeader(String userTokenHeader) {
        AuthConfig.userTokenHeader = userTokenHeader;
    }

    @Value("${client.id}")
    public void setClientId(String clientId) {
        AuthConfig.clientId = clientId;
    }

    @Value("${client.secret}")
    public void setClientSecret(String clientSecret) {
        AuthConfig.clientSecret = clientSecret;
    }

    @Value("${client.token-header}")
    public void setClientTokenHeader(String clientTokenHeader) {
        AuthConfig.clientTokenHeader = clientTokenHeader;
    }

    @Value("${jwt.rsa-secret}")
    public void setUserSecret(String userSecret) {
        AuthConfig.userSecret = userSecret;
    }

    @Value("${client.rsa-secret}")
    public void setServiceSecret(String serviceSecret) {
        AuthConfig.serviceSecret = serviceSecret;
    }
}
