Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在springboot中能否获取到classpath:simbot-bots/xxx.json的某个配置项? #705

Closed
axiangcoding opened this issue Jun 26, 2023 · 4 comments
Assignees
Labels
模块:boot 与boot模块相关的 疑问 一个疑问

Comments

@axiangcoding
Copy link

版本号

v3.1.0

涉及的编程语言

Java

涉及的组件库

No response

疑问描述

在springboot中能否获取到classpath:simbot-bots/xxx.json的某个配置项?我希望在同一个地方定义和bot相关的配置项,但是不确定在springboot的其他位置能否获取到这些配置项?

@axiangcoding axiangcoding added the 疑问 一个疑问 label Jun 26, 2023
@ForliyScarlet ForliyScarlet added the 等待确认 等待负责人员的确认 label Jun 26, 2023
@ForteScarlet
Copy link
Member

无法像 Spring 自身的配置那样直接获取具体配置项。如有需要建议直接自行解析,或直接配置在 Spring 的配置文件中。

@ForteScarlet ForteScarlet added 等待反馈 等待发起者的反馈 模块:boot 与boot模块相关的 and removed 等待确认 等待负责人员的确认 labels Jun 26, 2023
@axiangcoding
Copy link
Author

无法像 Spring 自身的配置那样直接获取具体配置项。如有需要建议直接自行解析,或直接配置在 Spring 的配置文件中。

是否有考虑在json中支持对环境变量的解析,形如

{
  "client_id": "${BOT_CLIENT_ID}"
}

这样对容器化的程序部署比较友好,而且也避免了将开发过程中的敏感信息误传到公开仓库中的问题

@ForliyScarlet ForliyScarlet added 等待确认 等待负责人员的确认 and removed 等待反馈 等待发起者的反馈 labels Jun 26, 2023
@ForteScarlet
Copy link
Member

是否有考虑在json中支持对环境变量的解析

@ForteScarlet ForteScarlet removed the 等待确认 等待负责人员的确认 label Jun 26, 2023
@axiangcoding
Copy link
Author

是否有考虑在json中支持对环境变量的解析

我可以协助处理这个问题,不过我还需要阅读下代码,我对kt不是很熟,而且是第一次接触simbot。相关问题到 simple-robot/simbot-component-kook#100 讨论

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
模块:boot 与boot模块相关的 疑问 一个疑问
Projects
None yet
Development

No branches or pull requests

3 participants