在对应的Controller上的requestMapping中添加:
@RestController
@EnableAutoConfiguration
@RequestMapping(value = "/", produces = "application/json; charset=utf-8")
public class hello {
@RequestMapping("/")
public String home() {
return "Hisdfds士大夫";
}
public static void main(String[] args) {
SpringApplication.run(hello.class, args);
}
}
时间: 2024-12-15 07:00:16