package org.dromara.talk.controller.api;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.talk.config.DifyConfig;
import org.dromara.talk.config.XunfeiConfig;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 配置接口（对话前端）
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/talk/config")
@CrossOrigin(origins = "*", maxAge = 3600)
public class TalkConfigController {

    private final XunfeiConfig xunfeiConfig;

    /**
     * 获取讯飞配置
     */
    @GetMapping("/xunfei")
    public Map<String, String> getXunfeiConfig() {
        Map<String, String> config = new HashMap<>();
        config.put("appId", xunfeiConfig.getAppId());
        config.put("apiKey", xunfeiConfig.getApiKey());
        config.put("apiSecret", xunfeiConfig.getApiSecret());
        return config;
    }

}
