This commit is contained in:
alittlekang 2024-11-29 23:04:30 +08:00
parent 34a13b4be9
commit c754ef9397
1 changed files with 20 additions and 0 deletions

View File

@ -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;
}
}