From 6cc210a25ed29f91cda989a7c86f08e1fbab994b Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sat, 8 May 2021 23:08:21 +0800 Subject: [PATCH] update --- .../java/com/yutou/tools/Tools/GoogleAccount.java | 3 ++- src/main/java/com/yutou/tools/ToolsApplication.java | 4 ++-- .../com/yutou/tools/bangumi/AnimationController.java | 11 +++++++---- src/main/java/com/yutou/tools/utils/RedisTools.java | 6 ++++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/yutou/tools/Tools/GoogleAccount.java b/src/main/java/com/yutou/tools/Tools/GoogleAccount.java index 0036af6..298d352 100644 --- a/src/main/java/com/yutou/tools/Tools/GoogleAccount.java +++ b/src/main/java/com/yutou/tools/Tools/GoogleAccount.java @@ -28,8 +28,9 @@ public class GoogleAccount { * @param s window size - must be >=1 and <=17. Other values are ignored */ public void setWindowSize(int s) { - if (s >= 1 && s <= 17) + if (s >= 1 && s <= 17) { window_size = s; + } } /** diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index 9c599c9..17eb2aa 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -5,10 +5,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.1.0"; + public static final String version="1.1.1"; public static void main(String[] args) { System.out.println("当前版本号:" + version); SpringApplication.run(ToolsApplication.class, args); } -} +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/bangumi/AnimationController.java b/src/main/java/com/yutou/tools/bangumi/AnimationController.java index 595c1d6..de5c2d7 100644 --- a/src/main/java/com/yutou/tools/bangumi/AnimationController.java +++ b/src/main/java/com/yutou/tools/bangumi/AnimationController.java @@ -29,14 +29,17 @@ public class AnimationController { @RequestMapping(value = "rss/data.do", method = RequestMethod.GET) public String getAnimList(String key,String type,String team, int page) { boolean isNull = key.length() == 0; - if(!StringUtils.isEmpty(type)&&type.length()>2) - type=type.substring(2); - if(!StringUtils.isEmpty(team)&&team.length()>2) + if(!StringUtils.isEmpty(type)&&type.length()>2) { + type=type.substring(2); + } + if(!StringUtils.isEmpty(team)&&team.length()>2) { team=team.substring(2); + } String[] keys = key.split(" "); JSONArray items = null; - if (!isNull) + if (!isNull) { items = new AnimationData().bangumiList(page,type,team, keys); + } JSONObject json = new JSONObject(); if (items != null) { json.put("data", items); diff --git a/src/main/java/com/yutou/tools/utils/RedisTools.java b/src/main/java/com/yutou/tools/utils/RedisTools.java index fe1d361..2fbaa32 100644 --- a/src/main/java/com/yutou/tools/utils/RedisTools.java +++ b/src/main/java/com/yutou/tools/utils/RedisTools.java @@ -188,16 +188,18 @@ public class RedisTools { private static boolean init = false; public static void initRedisPoolSub() { - if (init) + if (init) { return; + } init = true; System.out.println("初始化订阅"); new Thread(new Runnable() { @Override public void run() { Jedis jedis = getPoolRedis(); - if (jedis != null) + if (jedis != null) { jedis.psubscribe(new Consumer(), "*"); + } } }).start();