HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧚
[1기]최종 프로젝트 데브코스
/
🏀
[팀14] 슬램 - 우리 주변 농구장 예약
/
📑
API 명세서
📑

API 명세서

 

HTTP Status Code

REST API 관점에서 바라보는 HTTP 상태 코드(HTTP status code)
REST API 관점에서 바라보는 HTTP 상태 코드(HTTP status code) TOC RESTful API 설계 가이드 심화 과정으로 설계 가이드의 HTTP 상태 코드 에 대해서 자세하게 알아보려고 한다. 이번 주제의 핵심은 REST API 관점에서 바라보는 이다. 이 주제를 정한 이유를 알기 위해선 HTTP와 REST 의 관계에 대해서 알 필요가 있다.
REST API 관점에서 바라보는 HTTP 상태 코드(HTTP status code)
https://sanghaklee.tistory.com/61
REST API 관점에서 바라보는 HTTP 상태 코드(HTTP status code)
[HttpStatus] API 처리 별 HttpStatus 리턴 코드 정리
단일 리소스 Method HttpStatus Code Description GET 200 OK GET 404 NOT FOUND 조회 시 데이터 없을 경우 POST 201 CREATED POST 400 BAD REQUEST 생성 요청 시 데이터가 올바르지 않음 PUT 202 ACCEPTED 데이..
[HttpStatus] API 처리 별 HttpStatus 리턴 코드 정리
https://jessyt.tistory.com/122
[HttpStatus] API 처리 별 HttpStatus 리턴 코드 정리
  • 2xx
    • 200 OK
    • 201 Created : 일반적으로 POST 요청 또는 일부 PUT 요청 이후
    • 204 No Content : 요청에 대해서 보내줄 수 있는 콘텐츠가 없지만, 헤더는 의미있음
  • 4xx
    • 400 Bad Request
    • 401 Unauthorized : 클라이언트가 인증이 안되서(unauthenticated) 작업을 진행할 수 없음
    • 403 Forbidden : 클라이언트가 권한이 없기 때문에 작업을 진행할 수 없는 경우
    • 404 Not Found : 요청한 자료/경로 없음
    • 405 Method Not Allowed : 자원(URI)은 존재하지만 해당 자원이 지원하지 않는 메소드일 때
  • 5xx
    • 500 Server Error

RestAPI

명세서
책임자
Method
URL
기능
Domian
Entity
젤리
GET
/api/v1/users/me
앱 실행시 내 정보/알림 조회
user
user
notifications
젤리
GET
/api/v1/users/myprofile
내 프로필 정보 조회
user
user
follow
젤리
PUT
/api/v1/users/myprofile
내 정보 수정(추가 입력)
user
user
젤리
PUT
/api/v1/users/myprofile/image
내 프로필 이미지 수정
user
user
젤리
GET
/api/v1/users/{userId}
다른 사람 회원 프로필 조회
user
user
follow
젤리
DELETE
/api/v1/users/myprofile/image
내 프로필 이미지 삭제
user
user
젤리
GET
/api/v1/follow/{userId}/follwers
팔로우 목록 조회
follow
user
follow
젤리
GET
/api/v1/follow/{userId}/followings
팔로잉 목록 조회
follow
user
follow
젤리
PATCH
/api/v1/management/newCourt/deny
관리자가 농구장 등록 거부하기
management
newCourt
court
젤리
PATCH
/api/v1/management/newCourt/accept
관리자가 농구장 등록 승인하기
management
newCourt
court
chatTitle
젤리
GET
/api/v1/management/newCourts/ready
사용자가 추가한 농구장 중에 처리 대기중인 목록 조회
management
newCourt
젤리
GET
/api/v1/management/newCourts/done
사용자가 추가한 농구장 중에 처리 완료된 목록 조회
management
newCourt
헤이
POST
/api/v1/reservations
예약 추가하기
reservation
user
reservation
court
헤이
PATCH
/api/v1/reservations/{reservationId}
예약 변경하기
reservation
user
reservation
court
헤이
DELETE
/api/v1/reservations/{reservationId}
예약 취소하기
reservation
user
reservation
court
헤이
GET
/api/v1/reservations/{courtId}/{startTime}/{duration}
예약 상세 조회 (토글버튼)
reservation
user
reservation
follow
헤이
GET
/api/v1/reservations/upcoming
다가올 예약 목록 조회
reservation
user
reservation
court
헤이
GET
/api/v1/reservations/expired/?params
지난 예약 목록 조회 (무한스크롤)
reservation
user
reservation
court
헤이
DELETE
/api/v1/favorites/{favoriteId}
농구장 즐겨찾기 제거
favorite
user
court
favorite
헤이
POST
/api/v1/favorites
농구장 즐겨찾기 추가
favorite
user
court
favorite
헤이
GET
/api/v1/favorites
농구장 즐겨찾기 리스트 보기
favorite
user
court
favorite
헤이
GET
/api/v1/courts/{courtId}/reservations/{date}
농구장 특정 날짜의 예약 전체조회
헤이
GET
/api/v1/courts/detail/{courtId}/{date}/{time}
농구장 상세정보 불러오기
court
court
reservation
헤이
GET
/api/v1/courts/?params
사용자가 날짜, 시간, 바운더리로 농구장 검색하기
court
court
reservation
헤이
POST
/api/v1/courts/new
사용자가 농구장 추가하기
court
newCourt
헤이
GET
/api/v1/courts/all
농구장 전체 정보 조회
court
court
플로라
GET
/api/v1/notifications?params
알림(공지) 조회하기 (무한스크롤)
notification
user
court
alarmMessage
notificationIndex
loudspeakerNotification
followNotification
플로라
GET
/api/v1/chat/list?params
채팅 타이틀(목록) 조회하기 (무한스크롤)
chat
user
chatContents
ChatConversationContent
ChatLoudSpeakerContent
CourtChatroomMapping
UserChatroomMapping
court
플로라
GET
/api/v1/chat/court/{courtId}
채팅 내용 조회
chat
user
court
UserChatroomMapping
CourtChatroomMapping
ChatLoudSpeakerContent
ChatConversationContent
chatContents
플로라
Delete
/api/v1/chat/court/{courtId}
사용자의 채팅방 목록에서 채팅방 삭제
chat
UserChatroomMapping
플로라
POST
/api/v1/chat/court/{courtId}
채팅방 최초 입장하기
chat
UserChatroomMapping
 

 

WebSocket

Client Socke
진행 우선순위
역할
Type
destination
content
header
설명
완료
팔로우 선택
Send
/follow
{ receiverId : Number }
token 필요
완료
팔로우 취소
Send
/followcancel
{ receiverId : Number }
token 필요
완료
확성기 실행?
Send
/loudspeaker
{ courtId : Number, startTime : {경기 시작 시간 (ex 13시)}, reservationId : {reservationId}, }
token 필요
- reservation 정보 필요한 이유: 사용자가 본 농구장을 예약한 사람이 맞는지를 확인하기 위해
완료
채팅 정보 전송
Send
/chat
{ courtId : Number, content : String }
token 필요
완료
알림 받기
Subscribe
user/{userId}/notification
알림을 페이지에 뿌려준다.
완료
채팅 받기
Subscribe
user/{courtId}/chat
채팅을 페이지에 뿌려준다.
Server Socket
진행 우선순위
역할
Type
destination
content
header
설명
1순위
진행전
알림 보내기 (팔로우 정보, 확성기 정보)
Send
/user/{userId}notification
{ type: “FOLLOW” || “LOUD_SPEAKER” || ..., followerInfo?: { userId: Number userNickname: String userImage: S3 imageUrl String }, loudSpeakerInfo?: { court: ...CourtInfoAll, startTime: Number }, isRead(1): Boolean, isClicked(2): Boolean }
- 팔우한 사람의 userId 필요한 이유: 프로필을 볼 수 있음으로
2순위
진행전
확성기 정보 전송
Send
/user/{courtId}/chat
{ court: { id: number, name: string }, creator: { id: number, nickname: string, image: string }, conversation: { content: string, } | null, loudSpeaker : { startTime: string, } | null, createdAt: string, updatedAt: string, }
1순위
진행전
팔로우 정보 받기
Subscribe
/follow
{ receiverId : Number }
token 필요
1순위
진행전
팔로우 취소 정보 받기
Subscribe
/followcancel
{ receiverId : Number }
token 필요
1순위
진행전
확성기 정보 받기
Subscribe
/loudspeaker
{ courtId : Number, startTime : {경기 시작 시간 (ex 13시)}, reservationId : {reservationId}, }
token 필요
2순위
진행전
채팅 내용 받기
Subscribe
/chat
{ courtId: Number, content: String }
token 필요
 
 
 
 
 
(약속)[GET]
/api/v1/users/me/{userId}/reservation
[GET] /api/v1/management/newCourts/done