This commit is contained in:
parent
34a13b4be9
commit
c754ef9397
|
@ -0,0 +1,20 @@
|
|||
package com.ruoyi.system.controller.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@RestController
|
||||
public class NewsController {
|
||||
@Autowired
|
||||
RestTemplate restTemplate;
|
||||
@RequestMapping("getnews")
|
||||
@Anonymous
|
||||
public String getnews(){
|
||||
String url = "http://106.53.194.250:5001/newslist";
|
||||
String result = restTemplate.getForEntity(url,String.class).getBody();
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue