最终效果
在idea中
package com.fqs.helloworld.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @GetMapping("/hello") public String hello(){ return "hello world"; } }
package com.fqs.helloworld; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class HelloworldApplicationTests { @Test void contextLoads() { } }
标签:RestController,springboot,项目,启动,springframework,org,import,hello From: https://www.cnblogs.com/haha1988/p/17712777.html