From d5f7db6873c1b9804cddd381f58e719344fae903 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: Mon, 24 Jul 2023 13:33:36 +0800
Subject: [PATCH] 配置文件修改
---
src/main/java/com/gk/hotwork/Config/attachment/InitConfig.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/gk/hotwork/Config/attachment/InitConfig.java b/src/main/java/com/gk/hotwork/Config/attachment/InitConfig.java
new file mode 100644
index 0000000..61ce9db
--- /dev/null
+++ b/src/main/java/com/gk/hotwork/Config/attachment/InitConfig.java
@@ -0,0 +1,40 @@
+
+package com.gk.hotwork.Config.attachment;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.lang.reflect.Field;
+
+/**
+ * @author :
+ * @description:项目启动就执行的工具类
+ * @modified By:
+ * @version: 1.0
+ */
+@Slf4j
+@Component
+public class InitConfig implements InitializingBean {
+
+ @Resource
+ FilePathConfig filePathConfig;
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ log.info("文件配置路径开始加载");
+ reflect(filePathConfig);
+ log.info("设置模块文件路径缓存");
+ }
+
+ public static void reflect(Object o) throws IllegalAccessException {
+ Class cls = o.getClass();
+ Field[] fields = cls.getDeclaredFields();
+ for (int i = 0; i < fields.length; i++) {
+ Field f = fields[i];
+ f.setAccessible(true);
+ log.info(f.getName() + "----:" + f.get(o));
+ }
+ }
+}
--
Gitblit v1.9.2