refactor: 重构AI聊天服务为流式返回,优化OOS路径与仓库初始化逻辑

1. 重构AI聊天接口与实现为流式返回,支持SSE协议
2. 修正BaseRepository的数据库上下文初始化逻辑
3. 更新AutoDotCodeConsumer的OOS存储路径
4. 新增阿里云OSS配置项到appsettings
5. 优化AiChatService的日志与代码注释
This commit is contained in:
glz
2026-06-24 18:25:25 +08:00
parent bf333cd718
commit 3c3453668f
6 changed files with 94 additions and 49 deletions

View File

@ -19,7 +19,8 @@ namespace QYZH.InteractiveMagazine.Repository
private readonly ILogger<BaseRepository<T>> _logger;
public BaseRepository(ISqlSugarClient context = null) : base(context)
{
Context = DbScoped.SugarScope;
// 优先使用注入的 context如果没有注入则使用 DbScoped.SugarScope
Context = context ?? DbScoped.SugarScope;
_logger = ServiceContext.GetService<ILogger<BaseRepository<T>>>();
}