tujidelv 9 月之前
父節點
當前提交
7460a392b9

+ 4 - 2
src/main/java/top/lvzhiqiang/service/impl/CoinServiceImpl.java

@@ -1434,14 +1434,16 @@ public class CoinServiceImpl implements CoinService {
                     JSONObject jsonObject = dataJO.getJSONObject(String.valueOf(key));
                     value.setTotalMarketRanking(jsonObject.getInteger("cmc_rank"));
 
-                    BigDecimal totalMarketValue;
+                    BigDecimal totalMarketValue = null;
                     try {
                         totalMarketValue = jsonObject.getJSONObject("quote").getJSONObject("USD").getBigDecimal("market_cap").setScale(2, RoundingMode.HALF_UP);
                         if (totalMarketValue.compareTo(BigDecimal.ZERO) == 0) {
                             totalMarketValue = jsonObject.getBigDecimal("self_reported_market_cap").setScale(2, RoundingMode.HALF_UP);
                         }
                     } catch (Exception e) {
-                        totalMarketValue = jsonObject.getBigDecimal("self_reported_market_cap").setScale(2, RoundingMode.HALF_UP);
+                        if (jsonObject.containsKey("self_reported_market_cap") && null != jsonObject.getBigDecimal("self_reported_market_cap")) {
+                            totalMarketValue = jsonObject.getBigDecimal("self_reported_market_cap").setScale(2, RoundingMode.HALF_UP);
+                        }
                     }
                     value.setTotalMarketValue(totalMarketValue);
 

+ 1 - 0
src/main/resources/static/coin.html

@@ -373,6 +373,7 @@
             <input type="text" style="width: 100px;padding-top: 3px;" id="apis-quiet-div-music-keyword" placeholder="关键词">
             <select id="apis-quiet-div-music-playVolumeField" style="height: 24px;">
                 <option value="0">0</option>
+                <option value="0.125">0.125</option>
                 <option value="0.25" selected>0.25</option>
                 <option value="0.5">0.5</option>
                 <option value="0.75">0.75</option>