package org.dromara.talk.config;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.service.ConfigService;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class XunfeiConfig {

    private final ConfigService configService;

    public String getAppId() {
        try {
            return configService.getConfigValue("xunfei.tts.appId");
        } catch (Exception e) {
            log.warn("从配置表读取 xunfei.tts.appId 失败", e);
        }
        return "";
    }

    public String getApiKey() {
        try {
            return configService.getConfigValue("xunfei.tts.apiKey");
        } catch (Exception e) {
            log.warn("从配置表读取 xunfei.tts.apiKey 失败", e);
        }
        return "";
    }

    public String getApiSecret() {
        try {
            return configService.getConfigValue("xunfei.tts.apiSecret");
        } catch (Exception e) {
            log.warn("从配置表读取 xunfei.tts.apiSecret 失败", e);
        }
        return "";
    }
}
