框架开发.idea配置项提示
场景:
框架的配置项有许多,方便用户填写参数,使用"."可弹出配置项提示,类似这种:
最直接的方法就是在你项目的src/main/resources/META-INF
下,创建json文件, spring-configuration-metadata.json:
{"properties": [{"name": "config.name", //配置名称"type": "java.lang.String", //配置类型"description": "The name of the application" //描述信息"sourceType": "com.test.config" //对应的配置类},{"name": "config.age","type": "java.lang.Integer","description": "The age of the application""sourceType": "com.test.config" }]
}