读取application文件在application.yml或者properties文件中添加:user.address=chinauser.company=demouser.name=让我康康1、使用@Value注解读取直接 代码如下:packageim.homeapi.controller;importorg.springframework.beans.factory.annotation.Value;importorg.omg.CORBA.PUBLIC_MEMBER;importorg.springframework.web.bind.annotation.RestController;importorg.springframework.web.bind.annotation.RequestMapp...
继续阅读 >
分类:SpringBoot读取配置数据
读取application文件在application.yml或者properties文件中添加:user.address=chinauser.company=demouser.name=让我康康1、使用@Value注解读取直接 代码如下:packageim.homeapi.controller;importorg.springframework.beans.factory.annotation.Value;importorg.omg.CORBA.PUBLIC_MEMBER;importorg.springframework.web.bind.annotation.RestController;importorg.springframework.web.bind.annotation.RequestMapp...
继续阅读 >