瀏覽代碼

fix claude pro次数非空

zoujiajian 1 年之前
父節點
當前提交
5647043a59
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netflix-service/src/main/java/com/cyksj/service/claude/impl/ClaudeServiceImpl.java

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/claude/impl/ClaudeServiceImpl.java

@@ -222,7 +222,7 @@ public class ClaudeServiceImpl implements ClaudeService {
     @Override
     public Long getConversationCount(String userToken, Long limitTime) {
         JSONObject conversationCount = getConversationCount(userToken);
-        Long count = conversationCount.getLong("count");
+        Long count = Optional.ofNullable(conversationCount.getLong("count")).orElse(0l);
         return new BigDecimal(count).divide(BigDecimal.valueOf(4000),0, RoundingMode.HALF_UP).longValue();
     }