Communitrip

API documents for Random-Motivation-Wise-saying

유저 정보

GET https://communitrip.com/users/:userId

Path Parameters

Name
Type
Description

user_id*

int

{
    "id": "1",
    "username": "kimcoding",
    "email": "kimcoding@codestates.com",
    "user_profile": "./images/kimcoding"
}

회원가입

POST https://communitrip.com/users/signup

Request Body

Name
Type
Description

username*

string

email*

string

password*

string

{
    "회원가입 성공했습니다"
}

회원정보 수정

PATCH https://communitrip.com/users/:userId

Request Body

Name
Type
Description

username

string

password

string

user_id

int

user_profile

string

{
    “수정 완료”
}

로그인

POST https://communitrip.com/users/login

Request Body

Name
Type
Description

email*

string

password*

string

{
    "id": "1",
    "username": "kimcoding",
    "email": "kimcoding@codestates.com"
}

로그아웃

POST https://communitrip.com/users/logout

{
    “로그아웃 성공”
}

회원탈퇴

DELETE https://communitrip.com/users/:userId

Headers

Name
Type
Description

user_id*

int

{
    “회원탈퇴 성공”
}

게시글 전체

GET https://communitrip.com/posts

{
    {
    “id”: “1”,
    "user_id": "1",
    “title”: “한라산”,
    “script”: “한라산은 제주도에서 가장 높은 산입니다”,
    “picture”: "https://api.cdn.visitjeju.net/photomng/imgpath/201911/29/13775f73-45ef-494f-bc15-7d78756284e7.jpg",
    “total_likes”: “13”,
    },
    {
    “id”: “2”,
    "user_id": "2",
    “title”: “전주 한옥 마을”,
    “script”: “전주 한옥 마을은 전통가옥으로 구성된 마을입니다”,
    “picture”: "http://hanok.jeonju.go.kr/assets/images/contents/tour/info-main-img2.gif",
    “total_likes”: “27”,
    },
}

나의 게시글 전체

GET https://communitrip.com/posts/users/:userId

{
    {
    “id”: “1”,
    "user_id": "1",
    “title”: “한라산”,
    “script”: “한라산은 제주도에서 가장 높은 산입니다”,
    “picture”: "https://api.cdn.visitjeju.net/photomng/imgpath/201911/29/13775f73-45ef-494f-bc15-7d78756284e7.jpg",
    “total_likes”: “13”,
    },
    {
    “id”: “2”,
    "user_id": "2",
    “title”: “전주 한옥 마을”,
    “script”: “전주 한옥 마을은 전통가옥으로 구성된 마을입니다”,
    “picture”: "http://hanok.jeonju.go.kr/assets/images/contents/tour/info-main-img2.gif",
    “total_likes”: “27”,
    },
}

게시글 하나

GET https://communitrip.com/posts/:postId

Path Parameters

Name
Type
Description

post_id*

int

{
    {
    “id”: “1”,
    "user_id": "1",
    “title”: “한라산”,
    “script”: “한라산은 제주도에서 가장 높은 산입니다”,
    “image”: "https://api.cdn.visitjeju.net/photomng/imgpath/201911/29/13775f73-45ef-494f-bc15-7d78756284e7.jpg    ",
    “total_likes”: “13”,
    "comments": {
    {
        "comment": “짱이네요”,
        "comment_user_id": "2"
        }, {
        "comment": “멋져요”,
        "comment_user_id": "3"
        }
    }
}

게시글 생성

POST https://communitrip.com/posts/:userId

Request Body

Name
Type
Description

user_id*

int

contents*

string

title*

string

tag_id*

int

image*

string

{
    “게시글 완성!”
}

게시판 태그 요청

GET https://communitrip.com/tags

{
    {
    “tag_id”: “1”,
    “tag_name: “강”,
    },
    {
    "tag_id": "2",
    "tag_name": "경기"
    },
}

게시글 삭제

DELETE https://communitrip.com/posts/:postId

Headers

Name
Type
Description

post_id*

int

user_id*

int

{
    “게시글 삭제 성공”
}

게시글 수정

PATCH https://communitrip.com/posts/:postId

Request Body

Name
Type
Description

post_id*

int

contents*

string

title*

string

tag_id*

int

image

string

{
    “수정 완료”
}

댓글 생성

POST https://communitrip.com/posts/:postsId/comments

Request Body

Name
Type
Description

user_id*

int

post_id*

int

comment*

string

{
    “생성 완료”
}

댓글 수정

PATCH https://communitrip.com/posts/:postsId/comments/:commentsId

Request Body

Name
Type
Description

post_id*

int

comment*

string

comment_id*

int

{
    “수정 완료”
}

댓글 갱신

GET https://communitrip.com/posts/:postId/comments

Path Parameters

Name
Type
Description

post_id*

int

{
    "comments": {
    {
        "comment": “짱이네요”,
        "comment_user_id": "2"
        }, {
        "comment": “멋져요”,
        "comment_user_id": "3"
        }
    }
}

댓글 삭제

DELETE https://communitrip.com/posts/:postsId/comments/:commentsId

Headers

Name
Type
Description

user_id*

int

post_id*

int

{
    “삭제 성공”
}

좋아요 증가

POST https://communitrip.com/posts/:postsId/likes

Request Body

Name
Type
Description

user_id*

int

post_id*

int

{
    “종아요 개수 증가”
}

좋아요 갱신

GET https://communitrip.com/posts/:postId/likes

Path Parameters

Name
Type
Description

post_id*

int

{
    "id": "1",
    "total_likes": "13"
}

좋아요 취소

DELETE https://communitrip.com/posts/:postsId/likes

Headers

Name
Type
Description

post_id*

int

user_id*

int

{
    “종아요 개수 감소”
}

Last updated