1.创建空项目
file->new->project->maven->next
自定义名字,下一步
自定义名字,然后next,创建好项目
2.在pom.xml中加入依赖
org.springframework.boot spring-boot-starter-parent 1.3.3.RELEASE org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-web org.projectlombok lombok 1.16.6 3.在main.java目录下创建目录并创建Application.java类和controller.java类 目录级别例如: Application.java类 org.springframework.boot spring-boot-maven-plugin
@SpringBootApplication public class Application { public static void main(String []args){ SpringApplication.run(Application.class,args); } } Controller.java类
@RestController @Slf4j public class HanlpController { @RequestMapping(value = "/getMechanism",method = RequestMethod.POST) public String getMechanism(String article){ System.out.println(article); return "success"; } } 4.启动项目