PhiloMonx1 / spring-w3-7t

0 stars 3 forks source link

Restful API #1

Open Code-Angler opened 2 years ago

Code-Angler commented 2 years ago

해당 API 명의 주체가 heart 라면 /auth/heart/~~~ ,, 형태가 더 낫지 않을까요? API URI 도 일종의 카테고라이징입니다. 가지를 뻗어나가는 것에있어서 설계의 방향이 중요하다고 생각됩니다. 만약 다음과 같은 설계라면, 해당 api 를 HeartController 가아닌 postController or CommentController 에 들어가야하지않을까요?

https://github.com/PhiloMonx1/spring-w3-7t/blob/21d85111096f425311a546f0d21f67b5d07e9776/src/main/java/com/hanghae99/spring/controller/HeartController.java#L17

Code-Angler commented 2 years ago

Restful 한 api 권장 표현법에는 명사형의 복수를 사용하는 것을 권장하고 있습니다. 공부하는 단계이니 만큼 가능하면 권장하는 형태의 restful 한 명명을 사용하는것이 좋을듯 합니다.

https://github.com/PhiloMonx1/spring-w3-7t/blob/21d85111096f425311a546f0d21f67b5d07e9776/src/main/java/com/hanghae99/spring/controller/MemberController.java#L11

Code-Angler commented 2 years ago

전반적으로 API 규칙이 뚜렷하게 드러나 보이지 않는것으로 보입니다 정돈이 필요해 보입니다,