diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/NewsController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/NewsController.java new file mode 100644 index 0000000..f76b562 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/NewsController.java @@ -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; + } +}