diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index 6d228c5..175e425 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.4.6"; + public static final String version="1.4.7"; public static void main(String[] args) { System.out.println("当前版本号:" + version); diff --git a/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java b/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java index ceb32ac..99c7a30 100644 --- a/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java +++ b/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java @@ -9,6 +9,7 @@ import com.yutou.tools.mybatis.model.BangumiList; import com.yutou.tools.mybatis.model.BangumiListExample; import com.yutou.tools.services.interfaces.BangumiService; import com.yutou.tools.utils.BangumiTools; +import com.yutou.tools.utils.RedisTools; import com.yutou.tools.utils.Tools; import org.springframework.stereotype.Service; @@ -74,7 +75,9 @@ public class BangumiServiceImpl implements BangumiService { if(item.getEnable()==0||item.getBgmid()==0){ continue; } - JSONObject bangumi=BangumiTools.getBangumiInfoSmall(item.getBgmid()); + String tmp=RedisTools.get(item.getBgmid()+"",1); + JSONObject bangumi= tmp==null?BangumiTools.getBangumiInfoSmall(item.getBgmid()):JSONObject.parseObject(tmp); + RedisTools.set(1,item.getBgmid()+"",bangumi.toJSONString()); if(bangumi.containsKey("code")&&bangumi.getInteger("code")==404){ continue; } diff --git a/src/main/java/com/yutou/tools/utils/RedisTools.java b/src/main/java/com/yutou/tools/utils/RedisTools.java index 78b763f..f6e20a8 100644 --- a/src/main/java/com/yutou/tools/utils/RedisTools.java +++ b/src/main/java/com/yutou/tools/utils/RedisTools.java @@ -42,7 +42,6 @@ public class RedisTools { Jedis jedis = getRedis(); jedis.select(dbIndex); String ret = jedis.set(key, value); - System.out.println("Redis set =" + ret); jedis.close(); } catch (Exception e) { // TODO: handle exception @@ -77,9 +76,9 @@ public class RedisTools { } public static String get(String key, int dbIndex) { - String value = "-999"; + String value = null; if (isNotInstallRedis) { - return value; + return null; } try (Jedis jedis = getRedis()) { jedis.select(dbIndex); diff --git a/web/html/body/nas/animrss.html b/web/html/body/nas/animrss.html index 6772959..d283819 100644 --- a/web/html/body/nas/animrss.html +++ b/web/html/body/nas/animrss.html @@ -433,7 +433,11 @@ if (name === '') { name = item.name; } - html += '' + name + '' + item.air_date + '前往番剧计划' + let img='#' + if(item.images!=null){ + img=item.images.small + } + html += '' + name + '' + item.air_date + '前往番剧计划' _tab.push({title: item.name, url: '前往番剧计划'}) }) html += ""