보드 API

보드 및 게시물에 대한 상호작용 관련 API이다.

게시물 불러오기

GET http://sejabo.com/get_posts/<string:build>

게시물들을 불러오는 API이다. build 인자에 지정된 건물명을 넘겨 해당 건물에 등록된 모든 게시물을 조회한다. 인자가 입력되지 않을 경우, 모든 건물의 게시물을 불러오는 것으로 취급한다.

Path Parameters

Name
Type
Description

build

string

보여질 대상의 건물 게시판 입력하지 않을 경우, all로 취급.

//날짜는 ISODATE 규격
{
    "result":"success",
    "post_list":<array:json>{
        "post_id":<int>,
        "author_name":<string>,
        "author_id":<int>,
        "author_major":<string>,
        "title":<string>,
        "content"<string>,
        "reg_date":<string>,
        "exp_date":<string>,
        "like_count":<int>,
        "dislike_count":<int>,
        "url":<string>,
        "img_url":<string>,
        "size":<int>,
        "build_yul":<int>,
        "build_dae":<int>,
        "build_hak":<int>,
        "build_gwang":<int>,
        "build_count":<int>,
        "color":<string>
    }
}

게시물 조회수 증가

GET http://sejabo.com/view_add/<int:post_id>

게시물의 조회수를 1 상승시킨다.

Path Parameters

Name
Type
Description

post_id

number

조회수를 올릴 게시물 아이디

{
   "result":"success"
}

게시물 호감/비호감 등록

GET http://sejabo.com/like/<int:post_id>/<int:interest>

해당 게시물에 대한 좋아요/싫어요 등록 기능을 수행하는 API이다. 이미 등록된 경우 혹은 호감/비호감 간의 이동이 있을 경우, 그대로 갱신한다.

Path Parameters

Name
Type
Description

post_id

number

게시물 아이디

interest

number

호감/비호감 상태 1: 좋아요 0: 싫어요

Headers

Name
Type
Description

Authorization

string

JWT 토큰

1.
{
   "result":"success"
}
2.
{
   "result":"success",
   "comment":"aleady"
}

게시물 검색

GET http://sejabo.com/search/<string:words>

게시물에 대한 검색 기능을 수행하는 API이다. 검색 문자열이 게시물의 제목, 내용, 작성자의 이름, 학번, 학과 정보 중, 어느 한곳이라도 포함된다면 해당 게시물들을 반환한다.

Path Parameters

Name
Type
Description

words

string

검색어

//날짜는 ISODATE 규격
{
    "result":"success",
    "post_list":<array:json>{
        "post_id":<int>,
        "author_name":<string>,
        "author_id":<int>,
        "author_major":<string>,
        "title":<string>,
        "content"<string>,
        "reg_date":<string>,
        "exp_date":<string>,
        "like_count":<int>,
        "dislike_count":<int>,
        "url":<string>,
        "img_url":<string>,
        "size":<int>,
        "build_yul":<int>,
        "build_dae":<int>,
        "build_hak":<int>,
        "build_gwang":<int>,
        "build_count":<int>,
        "color":<string>
    }
}

단일 게시물 정보 반환

GET http://sejabo.com/v/<int:post_id>

단일 게시물에 대한 조회 기능을 수행하는 API이다. 외부 링크를 생성해 타 서비스에서 공유하기 위해 사용된다.

Path Parameters

Name
Type
Description

post_id

number

게시물 아이디

//날짜는 ISODATE 규격
{
    "result":"success",
    "post":<json>{
        "post_id":<int>,
        "author_name":<string>,
        "author_id":<int>,
        "author_major":<string>,
        "title":<string>,
        "content"<string>,
        "reg_date":<string>,
        "exp_date":<string>,
        "like_count":<int>,
        "dislike_count":<int>,
        "url":<string>,
        "img_url":<string>,
        "size":<int>,
        "build_yul":<int>,
        "build_dae":<int>,
        "build_hak":<int>,
        "build_gwang":<int>,
        "build_count":<int>,
        "color":<string>
    }
}

Last updated

Was this helpful?