From 672f100c7cea439123183f74a9fad27146083724 Mon Sep 17 00:00:00 2001 From: QAIU <736226400@qq.com> Date: Mon, 16 Dec 2024 19:01:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=8A=A8=E6=80=81UA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parser/src/main/java/cn/qaiu/entity/ShareLinkInfo.java | 6 +++++- .../src/main/java/cn/qaiu/lz/web/controller/ParserApi.java | 1 + web-service/src/main/resources/app-dev.yml | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/parser/src/main/java/cn/qaiu/entity/ShareLinkInfo.java b/parser/src/main/java/cn/qaiu/entity/ShareLinkInfo.java index 96ffa01..371db00 100644 --- a/parser/src/main/java/cn/qaiu/entity/ShareLinkInfo.java +++ b/parser/src/main/java/cn/qaiu/entity/ShareLinkInfo.java @@ -77,7 +77,11 @@ public void setStandardUrl(String standardUrl) { public String getCacheKey() { // 将type和shareKey组合成一个字符串作为缓存key - return type + ":" + shareKey; + String key = type + ":" + shareKey; + if (type.equals("p115")) { + key += ("_" + otherParam.get("UA").toString().hashCode()); + } + return key; } public ShareLinkInfo setOtherParam(Map otherParam) { diff --git a/web-service/src/main/java/cn/qaiu/lz/web/controller/ParserApi.java b/web-service/src/main/java/cn/qaiu/lz/web/controller/ParserApi.java index 29e39e6..b5f33f1 100644 --- a/web-service/src/main/java/cn/qaiu/lz/web/controller/ParserApi.java +++ b/web-service/src/main/java/cn/qaiu/lz/web/controller/ParserApi.java @@ -59,6 +59,7 @@ public Future parse(HttpServerRequest request, String pwd) { .apiLink(getDownLink(parserCreate, true)) .shareLinkInfo(shareLinkInfo).build(); // 解析次数统计 + shareLinkInfo.getOtherParam().put("UA",request.headers().get("user-agent")); cacheManager.getShareKeyTotal(shareLinkInfo.getCacheKey()).onSuccess(res -> { if (res != null) { build.setCacheHitTotal(res.get("hit_total") == null ? 0: res.get("hit_total")); diff --git a/web-service/src/main/resources/app-dev.yml b/web-service/src/main/resources/app-dev.yml index d7bfe7b..a7cce94 100644 --- a/web-service/src/main/resources/app-dev.yml +++ b/web-service/src/main/resources/app-dev.yml @@ -63,6 +63,7 @@ cache: mne: 30 mqq: 30 mkg: 30 + p115: 5 # httpClient静态代理服务器配置(外网代理) proxy: