This commit is contained in:
van
2026-04-04 16:20:46 +08:00
parent c31a34f519
commit 74e7990947
3 changed files with 183 additions and 0 deletions

View File

@@ -156,6 +156,50 @@ public class SocialMediaController extends BaseController
}
}
/**
* 获取大模型接入配置API 地址、密钥等,与 Jarvis 共用 Redis
*/
@GetMapping("/llm-config")
public AjaxResult getLlmConfig()
{
try {
return socialMediaService.getLlmConfig();
} catch (Exception e) {
logger.error("获取大模型接入配置失败", e);
return AjaxResult.error("获取失败: " + e.getMessage());
}
}
/**
* 保存大模型接入配置
*/
@Log(title = "保存大模型接入配置", businessType = BusinessType.UPDATE)
@PostMapping("/llm-config/save")
public AjaxResult saveLlmConfig(@RequestBody Map<String, Object> request)
{
try {
return socialMediaService.saveLlmConfig(request);
} catch (Exception e) {
logger.error("保存大模型接入配置失败", e);
return AjaxResult.error("保存失败: " + e.getMessage());
}
}
/**
* 清除大模型接入配置Jarvis 使用 yml 默认 Ollama
*/
@Log(title = "重置大模型接入配置", businessType = BusinessType.DELETE)
@DeleteMapping("/llm-config")
public AjaxResult resetLlmConfig()
{
try {
return socialMediaService.resetLlmConfig();
} catch (Exception e) {
logger.error("重置大模型接入配置失败", e);
return AjaxResult.error("重置失败: " + e.getMessage());
}
}
/**
* 闲鱼文案(手动):根据标题+可选型号生成代下单、教你下单文案不依赖JD接口
*/