package com.example.aixiuserver.controller; import jakarta.annotation.Resource; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; @RestController public class AIxiuController{ @Resource private RestTemplate restTemplate; @PostMapping("/conversation") public ResponseEntity forwardRequest(HttpMethod method, HttpEntity requestEntity) { String url = "http://144.34.160.15:3000/conversation"; return restTemplate.exchange(url, method, requestEntity, String.class); } }