|
@@ -106,7 +106,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
if (checkClaudeCodeUser(userId)) {
|
|
if (checkClaudeCodeUser(userId)) {
|
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
|
Assert.notNull(claudeCodeUserId, "您的claude code账号已过期");
|
|
Assert.notNull(claudeCodeUserId, "您的claude code账号已过期");
|
|
|
- String apiKeyUrl = String.format(CLAUDE_CODE_API_PREFIX + "api/keys/{userId}/{keyId}", claudeCodeUserId, keyId);
|
|
|
|
|
|
|
+ String apiKeyUrl = String.format(CLAUDE_CODE_API_PREFIX + "api/keys/%s/%s", claudeCodeUserId, keyId);
|
|
|
Map<String, Object> parmas = new HashMap<>();
|
|
Map<String, Object> parmas = new HashMap<>();
|
|
|
parmas.put("status", status);
|
|
parmas.put("status", status);
|
|
|
String responseBody = executeClaudeCodePostApi(apiKeyUrl, parmas.toString());
|
|
String responseBody = executeClaudeCodePostApi(apiKeyUrl, parmas.toString());
|
|
@@ -125,7 +125,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
String keyValue = delReq.getKeyValue();
|
|
String keyValue = delReq.getKeyValue();
|
|
|
if (checkClaudeCodeUser(userId)) {
|
|
if (checkClaudeCodeUser(userId)) {
|
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
|
- String url = String.format(CLAUDE_CODE_API_PREFIX + "api/keys/{userId}/{keyId}", claudeCodeUserId, keyId);
|
|
|
|
|
|
|
+ String url = String.format(CLAUDE_CODE_API_PREFIX + "api/keys/%s/%s", claudeCodeUserId, keyId);
|
|
|
HttpResponse execute = HttpUtil.createRequest(Method.DELETE, url).execute();
|
|
HttpResponse execute = HttpUtil.createRequest(Method.DELETE, url).execute();
|
|
|
String responseBody = execute.body();
|
|
String responseBody = execute.body();
|
|
|
ClaudeCodeResp claudeCodeResp = Jsons.parseObject(responseBody, ClaudeCodeResp.class);
|
|
ClaudeCodeResp claudeCodeResp = Jsons.parseObject(responseBody, ClaudeCodeResp.class);
|
|
@@ -179,7 +179,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
public ClaudeCodePointsHistoryResp getUserPointsDetail(Long userId, String type, Integer page, Integer limit) throws Exception {
|
|
public ClaudeCodePointsHistoryResp getUserPointsDetail(Long userId, String type, Integer page, Integer limit) throws Exception {
|
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
Long claudeCodeUserId = getClaudeCodeUserId(userId);
|
|
|
if (claudeCodeUserId != null) {
|
|
if (claudeCodeUserId != null) {
|
|
|
- String url = String.format(CLAUDE_CODE_API_PREFIX + "api/users/{userId}/credits/history?page=%s&limit=%s&type=%s", claudeCodeUserId, page, limit, type);
|
|
|
|
|
|
|
+ String url = String.format(CLAUDE_CODE_API_PREFIX + "api/users/%s/credits/history?page=%s&limit=%s&type=%s", claudeCodeUserId, page, limit, type);
|
|
|
String responseBody = executeClaudeCodeGetApi(url);
|
|
String responseBody = executeClaudeCodeGetApi(url);
|
|
|
ClaudeCodePointsHistoryResp historyResp = Jsons.parseObject(responseBody, ClaudeCodePointsHistoryResp.class);
|
|
ClaudeCodePointsHistoryResp historyResp = Jsons.parseObject(responseBody, ClaudeCodePointsHistoryResp.class);
|
|
|
return historyResp;
|
|
return historyResp;
|