From d1aeda012ec9dacee8807682d714998b7a49f5fb Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 8 Jun 2020 09:37:06 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20BotCommandProcess=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9B=A0'getImageById'=E8=BF=81=E7=A7=BB=E5=AF=BC=E8=87=B4'ima?= =?UTF-8?q?ge'=E5=91=BD=E4=BB=A4=E4=B8=8D=E5=8F=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98;=20[Clear]=20CacheStoreCentral=20=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/net/lamgc/cgj/bot/BotCommandProcess.java | 10 ++++++++++ .../net/lamgc/cgj/bot/cache/CacheStoreCentral.java | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/lamgc/cgj/bot/BotCommandProcess.java b/src/main/java/net/lamgc/cgj/bot/BotCommandProcess.java index 5c87633..b7bca5e 100644 --- a/src/main/java/net/lamgc/cgj/bot/BotCommandProcess.java +++ b/src/main/java/net/lamgc/cgj/bot/BotCommandProcess.java @@ -477,6 +477,16 @@ public class BotCommandProcess { log.warn("缓存删除完成."); } + @Command(commandName = "image") + public static String getImageById( + @Argument(name = "$fromGroup") long fromGroup, + @Argument(name = "id") int illustId, + @Argument(name = "quality", force = false) PixivDownload.PageQuality quality, + @Argument(name = "page", force = false, defaultValue = "1") int pageIndex + ) { + return CacheStoreCentral.getImageById(fromGroup, illustId, quality, pageIndex); + } + /** * 举报某一作品 * @param fromGroup 来源群(系统提供) diff --git a/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreCentral.java b/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreCentral.java index e2dddd4..eb7f065 100644 --- a/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreCentral.java +++ b/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreCentral.java @@ -13,7 +13,6 @@ import net.lamgc.cgj.pixiv.PixivSearchBuilder; import net.lamgc.cgj.pixiv.PixivURL; import net.lamgc.cgj.util.URLs; import net.lamgc.utils.base.runner.Argument; -import net.lamgc.utils.base.runner.Command; import net.lamgc.utils.encrypt.MessageDigestUtils; import net.lz1998.cq.utils.CQCode; import org.apache.http.HttpResponse; @@ -98,7 +97,6 @@ public final class CacheStoreCentral { * @param pageIndex 指定页面索引, 从1开始 * @return 如果成功, 返回BotCode, 否则返回错误信息. */ - @Command(commandName = "image") public static String getImageById( @Argument(name = "$fromGroup") long fromGroup, @Argument(name = "id") int illustId,