From 357869aac9e84b3b403b18dabb66027acacd647c Mon Sep 17 00:00:00 2001 From: byteblogs168 <598092184@qq.com> Date: Mon, 29 May 2023 11:04:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=201.4.0=201.=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/init/EasyRetryEndListener.java | 5 +- .../core/init/EasyRetryStartListener.java | 5 +- .../common/core/enums/NotifyTypeEnum.java | 35 ----------- .../common/core/util/EasyRetryVersion.java | 58 +++++++++++++++++++ .../retry/server/model/dto/ConfigDTO.java | 4 +- .../support/listener/StartListener.java | 8 +-- .../web/controller/SystemInfoController.java | 7 +-- .../src/main/resources/application.yml | 2 - 8 files changed, 71 insertions(+), 53 deletions(-) delete mode 100644 easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/enums/NotifyTypeEnum.java create mode 100644 easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/util/EasyRetryVersion.java diff --git a/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/init/EasyRetryEndListener.java b/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/init/EasyRetryEndListener.java index 4e3794a2..61984778 100644 --- a/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/init/EasyRetryEndListener.java +++ b/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/init/EasyRetryEndListener.java @@ -1,6 +1,7 @@ package com.aizuda.easy.retry.client.core.init; import com.aizuda.easy.retry.client.core.Lifecycle; +import com.aizuda.easy.retry.common.core.util.EasyRetryVersion; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; @@ -26,8 +27,8 @@ public class EasyRetryEndListener implements ApplicationListener @Autowired private List lifecycleList; - @Value("${version}") - private String version; - @Override public void onApplicationEvent(ContextRefreshedEvent event) { - LogUtils.info(log, "easy-retry-server v{} starting...", version); + LogUtils.info(log, "easy-retry-server v{} starting...", EasyRetryVersion.getVersion()); lifecycleList.forEach(Lifecycle::start); - LogUtils.info(log, "easy-retry-server v{} start completed", version); + LogUtils.info(log, "easy-retry-server v{} start completed", EasyRetryVersion.getVersion()); } } diff --git a/easy-retry-server/src/main/java/com/aizuda/easy/retry/server/web/controller/SystemInfoController.java b/easy-retry-server/src/main/java/com/aizuda/easy/retry/server/web/controller/SystemInfoController.java index 535c824e..7fee8b1e 100644 --- a/easy-retry-server/src/main/java/com/aizuda/easy/retry/server/web/controller/SystemInfoController.java +++ b/easy-retry-server/src/main/java/com/aizuda/easy/retry/server/web/controller/SystemInfoController.java @@ -1,7 +1,7 @@ package com.aizuda.easy.retry.server.web.controller; import com.aizuda.easy.retry.common.core.model.Result; -import org.springframework.beans.factory.annotation.Value; +import com.aizuda.easy.retry.common.core.util.EasyRetryVersion; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -17,11 +17,8 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/system") public class SystemInfoController { - @Value("${version:}") - private String version; - @GetMapping("version") public Result version() { - return new Result<>(version); + return new Result<>(EasyRetryVersion.getVersion()); } } diff --git a/easy-retry-server/src/main/resources/application.yml b/easy-retry-server/src/main/resources/application.yml index 9488677f..2fb17d1f 100644 --- a/easy-retry-server/src/main/resources/application.yml +++ b/easy-retry-server/src/main/resources/application.yml @@ -37,8 +37,6 @@ mybatis-plus: logging: config: classpath:logback-boot.xml -version: @project.version@ #系统版本号 - easy-retry: last-days: 30 # 拉取重试数据的天数 retry-pull-page-size: 100 # 拉取重试数据的每批次的大小