/spring-restapi

๐Ÿ›‹๏ธ ์Šคํ”„๋ง ๊ธฐ๋ฐ˜ REST API ํ•™์Šต ๋ฐ ๊ฐœ๋ฐœ ๐Ÿ›‹๏ธ

Primary LanguageJava

spring-restapi

Java_11 Spring_Boot Spring_Data_JPA Spring_Security Spring_HATEOAS Spring_REST_Docs Maven PostgreSQL

์Šคํ”„๋ง ๊ธฐ๋ฐ˜ REST API ํ•™์Šต ๋ฐ ๊ฐœ๋ฐœ

๋‹ค์–‘ํ•œ ์Šคํ”„๋ง ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ•˜์—ฌ Self-Describtive Message์™€ HATEOAS(Hypermedia as the engine of application state)๋ฅผ ๋งŒ์กฑํ•˜๋Š” REST API๋ฅผ ๊ฐœ๋ฐœํ•ฉ๋‹ˆ๋‹ค.

์ด์‘์ค€๋‹˜๊ป˜์„œ 2017๋…„ ๋„ค์ด๋ฒ„๊ฐ€ ์ฃผ๊ด€ํ•œ Deview๋ผ๋Š” ๊ฐœ๋ฐœ์ž ์ปจํผ๋Ÿฐ์Šค์—์„œ โ€˜๊ทธ๋Ÿฐ REST API๋กœ ๊ดœ์ฐฎ์€๊ฐ€โ€™ ๋ผ๋Š” ๋ฐœํ‘œ๋ฅผ ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ฐœํ‘œ์˜ ํ•ต์‹ฌ์€ ํ˜„์žฌ REST API๋กœ ๋ถˆ๋ฆฌ์šฐ๋Š” ๋Œ€๋ถ€๋ถ„์˜ API๊ฐ€ ์‹ค์ œ๋กœ๋Š” ๋กœ์ด ํ•„๋”ฉ์ด ์ •์˜ํ•œ REST๋ฅผ ๋”ฐ๋ฅด๊ณ  ์žˆ์ง€ ์•Š์œผ๋ฉฐ, ๊ทธ ์ค‘์—์„œ๋„ ํŠนํžˆ Self-Describtive Message์™€ HATEOAS๊ฐ€ ์ง€์ผœ์ง€๊ณ  ์žˆ์ง€ ์•Š์Œ์„ ์ง€์ ํ–ˆ๊ณ  ๊ทธ์— ๋Œ€ํ•œ ๋Œ€์•ˆ์„ ์ œ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ฐœ๋ฐœํ™˜๊ฒฝ

ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • Java11
  • Maven
  • Spring Boot
  • Spring Data JPA
  • Spring HATEOAS
  • Spring REST Docs
  • Spring Security OAuth2

๋˜ํ•œ ๊ฐœ๋ฐœ์€ ํ…Œ์ŠคํŠธ ์ฃผ๋„ ๊ฐœ๋ฐœ(TDD)๋กœ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

ํ•™์Šต ๋ชฉํ‘œ

  • Self-Describtive Message์™€ HATEOAS๋ฅผ ๋งŒ์กฑํ•˜๋Š” REST API๋ฅผ ์ดํ•ดํ•ฉ๋‹ˆ๋‹ค.
  • ๋‹ค์–‘ํ•œ ์Šคํ”„๋ง ๊ธฐ์ˆ ์„ ํ™œ์šฉํ•˜์—ฌ REST API๋ฅผ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์Šคํ”„๋ง HATEOAS์™€ ์Šคํ”„๋ง REST Docs ํ”„๋กœ์ ํŠธ๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ํ…Œ์ŠคํŠธ ์ฃผ๋„ ๊ฐœ๋ฐœ(TDD)์— ์ต์ˆ™ํ•ด ์ง‘๋‹ˆ๋‹ค.

ํ•™์Šต ๋ชฉ์ฐจ

ํ•ด๋‹น repo๋Š” ์Šคํ”„๋ง ๊ธฐ๋ฐ˜ REST API ๊ฐœ๋ฐœ - ๋ฐฑ๊ธฐ์„  ํ•ด๋‹น ๊ฐ•์˜๋ฅผ ๋“ฃ๊ณ  ์ •๋ฆฌํ•œ REPO ์ž…๋‹ˆ๋‹ค.

๊ฒฐ๊ณผ

result