时间:2022-12-09 09:57:22 | 栏目:JAVA代码 | 点击:次
老规矩,点击Create New Project






在com.demo.springbootquickdemo包下创建controller包,在controller包下创建类QuickDemoController,内容如下:
package com.demo.springbootquickdemo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Controller和@RequestBody的结合
*/
@RestController
public class QuickDemoController {
@RequestMapping("hello")
public String hello(){
return "hello world,spring-boot quick";
}
}

运行完之后在浏览器输入http://localhost:8080/hello,结果:

如何在idea中添加Spring Initializr工具
新手在刚刚安装idea工具后,打算构建一个SpringCloud工程,却发现找不到构建工程的Spring Initializr工具。
如下图:

接下来我们需要手动给idea下载Spring Initializr所需要的插件


这时候就能看到Spring Initializr工具了。
