1
This commit is contained in:
@@ -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接口
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user