|
|
@@ -110,11 +110,15 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
public ClaudeCodePointsHistoryResp getUserPointsDetail(Long userId, String type, Integer page, Integer limit) throws Exception {
|
|
|
String url = String.format(CLAUDE_CODE_API_PREFIX + "api/users/{userId}/credits/history?page=%s&limit=%s&type=%s", userId, page, limit, type);
|
|
|
String responseBody = executeClaudeCodeGetApi(url);
|
|
|
+ ClaudeCodePointsHistoryResp historyResp = Jsons.parseObject(responseBody, ClaudeCodePointsHistoryResp.class);
|
|
|
+ return historyResp;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getUserPointsStatisticsData(long userId) throws Exception {
|
|
|
+ String url = String.format(CLAUDE_CODE_API_PREFIX + "api/users/%s/usage/stats", userId);
|
|
|
+ String responseBody = executeClaudeCodeGetApi(url);
|
|
|
ClaudeCodeResp claudeCodeResp = Jsons.parseObject(responseBody, ClaudeCodeResp.class);
|
|
|
- if (claudeCodeResp.getSuccess()) {
|
|
|
- return Jsons.parseObject(responseBody, ClaudeCodePointsHistoryResp.class);
|
|
|
- }
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
public void createOrUpdateClaudeCodeUserPackage(Long userId, String planName, Integer codePoints, Integer codeCreditRecovery, Date expiryTime) throws Exception {
|