IDEA Spring Boot Create Project

1 Create a project

Next step

Created

Set port and IP

New HelloController

package com.young.springboot3;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class HelloController {
    @RequestMapping("/hello")
    public String hello(){
        return "Hello World! 哈哈哈";
    }
}

Introduce package call in main function

package com.young.springboot3;

import com.young.springboot3.HelloController;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Springboot3Application {

    public static void main(String[] args) {
        SpringApplication.run(HelloController.class,args);
    }

}

Access the interface after starting the project

http://localhost:8089/hello

Success, O(∩_∩)O haha~

Once installed, select File>Settings>Plugins

Install Alibaba Java Coding Guidelines, a plug-in to standardize coding

Guess you like

Origin blog.csdn.net/m0_37137902/article/details/128841167