feat(profile): 添加配置文件静态类绑定功能,可根据环境加载特定文件#530
Open
kolnick wants to merge 8 commits into
Open
Conversation
Contributor
kolnick
commented
Jan 22, 2026
- 新增 ProfileStaticBinder 类实现配置到静态字段的自动绑定
- 新增 DbProps 测试类用于验证静态绑定功能
- 扩展 ProfileManager 支持特定环境配置文件加载
- 重构 Profile.load 方法提取为独立方法便于复用
- 新增 ResourcePatternResolverProfile.getFileURL 方法按文件名查找资源
- 新增 ProfileStaticBinder 类实现配置到静态字段的自动绑定 - 新增 DbProps 测试类用于验证静态绑定功能 - 扩展 ProfileManager 支持特定环境配置文件加载 - 重构 Profile.load 方法提取为独立方法便于复用 - 新增 ResourcePatternResolverProfile.getFileURL 方法按文件名查找资源
- 移除实验性功能代码 - 新增 AbstractStaticBinder 抽象类统一配置绑定逻辑 - 添加 EnvStaticBinder 支持环境变量和配置文件合并绑定 - 修改 Profile 类中 map 类型从 Object 改为 String - 更新 ProfileManager 中配置绑定调用方式 - 重构 ProfileStaticBinder 继承 AbstractStaticBinder 基类 - 在服务配置文件中新增 HttpExternalJoinSelector
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 39 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
Author
|
你好你发的邮件我已收到谢谢!Your message has received,thank you for your mail.
|
Owner
|
缺少 HttpExternalJoinSelector |
- 引入 Lombok Getter 注解以自动生成 getter 方法 - 为 Profile 类的 map 字段添加 @Getter 注解 - 简化代码结构并提高可读性
- 添加 AbstractStaticBinder 抽象类,提供通用的数据绑定逻辑 - 添加 EnvStaticBinder 类,支持从环境变量和配置文件绑定数据 - 添加 Profile 类,用于配置文件管理域操作 - 修改 ProfileManager 的 loadEnvFileFillStaticClass 方法,支持多环境配置加载 - 更新 ProfileStaticBinder 以支持 Object 类型配置值 - 优化配置加载日志输出和错误处理机制
- 实现 ProfileManager 配置管理类,支持多环境配置加载 - 添加主配置加载功能,支持逗号分隔的目录列表 - 实现环境变量覆盖机制,系统环境变量可覆盖配置项 - 提供配置文件解析和合并功能,支持多环境配置覆盖 - 集成静态类绑定功能,自动将配置映射到静态字段 - 添加资源路径解析器,支持从 resources/conf 目录加载配置 - 实现无锁化并发安全的配置缓存机制
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.