From 03185a5a63ff1f1a0e29f6e73c96133d4aa512ba Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 9 Dec 2022 10:13:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?:art:=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VisitableThreadPoolTaskExecutor.java | 3 +- .../forest/core/result/GlobalResult.java | 2 +- .../core/service/redis/RedisService.java | 6 ++-- .../service/redis/impl/RedisServiceImpl.java | 6 ++-- .../com/rymcu/forest/task/BaiDuCronTask.java | 31 ------------------- 5 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 src/main/java/com/rymcu/forest/task/BaiDuCronTask.java diff --git a/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java b/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java index 8e47aea..bc12f9a 100644 --- a/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java +++ b/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java @@ -19,9 +19,8 @@ import java.util.concurrent.ThreadPoolExecutor; public class VisitableThreadPoolTaskExecutor extends ThreadPoolTaskExecutor { private static final Logger logger = LoggerFactory.getLogger(VisitableThreadPoolTaskExecutor.class); - private void showThreadPoolInfo(String prefix){ + private void showThreadPoolInfo(String prefix) { ThreadPoolExecutor threadPoolExecutor = getThreadPoolExecutor(); - logger.info("{}, {},taskCount [{}], completedTaskCount [{}], activeCount [{}], queueSize [{}]", this.getThreadNamePrefix(), prefix, diff --git a/src/main/java/com/rymcu/forest/core/result/GlobalResult.java b/src/main/java/com/rymcu/forest/core/result/GlobalResult.java index 2e52f6f..faab103 100644 --- a/src/main/java/com/rymcu/forest/core/result/GlobalResult.java +++ b/src/main/java/com/rymcu/forest/core/result/GlobalResult.java @@ -21,7 +21,7 @@ public class GlobalResult { } public static GlobalResult newInstance() { - return new GlobalResult(); + return new GlobalResult<>(); } } diff --git a/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java b/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java index c005437..e5f64bf 100644 --- a/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java +++ b/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java @@ -134,7 +134,7 @@ public interface RedisService { * @param expireTime 缓存内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ - String set(String key, Object obj, int expireTime); + String set(String key, Object obj, long expireTime); /** @@ -145,7 +145,7 @@ public interface RedisService { * @param expireTime 缓存内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ - String set(String key, String value, int expireTime); + String set(String key, String value, long expireTime); /** * 写入/修改 缓存内容 @@ -212,7 +212,7 @@ public interface RedisService { * @param key * @param seconds */ - void setTTL(String key, int seconds); + void setTTL(String key, long seconds); /** * 根据通配符表达式查询key值的set,通配符仅支持* diff --git a/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java b/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java index 6c36f11..7cacb08 100644 --- a/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java +++ b/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java @@ -163,7 +163,7 @@ public class RedisServiceImpl implements RedisService { * @return */ @Override - public String set(String key, Object obj, int expireTime) { + public String set(String key, Object obj, long expireTime) { String value = RedisService.BLANK_CONTENT; if (obj != null) { try { @@ -184,7 +184,7 @@ public class RedisServiceImpl implements RedisService { * @return */ @Override - public String set(String key, String value, int expireTime) { + public String set(String key, String value, long expireTime) { if (StringUtils.isBlank(key)) { logger.warn("Params key is blank!"); return null; @@ -460,7 +460,7 @@ public class RedisServiceImpl implements RedisService { * @param seconds */ @Override - public void setTTL(String key, int seconds) { + public void setTTL(String key, long seconds) { if (seconds < 0) { return; } diff --git a/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java b/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java deleted file mode 100644 index ce7127f..0000000 --- a/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.rymcu.forest.task; - -import com.rymcu.forest.core.constant.ProjectConstant; -import com.rymcu.forest.util.BaiDuUtils; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; - -/** - * @author ronger - */ -//@Component -@Slf4j -public class BaiDuCronTask { - - @Value("${resource.domain}") - private String domain; - @Value(("${env}")) - private String env; - - /** - * 定时推送首页更新 - */ - @Scheduled(cron = "0 0 10,14,18 * * ?") - public void pushHome() { - if (!ProjectConstant.ENV.equals(env)) { - BaiDuUtils.sendUpdateSEOData(domain); - } - } - -} From 1cbd0a33304179e434bf998a1cc086ac800ce11b Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 9 Dec 2022 16:33:54 +0800 Subject: [PATCH 2/9] =?UTF-8?q?:arrow=5Fup:=20=E4=BE=9D=E8=B5=96=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b9014d4..377b4ab 100644 --- a/pom.xml +++ b/pom.xml @@ -56,14 +56,14 @@ com.fasterxml.jackson.core jackson-databind - 2.13.4.2 + 2.14.0 org.mybatis.spring.boot mybatis-spring-boot-starter - 2.2.2 + 3.0.0 @@ -128,7 +128,7 @@ com.alibaba fastjson - 2.0.16 + 2.0.20 @@ -183,7 +183,7 @@ com.alibaba druid-spring-boot-starter - 1.2.14 + 1.2.15 org.apache.logging.log4j @@ -261,12 +261,12 @@ cn.hutool hutool-core - 5.8.9 + 5.8.10 cn.hutool hutool-http - 5.8.9 + 5.8.10 From 364ea1d88103d9f5fe8b519db05da3da9ce61031 Mon Sep 17 00:00:00 2001 From: ronger Date: Thu, 5 Jan 2023 10:21:41 +0800 Subject: [PATCH 3/9] =?UTF-8?q?:art:=20lucene=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/rymcu/forest/lucene/cfg/DefaultConfig.java | 2 +- src/main/java/com/rymcu/forest/lucene/dic/Dictionary.java | 2 +- .../com/rymcu/forest/lucene/util/ArticleIndexUtil.java | 2 +- .../java/com/rymcu/forest/lucene/util/LucenePath.java | 8 ++++---- .../com/rymcu/forest/lucene/util/PortfolioIndexUtil.java | 2 +- .../java/com/rymcu/forest/lucene/util/UserIndexUtil.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/rymcu/forest/lucene/cfg/DefaultConfig.java b/src/main/java/com/rymcu/forest/lucene/cfg/DefaultConfig.java index 92c2312..068143a 100644 --- a/src/main/java/com/rymcu/forest/lucene/cfg/DefaultConfig.java +++ b/src/main/java/com/rymcu/forest/lucene/cfg/DefaultConfig.java @@ -42,7 +42,7 @@ public class DefaultConfig implements Configuration { * 用户自定义字典路径 */ private static final String PATH_USER_DIC = - System.getProperty("user.dir") + "/lucene/userDic/userDic.dic"; + "lucene/userDic/userDic.dic"; /** * 配置属性——扩展字典 */ diff --git a/src/main/java/com/rymcu/forest/lucene/dic/Dictionary.java b/src/main/java/com/rymcu/forest/lucene/dic/Dictionary.java index 51fa7b2..0acb4c8 100644 --- a/src/main/java/com/rymcu/forest/lucene/dic/Dictionary.java +++ b/src/main/java/com/rymcu/forest/lucene/dic/Dictionary.java @@ -53,7 +53,7 @@ public class Dictionary { * 用户自定义词典路径 */ private static final String PATH_USER_DIC = - System.getProperty("user.dir") + "/lucene/userDic/userDic.dic"; + "lucene/userDic/userDic.dic"; /** * 配置对象 */ diff --git a/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java index eaeb772..aa1fc01 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java @@ -24,7 +24,7 @@ public class ArticleIndexUtil { * lucene索引保存目录 */ private static final String PATH = - System.getProperty("user.dir") + LucenePath.ARTICLE_INDEX_PATH; + LucenePath.ARTICLE_INDEX_PATH; /** * 删除所有运行中保存的索引 diff --git a/src/main/java/com/rymcu/forest/lucene/util/LucenePath.java b/src/main/java/com/rymcu/forest/lucene/util/LucenePath.java index d09ba56..4e4414a 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/LucenePath.java +++ b/src/main/java/com/rymcu/forest/lucene/util/LucenePath.java @@ -10,7 +10,7 @@ public final class LucenePath { /** * lucene 目录 */ - public static final String INDEX_PATH = "/lucene/index"; + public static final String INDEX_PATH = "lucene/index"; /** * 文章 lucene 目录 @@ -21,7 +21,7 @@ public final class LucenePath { * 文章增量 lucene 目录 */ public static final String ARTICLE_INCREMENT_INDEX_PATH = - System.getProperty("user.dir") + ARTICLE_INDEX_PATH + "/index777"; + ARTICLE_INDEX_PATH + "/index777"; /** * 用户 lucene 目录 @@ -32,7 +32,7 @@ public final class LucenePath { * 用户增量 lucene 目录 */ public static final String USER_INCREMENT_INDEX_PATH = - System.getProperty("user.dir") + USER_PATH + "/index777"; + USER_PATH + "/index777"; /** * 作品集 lucene 目录 @@ -43,5 +43,5 @@ public final class LucenePath { * 作品集增量 lucene 目录 */ public static final String PORTFOLIO_INCREMENT_INDEX_PATH = - System.getProperty("user.dir") + PORTFOLIO_PATH + "/index777"; + PORTFOLIO_PATH + "/index777"; } diff --git a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java index 7b3f84f..097692e 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java @@ -24,7 +24,7 @@ public class PortfolioIndexUtil { * lucene索引保存目录 */ private static final String PATH = - System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.PORTFOLIO_PATH; + StrUtil.SLASH + LucenePath.PORTFOLIO_PATH; /** * 删除所有运行中保存的索引 diff --git a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java index 9386324..2833e5e 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java @@ -25,7 +25,7 @@ public class UserIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.USER_PATH; + private static final String PATH = StrUtil.SLASH + LucenePath.USER_PATH; /** * 系统运行时索引保存目录 From 3fa510fb125aee0c74ec005ff1dafb4f852c0575 Mon Sep 17 00:00:00 2001 From: ronger Date: Thu, 5 Jan 2023 10:26:47 +0800 Subject: [PATCH 4/9] :bookmark: version: 0.0.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 377b4ab..1856fef 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.rymcu forest - 0.0.1 + 0.0.2 war forest forest(森林) —— 一款现代化的知识社区后台项目,使用 SpringBoot + Shiro + MyBatis + JWT + Redis 实现。 From d9d9a29bb34fce2fda76b2a0ff1a93c4a48c8f68 Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 6 Jan 2023 14:12:43 +0800 Subject: [PATCH 5/9] =?UTF-8?q?:art:=20lucene=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java | 3 +-- src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java index 097692e..fe02abe 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java @@ -23,8 +23,7 @@ public class PortfolioIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = - StrUtil.SLASH + LucenePath.PORTFOLIO_PATH; + private static final String PATH = LucenePath.PORTFOLIO_PATH; /** * 删除所有运行中保存的索引 diff --git a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java index 2833e5e..db7f9cf 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java @@ -25,7 +25,7 @@ public class UserIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = StrUtil.SLASH + LucenePath.USER_PATH; + private static final String PATH = LucenePath.USER_PATH; /** * 系统运行时索引保存目录 From 741e7fb4fee533af9f82bac41a04fc09613dd0d0 Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 6 Jan 2023 14:32:24 +0800 Subject: [PATCH 6/9] :bug: IORuntimeException: Path [lucene/index/xxx] is not directory! --- .../com/rymcu/forest/lucene/util/PortfolioIndexUtil.java | 6 +++++- .../java/com/rymcu/forest/lucene/util/UserIndexUtil.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java index fe02abe..eddc824 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java @@ -53,7 +53,11 @@ public class PortfolioIndexUtil { System.out.println("创建单个索引"); IndexWriter writer; try { - writer = IndexUtil.getIndexWriter(LucenePath.PORTFOLIO_INCREMENT_INDEX_PATH, false); + boolean create = true; + if (FileUtil.exist(LucenePath.PORTFOLIO_INCREMENT_INDEX_PATH)) { + create = false; + } + writer = IndexUtil.getIndexWriter(LucenePath.PORTFOLIO_INCREMENT_INDEX_PATH, create); Document doc = new Document(); doc.add(new StringField("id", t.getIdPortfolio() + "", Field.Store.YES)); doc.add(new TextField("title", t.getPortfolioTitle(), Field.Store.YES)); diff --git a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java index db7f9cf..aed1f7a 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java @@ -60,7 +60,11 @@ public class UserIndexUtil { System.out.println("创建单个索引"); IndexWriter writer; try { - writer = IndexUtil.getIndexWriter(INDEX_PATH, false); + boolean create = true; + if (FileUtil.exist(LucenePath.USER_INCREMENT_INDEX_PATH)) { + create = false; + } + writer = IndexUtil.getIndexWriter(INDEX_PATH, create); Document doc = new Document(); doc.add(new StringField("id", t.getIdUser() + "", Field.Store.YES)); doc.add(new TextField("nickname", t.getNickname(), Field.Store.YES)); From b1ac559f394c0c14d2526cfb2fe53251e6959cdd Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 6 Jan 2023 15:06:57 +0800 Subject: [PATCH 7/9] :bug: IORuntimeException: Path [lucene/index/xxx] is not directory! --- .../java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java | 4 ++-- .../java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java | 3 ++- src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java index aa1fc01..b9b19a4 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/ArticleIndexUtil.java @@ -1,6 +1,7 @@ package com.rymcu.forest.lucene.util; import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; import com.rymcu.forest.lucene.model.ArticleLucene; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -23,8 +24,7 @@ public class ArticleIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = - LucenePath.ARTICLE_INDEX_PATH; + private static final String PATH = System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.ARTICLE_INDEX_PATH; /** * 删除所有运行中保存的索引 diff --git a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java index eddc824..7e255e4 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/PortfolioIndexUtil.java @@ -23,7 +23,7 @@ public class PortfolioIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = LucenePath.PORTFOLIO_PATH; + private static final String PATH = System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.PORTFOLIO_PATH; /** * 删除所有运行中保存的索引 @@ -81,6 +81,7 @@ public class PortfolioIndexUtil { try { writer = IndexUtil.getIndexWriter(each.getAbsolutePath(), false); writer.deleteDocuments(new Term("id", String.valueOf(id))); + writer.forceMerge(1); writer.forceMergeDeletes(); // 强制删除 writer.commit(); writer.close(); diff --git a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java index aed1f7a..d876119 100644 --- a/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java +++ b/src/main/java/com/rymcu/forest/lucene/util/UserIndexUtil.java @@ -25,7 +25,7 @@ public class UserIndexUtil { /** * lucene索引保存目录 */ - private static final String PATH = LucenePath.USER_PATH; + private static final String PATH = System.getProperty("user.dir") + StrUtil.SLASH + LucenePath.USER_PATH; /** * 系统运行时索引保存目录 @@ -89,6 +89,7 @@ public class UserIndexUtil { try { writer = IndexUtil.getIndexWriter(each.getAbsolutePath(), false); writer.deleteDocuments(new Term("id", id)); + writer.forceMerge(1); writer.forceMergeDeletes(); // 强制删除 writer.commit(); writer.close(); From 20bfa3296ee9476badd12b7f71789e7f359c6485 Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 30 Jan 2023 19:39:33 +0800 Subject: [PATCH 8/9] =?UTF-8?q?:art:=20=E9=A2=98=E5=BA=93=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=9C=B0=E5=9D=80=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/forest/answer/AnswerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rymcu/forest/answer/AnswerController.java b/src/main/java/com/rymcu/forest/answer/AnswerController.java index 3b4c6f8..0df99a0 100644 --- a/src/main/java/com/rymcu/forest/answer/AnswerController.java +++ b/src/main/java/com/rymcu/forest/answer/AnswerController.java @@ -20,7 +20,7 @@ import java.util.Map; @RequestMapping("/api/v1/answer") public class AnswerController { - private final static String ANSWER_API_URL = "http://1.116.175.112:8089/question"; + private final static String ANSWER_API_URL = "https://test.rymcu.com/subject/question"; @GetMapping("/today") public GlobalResult today() { From fee63477b8a853cf457a3905e4b218adeecded26 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 31 Jan 2023 19:13:09 +0800 Subject: [PATCH 9/9] =?UTF-8?q?:art:=20=E9=A2=98=E5=BA=93=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=9C=B0=E5=9D=80=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rymcu/forest/answer/AnswerController.java | 4 +- src/main/resources/application-dev.yml | 41 ++++--------------- src/main/resources/application.yml | 9 +--- 3 files changed, 11 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/rymcu/forest/answer/AnswerController.java b/src/main/java/com/rymcu/forest/answer/AnswerController.java index 0df99a0..910a21a 100644 --- a/src/main/java/com/rymcu/forest/answer/AnswerController.java +++ b/src/main/java/com/rymcu/forest/answer/AnswerController.java @@ -8,6 +8,7 @@ import com.rymcu.forest.entity.User; import com.rymcu.forest.enumerate.TransactionEnum; import com.rymcu.forest.util.HttpUtils; import com.rymcu.forest.util.UserUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import java.util.HashMap; @@ -20,7 +21,8 @@ import java.util.Map; @RequestMapping("/api/v1/answer") public class AnswerController { - private final static String ANSWER_API_URL = "https://test.rymcu.com/subject/question"; + @Value("${resource.answer-api-url}") + private String ANSWER_API_URL; @GetMapping("/today") public GlobalResult today() { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 6ab975c..d2f1bea 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -34,7 +34,7 @@ spring: test-while-idle: true test-on-borrow: false test-on-return: false - connection-properties: config.decrypt=true;config.decrypt.key=${publickey} + connection-properties: config.decrypt=true;config.decrypt.key=${publicKey} filters: config,stat max-pool-prepared-statement-per-connection-size: 100 stat-view-servlet: @@ -50,29 +50,6 @@ spring: port: 465 username: service@rymcu.com password: 4W3tCXdyk0Gm -wx: - open: - componentAppId: wx9c4a7dfb3238d5f6 - componentSecret: e32a6f75ab6b746ec3ae38a39a79ba22 - componentToken: rymcu - componentAesKey: NWIwMDQyZjU0YWI2NGFlZThkOWZhZTg3NTg4NzQwN2E - mp: - configs: - - appId: wxf085386aa07c0857 - secret: aabd075d2851764714fd14a0d0b1b8b4 - token: rymcu - aesKey: lvn3mMSnFOvbnIJVNhHQqjWb9swe66L1xIcerJSs0fm - - appId: wxa49093339a5a822b - secret: 29e9390e6d58d57a2b2a2350dbee8754 - token: qwert - aesKey: - miniapp: - configs: - - appid: wxb4fff78a6b878cf7 - secret: c8735d0ccc8497b8509dc2762246cb37 - token: #微信小程序消息服务器配置的token - aesKey: #微信小程序消息服务器配置的EncodingAESKey - msgDataFormat: JSON env: dev logging: file: @@ -85,16 +62,12 @@ server: servlet: context-path: /forest max-http-header-size: 1048576 + shutdown: graceful + tomcat: + reject-illegal-header: false version: 1.0 resource: - domain: http://test.rymcu.com - file-path: http://test.rymcu.com + domain: https://test.rymcu.com + file-path: https://test.rymcu.com pic-path: /opt/nebula/static -baidu: - data: - site: https://rymcu.com - token: 9cdKR6bVCJzxDEJS - ai: - appId: 22891829 - appKey: HKxdO8ioaUmltZh0eaOVMsmW - secretKey: GXOtl3XtiIkVA3CPsc3c29Pqa4V290Yr \ No newline at end of file + answer-api-url: https://test.rymcu.com/subject/question diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 99c9014..6c1d560 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -71,12 +71,5 @@ resource: domain: http://yourdomain.com # 网站域名 file-path: http://yourdomain.com # 上传文件前缀域名 pic-path: /yoursrc/xx/nebula/static # 上传文件存储地址 -baidu: - data: - site: https://yourdomain.com # 百度搜索绑定网站域名 - token: xxxx - ai: - appId: xxx # 百度AI-文字识别 应用 appId - appKey: xxxx # 百度AI-文字识别 应用 appKey - secretKey: xxxx # 百度AI-文字识别 应用 secretKey + answer-api-url: https://test.rymcu.com/subject/question