개발 일기

DB구조와 API 명세서 본문

Project

DB구조와 API 명세서

ji_su_04 2023. 2. 7. 20:25

DB구조

 
posts : [
	{
		"title" : string,
		"content" : string,
		"category" : string,
		"uerId" : string,
		"nickName" : string,
		"createdAt" : number,
		"photoUrl" : string,
		"likes" : number,
	}
],

recruitments : [
	{
		"title" : string,
		"content" : string,
		"userId" : string,
		"nickName" : string,
		"createdAt" : number,
	}
],

comments: [
	{
		"content" : string,
		"userId" : string,
		"nickName" : string,
		"createdAt" : number,
	}
],

users: [
	{
		"userId" : string,
		"nickName" : string,
		"level": number,
		"myIntroduction": string,
		"residence" : string,
	}
],
 

API 명세서

 
 
기능
 
 
URI
 
 
Method
 
 
Request
 
 
Response
 
 
게시글 목록
 
/posts
 
GET
 
 
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
게시글 작성
 
/posts
 
POST
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
 
 
게시글 수정
 
/posts/:id
 
PATCH
 
{ "title" : string, "content" : string, "category" : string, }
 
 
 
 
게시글 삭제
 
/posts/:id
 
DELETE
 
{id}
 
 
 
 
게시글 상세
 
/posts/:id
 
GET
 
 
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
댓글 목록
 
/comments/:id
 
GET
 
 
 
{ "content" : string, "userId" : string, "nickName" : string, "createdAt" : number, }
 
 
댓글 작성
 
/comments/:id
 
POST
 
{ "content" : string, "userId" : string, "nickName" : string, "createdAt" : number, }
 
 
 
 
댓글 수정
 
/comments/:id
 
PATCH
 
{ "content" : string, "userId" : string, }
 
 
 
 
댓글 삭제
 
/comments/:id
 
DELETE
 
{id}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
메인페이지 사진 불러오기
 
/posts
 
GET
 
 
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
 
 
 
 
 
 
 
 
 
 
 
내가 쓴 게시물 모아보기
 
/posts/:id
 
GET
 
 
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
내가 쓴 댓글 모아보기
 
/posts/:id
 
GET
 
 
 
{ "content" : string, "userId" : string, "nickName" : string, "createdAt" : number, }
 
 
북마크 글 모아보기
 
 
 
GET
 
 
 
{ "title" : string, "content" : string, "category" : string, "uerId" : string, "nickName" : string, "createdAt" : number, "photoUrl" : string, "likes" : number, }
 
 
지도 게시글 목록
 
/recruitments
 
GET
 
 
 
{ "title" : string, "content" : string, "userId" : string, "nickName" : string, "createdAt" : number, }
 
 
지도 게시글 작성
 
/recruitments
 
POST
 
{ "title" : string, "content" : string, "userId" : string, "nickName" : string, "createdAt" : number, }
 
 
 
 
지도 게시글 수정
 
/recruitments/:id
 
PATCH
 
{ "title" : string, "content" : string, }
 
 
 
 
지도 게시글 삭제
 
/recruitments/:id
 
DELETE
 
{id}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
반응형