数据返回

This commit is contained in:
tanglong 2026-06-12 10:51:54 +08:00
parent d8be530787
commit d14002251f

View File

@ -26,7 +26,29 @@ public class CustomerDashboardDailyCapabilityHandler implements AgentCapabilityH
@Override
public AgentCapabilityResponse handle(AgentRequestContext context) {
WecomStudentContactStats stats = studentContactStatsService.fetchTodayStats();
WecomStudentContactStats stats;
try {
stats = studentContactStatsService.fetchTodayStats();
} catch (Exception e) {
return new AgentCapabilityResponse(
intent().code(),
intent().title(),
intent().mcpGroup(),
"degraded",
"""
学员联系数据暂时无法获取,不影响身份信息查询。
学员总数:暂未获取
今日新增:暂未获取
跟进成员数:暂未获取
今日收款:暂未接入
""".trim(),
List.of("企业微信学员联系 API"),
Map.of("error", e.getMessage() == null ? "api forbidden" : e.getMessage()),
Instant.now()
);
}
return new AgentCapabilityResponse(
intent().code(),
intent().title(),