- 安裝idea(自行百度)
- 使用idea 創建工程
添加Controller
package com.it11.zzf.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zzf
* @Title: TestController
* @ProjectName demo
* @Description: TODO
* @date 2020/3/28:36 PM
*/
@RestController
@RequestMapping("test")
public class TestController {
@RequestMapping("/hello")
public Object helle(){
return "hello it11";
}
}
添加運行類:
package com.it11.zzf;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zzf
* @Title: App
* @ProjectName demo
* @Description: TODO
* @date 2020/3/28:42 PM
*/
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class);
}
}
運行App主類效果: