1 プロジェクトを作成する
次のステップ
作成した
ポートとIPを設定する
新しい 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! 哈哈哈";
}
}
main関数にパッケージ呼び出しを導入
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);
}
}
プロジェクト開始後にインターフェースにアクセスする
成功しましたO(∩_∩)Oははは~
インストールしたら、「ファイル」>「設定」>「プラグイン」を選択します。
コーディングを標準化するプラグインである Alibaba Java コーディング ガイドラインをインストールする