From 5cf6fc3cd5d7460ff1d3d4edef3f588a9733474b Mon Sep 17 00:00:00 2001 From: yutou Date: Thu, 20 May 2021 16:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E5=A4=9ABT=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=89=93=E5=8D=B0=20=E4=BF=AE=E5=A4=8D!=E5=88=B7BT?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E6=97=A0=E6=95=88=E7=9A=84BUG=20BT=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=94=AF=E6=8C=81=E8=BF=87=E6=BB=A4Enable=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/nas/NasApplication.java | 2 +- .../yutou/nas/mybatis/model/BangumiItem.java | 2 + .../nas/mybatis/model/BangumiItemExample.java | 60 +++++++++++++++++++ .../yutou/nas/utils/BTDownloadManager.java | 7 +++ .../com/yutou/nas/utils/QQBotManager.java | 3 +- src/main/resources/mappers/BangumiItemDao.xml | 27 +++++++-- 6 files changed, 94 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yutou/nas/NasApplication.java b/src/main/java/com/yutou/nas/NasApplication.java index cfc1865..979ebd5 100644 --- a/src/main/java/com/yutou/nas/NasApplication.java +++ b/src/main/java/com/yutou/nas/NasApplication.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Import; @Import(BTDownloadManager.class) @SpringBootApplication public class NasApplication { - public static final String version="1.1.0"; + public static final String version="1.1.2"; public static void main(String[] args) { SpringApplication.run(NasApplication.class, args); AppData.defaultMusicPath = (String) ConfigTools.load(ConfigTools.CONFIG, "musicDir"); diff --git a/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java b/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java index a176858..e8c56e2 100644 --- a/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java +++ b/src/main/java/com/yutou/nas/mybatis/model/BangumiItem.java @@ -24,5 +24,7 @@ public class BangumiItem implements Serializable { */ private String titlekey; + private Integer enable; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java b/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java index 77bf9a0..60160f2 100644 --- a/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java +++ b/src/main/java/com/yutou/nas/mybatis/model/BangumiItemExample.java @@ -513,6 +513,66 @@ public class BangumiItemExample { addCriterion("titleKey not between", value1, value2, "titlekey"); return (Criteria) this; } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Integer value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Integer value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Integer value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Integer value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Integer value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Integer value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Integer value1, Integer value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Integer value1, Integer value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + return (Criteria) this; + } } /** diff --git a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java index 442dba8..b3fd71b 100644 --- a/src/main/java/com/yutou/nas/utils/BTDownloadManager.java +++ b/src/main/java/com/yutou/nas/utils/BTDownloadManager.java @@ -44,6 +44,9 @@ public class BTDownloadManager implements ApplicationContextAware { AnimationData data = new AnimationData(); Log.i("BT","启动BT检测,总数:"+list.size()); for (BangumiItem item : list) { + if(item.getEnable()==0){ + continue; + } item.setAuthor(data.nameToValue(item.getAuthor(), true) + ""); item.setCategories(data.nameToValue(item.getCategories(), false) + ""); String url = getRSSUrl(item); @@ -92,7 +95,11 @@ public class BTDownloadManager implements ApplicationContextAware { } else { onSend(null, item); } + }else{ + Log.i("BT","添加到下载器失败:"+item.getString("title")); } + }else{ + Log.i("BT","已下载过:"+item.getString("title")); } } }else{ diff --git a/src/main/java/com/yutou/nas/utils/QQBotManager.java b/src/main/java/com/yutou/nas/utils/QQBotManager.java index beea263..0223971 100644 --- a/src/main/java/com/yutou/nas/utils/QQBotManager.java +++ b/src/main/java/com/yutou/nas/utils/QQBotManager.java @@ -42,7 +42,7 @@ public class QQBotManager { private final static String QQ_AUDIO = "!语音"; private final static String QQ_AUDIO_OPEN_LAMP = "!开灯"; private final static String QQ_AUDIO_OPEN_AIR = "!开空调"; - private final static String QQ_BT_RELOAD = "!刷BT"; + private final static String QQ_BT_RELOAD = "!刷bt"; private final static String QQ_TOOLS_IDEA = "!idea"; private final static String QQ_TOOLS_IDEA_FILE = "!idea>"; } @@ -227,6 +227,7 @@ public class QQBotManager { private void myGroup(String msg) { StringBuilder builder; msg = msg.replace("!", "!").toLowerCase(); + Log.i("QQBot","command = "+msg); switch (msg) { case QQCommands.QQ_OPEN_PC: RedisTools.Consumer.system("openPC", null); diff --git a/src/main/resources/mappers/BangumiItemDao.xml b/src/main/resources/mappers/BangumiItemDao.xml index ea62a20..cb925f2 100644 --- a/src/main/resources/mappers/BangumiItemDao.xml +++ b/src/main/resources/mappers/BangumiItemDao.xml @@ -8,6 +8,7 @@ + @@ -68,7 +69,7 @@ - id, bid, categories, author, title, titleKey + id, bid, categories, author, title, titleKey, `enable` @@ -170,6 +179,9 @@ titleKey = #{record.titlekey,jdbcType=VARCHAR}, + + `enable` = #{record.enable,jdbcType=INTEGER}, + @@ -182,7 +194,8 @@ categories = #{record.categories,jdbcType=VARCHAR}, author = #{record.author,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR}, - titleKey = #{record.titlekey,jdbcType=VARCHAR} + titleKey = #{record.titlekey,jdbcType=VARCHAR}, + `enable` = #{record.enable,jdbcType=INTEGER} @@ -205,6 +218,9 @@ titleKey = #{titlekey,jdbcType=VARCHAR}, + + `enable` = #{enable,jdbcType=INTEGER}, + where id = #{id,jdbcType=INTEGER} @@ -214,7 +230,8 @@ categories = #{categories,jdbcType=VARCHAR}, author = #{author,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR}, - titleKey = #{titlekey,jdbcType=VARCHAR} + titleKey = #{titlekey,jdbcType=VARCHAR}, + `enable` = #{enable,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} \ No newline at end of file