注入值注解
从常量中读取值
@ConfigValue
从配置中读取值
属性名称 | 说明 | |
---|---|---|
name | 配置名,支持、@currentServer 等用法 |
|
default | 配置名,支持@app 、@currentServer 等用法 |
不存在时,返回的默认值 |
@RequestInject
对象注入,使用:
同@Inject
属性名称 | 说明 |
---|---|
class | 类名,或者传入对象,比如可以使用 @Inject 、@RequestInject 再次值注入 |
method | 方法名 |
用法示例
@DbInject
注入数据库对象
注入Redis对象
属性名称 | 说明 |
---|---|
name | 连接池名,如果为null 则取配置 |