Przeglądaj źródła

fix claude pro次数非空

zoujiajian 1 rok temu
rodzic
commit
5647043a59

+ 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();
     }