|
|
@@ -423,6 +423,37 @@ public class CodexServiceImpl implements CodexService {
|
|
|
throw new BusinessRuntimeException("获取用户仪表盘数据失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ClaudeCodeResp getJavaUserDashboard(Long userId) {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ CodexUser codexUser = codexUserMapper.selectOne(Wrappers.lambdaQuery(CodexUser.class).in(CodexUser::getUserId, userIdList).last("limit 1"));
|
|
|
+
|
|
|
+ if (codexUser == null) {
|
|
|
+ throw new BusinessRuntimeException("用户未开通Codex服务");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用Codex API获取用户控制台数据
|
|
|
+ String dashboardUrl = String.format(Constant.CLAUDE_CODE_API_PREFIX + "api/openai/users/%s/java/dashboard", userId);
|
|
|
+ ClaudeCodeResp codexResp = executeCodexGetApi(dashboardUrl);
|
|
|
+ return codexResp;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ClaudeCodeResp getJavaUserAnalytics(Long userId) {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ CodexUser codexUser = codexUserMapper.selectOne(Wrappers.lambdaQuery(CodexUser.class).in(CodexUser::getUserId, userIdList).last("limit 1"));
|
|
|
+
|
|
|
+ if (codexUser == null) {
|
|
|
+ throw new BusinessRuntimeException("用户未开通Codex服务");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用Codex API获取用户分析数据
|
|
|
+ String analyticsUrl = String.format(Constant.CLAUDE_CODE_API_PREFIX + "api/openai/users/%s/java/analytics", userId);
|
|
|
+ ClaudeCodeResp codexResp = executeCodexGetApi(analyticsUrl);
|
|
|
+
|
|
|
+ return codexResp;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Codex DELETE请求
|