Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API URL 개선 #1

Open
asdfg5415 opened this issue Apr 19, 2021 · 3 comments
Open

API URL 개선 #1

asdfg5415 opened this issue Apr 19, 2021 · 3 comments
Assignees
Labels
refactor refator code

Comments

@asdfg5415
Copy link
Member

URL을 REST 하게 리팩토링

@welshimeat
Copy link
Contributor

API URL 수정안:
대문자는 없도록, 화면단위에서 자원단위로 변경
참고 사이트: https://meetup.toast.com/posts/92, https://sanghaklee.tistory.com/57

/jwt -> /login
/home/alarm -> /alarms
/home/alarm/{alarmId} -> /alarms/{alarmid}
/signup -> /users
/signup/categories -> /positions
/signup/hashtags -> /hashtags
/signup/nickname -> /nickname/duplicate
/signup/positions 삭제
/comment~ -> /projects/comments~
/apply~ -> /applications~
/myProject -> /projects/users
/pool -> /userpool
/pool/like/{userPoolId} -> /userpool/{userpoolid}/like
/pool/search 삭제
/review/{userid}/detail

추가로 해야할 일: Swagger에서 6번부터 수정

@welshimeat
Copy link
Contributor

다시 정리:
/login -> /jwt
/home/alarm -> /alarms
/home/alarm/{alarmId} -> /alarms/{alarmid}
/signup -> /users
/signup/categories -> /positions
/signup/hashtags -> /hashtags
/signup/nickname -> /nickname/duplicate
/signup/positions 삭제
/comment~ -> /projects/comments~
/apply~ -> /applications~
/myProject -> /projects/users
/pool -> /userpools
/pool/like/{userPoolId} -> /userpools/{userpoolid}/like
/pool/search 삭제

/mypage -> /users/mypage
/mypage/applied -> /users/projects/apply
/mypage/like/pool -> /users/projects/like
/mypage/written -> /users/projects/write

/mypage/edit -> /users
/mypage/edit/~ -> /users/hashtags

/chatroom -> /users/chatrooms

  • 컬렉션은 복수로 표현
  • 화면 단위를 리소스 단위로 변경
  • 컨트롤 자원을 의미하는 URL 예외적으로 동사를 허용. ex) /signup/nickname -> /nickname/duplicate

앞으로 해야할 일: 수정사항 검토 후 코드 적용

@welshimeat
Copy link
Contributor

수정사항 및 변동해야할 것

  1. /myProject -> /users/projects
  2. /mypage/edit/nickname, /nickname/duplicate 중복되는듯?
  3. DELETE /users가 signupController에 있는데 MypageController로 옮겨야될듯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor refator code
Projects
None yet
Development

No branches or pull requests

2 participants