DEV Community

kaede
kaede

Posted on

Kotlin Springboot アノテーション

アノテーション

https://zenn.dev/tm35/articles/05e74b6dd9f831

tm35 さんの記事を参考にした

これはなに?

クラスの上につけて、クラスに機能をつけるもの。

@GetMapping ( "/your/root" )

https://zenn.dev/tm35/articles/05e74b6dd9f831#%40getmapping(%22%E3%83%91%E3%82%B9%22)

その URL に来たときに下の function が動くようになる。

@PostMapping, @DeleteMapping

その URL で POST や DELETE が動いた時に
下の function が動くようになる。

@RequestParam

https://zenn.dev/tm35/articles/05e74b6dd9f831#%40requestparam

引数にこれを書くと、URL からクエリを取って変数に入れられる。
@GetMapping と一緒に使うもの。

Top comments (0)