|
|
@@ -114,10 +114,6 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
}
|
|
|
//清缓存
|
|
|
if (orderType == 2) {
|
|
|
- //记录变更积分
|
|
|
- if (isUpgrade) {
|
|
|
- recordCodePointsChangeRecord(claudeCodeUser.getUserId(), codePoints - thisRelationCodePoints, "升级到" + sku.getSpecVal(), "adjustment");
|
|
|
- }
|
|
|
invalidateUserCache(relationUserId);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -368,8 +364,6 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
claudeCodeUserMapper.updateById(claudeCodeUser);
|
|
|
return;
|
|
|
}
|
|
|
- //记录变更积分
|
|
|
- recordCodePointsChangeRecord(claudeCodeUser.getUserId(), amount, description, type);
|
|
|
//刷新缓存
|
|
|
invalidateUserCache(claudeCodeUser.getUserId());
|
|
|
} catch (Exception e) {
|
|
|
@@ -378,32 +372,6 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- *
|
|
|
- * @param userId
|
|
|
- * @param amount
|
|
|
- * @param description
|
|
|
- * @param type consume refund adjustment
|
|
|
- */
|
|
|
- private void recordCodePointsChangeRecord(Long userId, Integer amount, String description, String type) {
|
|
|
- if (amount == 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Map<String, Object> parmas = new HashMap<>();
|
|
|
- parmas.put("amount", amount);
|
|
|
- parmas.put("description", description);
|
|
|
- parmas.put("type", type);
|
|
|
- String url = String.format(CLAUDE_CODE_API_PREFIX + "/api/users/%s/credits/adjust", userId);
|
|
|
- try {
|
|
|
- ClaudeCodeResp claudeCodeResp = executeClaudeCodePostApi(url, Jsons.toJson(parmas));
|
|
|
- if (!Constant.SUCCESS.equals(claudeCodeResp.getMessage())) {
|
|
|
- log.error("变更用户:{}积分记录失败", userId);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public Boolean delUserPackages(Long userId) {
|
|
|
String url = String.format(CLAUDE_CODE_API_PREFIX + "api/users/%s/plan", userId);
|