feat: AI 调用改为异步任务并支持结果重复获取
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.guo.learningprogresstracker.config;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.guo.learningprogresstracker.common.TenantContext;
|
||||
import net.sf.jsqlparser.expression.StringValue;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
@@ -39,7 +40,10 @@ public class MybatisPlusConfig {
|
||||
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() {
|
||||
@Override
|
||||
public Expression getTenantId() {
|
||||
return new StringValue(StpUtil.getLoginIdAsString());
|
||||
// 后台执行线程(AI 任务、定时收敛)通过 TenantContext 显式声明身份;
|
||||
// 请求线程没有设置,仍走 StpUtil,行为完全不变
|
||||
TenantContext.Identity identity = TenantContext.get();
|
||||
return new StringValue(identity != null ? identity.loginId() : StpUtil.getLoginIdAsString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user