You've already forked FrameTour-BE
refactor(FaceChatService): 优化 GLM 客户端依赖注入配置
- 添加 Lazy 注解以延迟 GLM 客户端初始化 - 避免循环依赖问题 - 提升服务启动性能
This commit is contained in:
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import ai.z.openapi.service.model.ChatMessage;
|
||||
import ai.z.openapi.service.model.ChatMessageRole;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -42,6 +43,7 @@ public class FaceChatServiceImpl implements FaceChatService {
|
||||
private final FaceChatConversationMapper conversationMapper;
|
||||
private final FaceChatMessageMapper messageMapper;
|
||||
private final FaceRepository faceRepository;
|
||||
@Lazy
|
||||
private final GlmClient glmClient;
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user