Skip to content
Chae Jeong Ah edited this page Jul 12, 2021 · 28 revisions

두리번 서버 API 명세서

Route 설명 링크
/travel 여행 그룹 관련 api 명세서 보기
/auth/user 카카오 로그인 api 명세서 보기
/schedule 여행 일정 관련 api 명세서 보기
/board 여행 보드 관련 api 명세서 보기
/wish 여행 위시 리스트 관련 api
/tendency 여행 성향 테스트 관련 api 명세서 보기
/image 여행 이미지 관련 api 명세서 보기
/user/myPage 유저 개인 마이 페이지 api 명세서 보기

📌 공통 Request-Header

Name Type 비고
Content-Type String application/json

📌 공통 JWT error Response-Body

요청 시 User JWT token 만료

{
    "status": 401,
    "success": false,
    "message": "Token is not valid"
}

📌 Model

User.ts

User 모델
필드 type 비고 required
_id ObjectId 유저 고유 아이디
name String 유저 이름 (카카오) true
email String 유저 이메일 (카카오) true
prfileImage String 유저 프로필 사진 (카카오) true
groups ObjectId Array 유저 참여 여행 그룹 id 저장 배열

Group.ts

Group 모델
필드 type 비고 required
_id ObjectId 그룹 고유 아이디
members ObjectId Array 참여 멤버 id 저장 배열
schedules ObjectId 스케줄 DB 참조
boards ObjectId 보드 DB 참조
wishes ObjectId 위시 DB 참조
tendencies ObjectId 성향 DB 참조
inviteCode String 여행 그룹 참여 코드 true
host ObjectId 여행 생성 멤버 id
travelName String 여행 이름 true
destination String 목적지 true
startDate Date 시작 날짜 true
endDate Date 종료 날짜 true
image String 여행 대표 이미지 true

Schedule.ts

Schedule 모델
필드 type 비고 required
_id ObjectId 그룹 전체 일정 고유 id
schedules Array 그룹 일정 저장 배열

schedules 내부

필드 type 비고 required
_id ObjectId 개별 일정 고유 id
title String 일정 제목 true
startTime Date 일정 시작 시간 true
endTime Date 일정 종료 시간 true
location String 위치
memo String 메모
writer ObjectId 작성자 유저 고유 id true
createdAt Date 작성 날짜 true

Board.ts

Board 모델
필드 type 비고 required
_id ObjectId 그룹 보드 고유 아이디
post Array 개별 보드 저장 배열

post 배열 내부

필드 type 비고 required
writer ObjectId 작성자 유저 고유 id
tag String 보드 태그(ex. 여행 목표) true
content String 보드 글 true

Tendency.ts

Tendency 모델
필드 type 비고 required
_id ObjectId 그룹 성향 결과 고유 아이디
count Array - Number 성향 테스트 질문 별 답변 카운팅 저장 배열
tendency Array 멤버 별 성향 테스트 결과 저장 배열

tendency 배열 내부

필드 type 비고 required
member ObjectId 유저 고유 id true
title String 성향 결과 이름 true
tag Array - Stirng 해시태그 배열 true
iOSResultImage String 성향 결과 이미지 - iOS true
aOSResultImage String 성향 결과 이미지 - aOS true
thumbnail String 성향 썸네일 일러스트 이미지 true

Wish.ts

Wish 모델
필드 type 비고 required
_id ObjectId 그룹 위시리스트 고유 아이디
post Array 개별 위시리스트 저장 배열

post 배열 내부

필드 type 비고 required
writer ObjectId 작성자 유저 고유 id
tag String 태그(ex. 관광, 숙소) true
content String 위시 리스트 글 true
likes Array 좋아요 누른 멤버 저장 배열