从配置文件中读取参数

This commit is contained in:
li5454yong 2017-02-06 20:50:48 +08:00
parent 84011c846b
commit 780a72e75f
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package com.lxg.springboot.controller;
import com.lxg.springboot.http.HttpAPIService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* Created by lxg
* on 2017/2/6.
*/
@RestController
public class HttpClientController {
@Resource
private HttpAPIService httpAPIService;
@RequestMapping("httpclient")
public String test() throws Exception {
String str = httpAPIService.doGet("http://www.baidu.com");
System.out.println(str);
return "hello";
}
}