Sfoglia il codice sorgente

score_list 增加ghId参数

wangyunpeng 8 mesi fa
parent
commit
8b5a5a9b99

+ 8 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/remote/NLPRemoteService.java

@@ -85,7 +85,14 @@ public class NLPRemoteService {
 //                        log.info("scoreList 返回的数据:{}", responseBody);
                         JSONObject scoreListResponse = JSONObject.parseObject(responseBody);
                         if (Objects.nonNull(scoreListResponse)) {
-                            JSONObject accountScoreList = scoreListResponse.getJSONObject(accountName);
+                            Set<String> keySet = scoreListResponse.keySet();
+                            JSONObject accountScoreList = null;
+                            for (String key : keySet) {
+                                if (key.equals(accountName) || key.equals(ghId)) {
+                                    accountScoreList = scoreListResponse.getJSONObject(key);
+                                    break;
+                                }
+                            }
                             if (Objects.nonNull(accountScoreList)) {
                                 List<Double> scoreList = accountScoreList.getJSONArray("score_list").toJavaList(Double.class);
                                 for (int i = 0; i < contentList.size(); i++) {