Skip to content

검색 API

soyeon Park edited this page Nov 6, 2020 · 17 revisions

Base URL

http://35.173.244.190:8080

테스트용 토큰

userId token
1 eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDQ3NTQ2MjAsImlhdCI6MTYwNDY2ODIyMCwianRpIjoiNjAxZjhlZjUtMDlkZC00M2E4LWIxNDEtMmVkYzIzMzhmOWFiIiwidXNlcklkIjoiMSJ9.iGcz5rOzHLIOKaRFwic5gPSQkVGo894UE1cqJDOfd1KFs0h30Om7osRQ94wJaqIK0KZ8bP8zsTK2dE4QGcoHWw

Post Board

게시판 글 작성

Request

  • url

    /v1/board/search

  • method

    GET

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • request param

    Field Type Description Example Required
    title String 글 제목 O
    content String 글 내용 O
    category Long 모집 운동 타입 O
    city Long 모임 위치 O
    userTag Long 유저 특징 O
    recruitNumber String 모집 인원 수 O
    date LocalDateTime 마감 시간 O
    place String 모임 상세 장소 O

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "글이 정상적으로 업로드 되었습니다."
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 글 쓰기 성공 메세지 O
  • fail response

    • request body 값이 비어있는 경우
    {
        "status": 400,
        "success": false,
        "message": "필요한 값이 없습니다"
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Get Board List

홈 화면 게시글 리스트 가져오기

  • url

    /v1/board/retrieve?page=1&size=20

  • method

    POST

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • query params

    method parameter Description Required
    size Integer 한 페이지 당 조회 갯 수 (default : 20)
    page Integer 조회할 페이지 번호 (default : 0)
  • request body

    {
        "sorting": "latest",
        "category": [1, 2, 3],
        "city": [1, 2]
    }
    
    Field Type Description Example Required
    sorting String 조회할 글 정렬 방법(default:"latest") "latest", "remain", "deadline"
    category List 운동 종목 필터링(default:전체 조회) [1, 2, 3]
    city List 모임 지역 조회(default:전체 조회) [1, 2, 3]

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "글 목록 조회 성공"
          "data": [
              {
                  "boardId": 1,
                  "hostId": 3,
                  "hostName": "짹짹",
                  "title": "급하게 농구 용병 3명 구합니다!",
                  "groupStatus": "모집중",
                  "exercise": "농구",
                  "city": "은평구",
                  "isBookMark": true
              },
              {
                  "boardId": 2,
                  "hostId": 5,
                  "hostName": "퐁퐁달퐁",
                  "title": "같이 중랑천 달리실 분!",
                  "groupStatus": "모집완료",
                  "exercise": "달리기",
                  "city": "중랑구",
                  "isBookMark": false
              },
              ...
          ]
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 게시판 조회 성공 메세지 O
      data List 게시판 정보 리스트 O
      data.boardId Long 게시판 번호 1 O
      data.hostId Long 호스트 번호 1 O
      data.hostName String 호스트 닉네임 "짹짹" O
      data.title String 게시판 제목 "같이 중랑천 달리실 분!" O
      data.groupStatus String 게시판 state "모집중" O
      data.exercise String 모집 운동 카테고리 "축구" O
      data.city String 모집 위치 "강남구" O
      data.isBookMark Boolean 북마크 활성화 여부 true/false O
  • fail response

    • request body 값이 비어있는 경우
    {
        "status": 400,
        "success": false,
        "message": "필요한 값이 없습니다"
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Get Board Content

게시글 내부 가져오기

  • url

    /v1/board/{boardId}

  • method

    GET

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • path params

    variable type Description Required
    boardId Long 조회할 글 번호 O

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "글 내용 조회 성공"
          "data": {
                  "boardId": 1,
                  "title": "급하게 농구 용병 3명 구합니다! 빡겜러 환영",
                  "groupStatus": "모집중",
                  "exercise": "농구",
                  "city": "은평구",
                  "recruitNumber": 3,
                  "recruitedNumber": 2,
                  "content": "안녕하세요! 농구팀 ‘슬램덩크’ 입니다. 농구 좋아하는 친구들끼리 모여서하는 팀인데, 모든 인원이 다 모이는 게 쉽지가 않아서 13일에 열리는 번개 농구 
                              모임에 참여해주실 농구 용병 3분을 구합니다! (합치면 총 10명) 다들 열심히 하는 편이라 빡겜하실 분 모셔요!! * 대관료 n빵 합니다. (2시간 기준, 
                              인당 약 4000원) * 뒷풀이 참여 안 하셔도 됩니다.",,
                  "isBookMark": true,
                  "host":{
                      "hostId": 3,
                      "hostName": "짹짹",
                      "likes": 53,
                      "dislikes": 3
                  }
          }
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 게시판 조회 성공 메세지 O
      data List 글 정보 O
      data.boardId Long 게시판 번호 1 O
      data.title String 게시판 제목 "같이 중랑천 달리실 분!" O
      data.groupStatus String 게시판 state "모집중" O
      data.exercise String 모집 운동 카테고리 "축구" O
      data.city String 모집 위치 "강남구" O
      data.recruitNumber Integer 총 모집 인원 3 O
      data.recruitedNumber Integer 현재 모집 인원 2 O
      data.content String 모집 글 내용 2 O
      data.isBookMark Boolean 북마크 여부 true/false O
      data.host 호스트 정보 O
      data.host.hostId Long 호스트 번호 1 O
      data.host.hostName String 호스트 닉네임 "짹짹" O
      data.host.likes String 호스트 좋아요 수 2 O
      data.host.dislikes String 호스트 싫어요 수 2 O
  • fail response

    • 글 번호 param이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "조회할 글 번호가 필요합니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Delete Board

게시글 삭제

  • url

    /v1/board/{boardId}

  • method

    DELETE

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • path params

    variable type Description Required
    boardId Long 삭제할 글 번호 O

Response

  • success response

    • body
      {
          "status": 200,
          "success": true,
          "message": "글 삭제 성공"
      }
      
    Field Type Description Example Required
    status integer HTTP STATUS CODE 200 O
    success boolean 성공 여부 true O
    message String 글 삭제 성공 메세지 O
  • fail response

    • 글 번호 param이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제할 글 번호가 필요합니다."
    }
    
    • 글 호스트 아이디와 사용자 아이디가 다른 경우
    {
        "status": 400,
        "success": false,
        "message": "본인의 글이 아닙니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Edit Board

게시글 수정

  • url

    /v1/board/{{boardId}}

  • method

    PUT

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • path params

    variable type Description Required
    boardId Long 수정할 글 번호 O
  • request body

    {
        "title": "급하게 농구 용병 3명 구합니다! 빡겜러 환영",
        "content": "내용 무",
        "category": 2,
        "city": 1,
        "userTag": 3,
        "recruitNumber": 3,
        "date": "2016-11-09T11:44:44.797",
        "place": "플래닛 체육관 2층"
    }
    
    Field Type Description Example Required
    title String 글 제목 O
    content String 글 내용 O
    category Long 모집 운동 타입 O
    city Long 모임 위치 O
    userTag Long 유저 특징 O
    recruitNumber String 모집 인원 수 O
    date LocalDateTime 마감 시간 O
    place String 모임 상세 장소 O

Response

  • success response

    • body
      {
          "status": 200,
          "success": true,
          "message": "글 수정 성공",
          "data": {
                  "boardId": 1,
                  "title": "급하게 농구 용병 3명 구합니다! 빡겜러 환영",
                  "groupStatus": "모집중",
                  "exercise": "농구",
                  "city": "은평구",
                  "recruitNumber": 3,
                  "recruitedNumber": 2,
                  "content": "안녕하세요! 농구팀 ‘슬램덩크’ 입니다. 농구 좋아하는 친구들끼리 모여서하는 팀인데, 모든 인원이 다 모이는 게 쉽지가 않아서 13일에 열리는 번개 농구 
                              모임에 참여해주실 농구 용병 3분을 구합니다! (합치면 총 10명) 다들 열심히 하는 편이라 빡겜하실 분 모셔요!! * 대관료 n빵 합니다. (2시간 기준, 
                              인당 약 4000원) * 뒷풀이 참여 안 하셔도 됩니다.",,
                  "isBookMark": true,
                  "host":{
                      "hostId": 3,
                      "hostName": "짹짹",
                      "likes": 53,
                      "dislikes": 3
                  }
          }
      }
      
    Field Type Description Example Required
    status integer HTTP STATUS CODE 200 O
    success boolean 성공 여부 true O
    message String 글 수정 성공 메세지 O
    data List 글 정보 O
    data.boardId Long 게시판 번호 1 O
    data.title String 게시판 제목 "같이 중랑천 달리실 분!" O
    data.groupStatus String 게시판 state "모집중" O
    data.exercise String 모집 운동 카테고리 "축구" O
    data.city String 모집 위치 "강남구" O
    data.recruitNumber Integer 총 모집 인원 3 O
    data.recruitedNumber Integer 현재 모집 인원 2 O
    data.content String 모집 글 내용 2 O
    data.isBookMark Boolean 북마크 여부 true/false O
    data.host 호스트 정보 O
    data.host.hostId Long 호스트 번호 1 O
    data.host.hostName String 호스트 닉네임 "짹짹" O
    data.host.likes String 호스트 좋아요 수 2 O
    data.host.dislikes String 호스트 싫어요 수 2 O
  • fail response

    • 글 번호 param이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "수정할 글 번호가 필요합니다."
    }
    
    • 글 호스트 아이디와 사용자 아이디가 다른 경우
    {
        "status": 400,
        "success": false,
        "message": "본인의 글이 아닙니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Create BookMark

북마크 생성

Request

  • url

    /v1/board/bookMark

  • method

    POST

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • request body

    {
        "boardId": 1
    }
    
    Field Type Description Example Required
    boardId Long 북마크 글 아이디 O

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "북마크가 정상적으로 추가 되었습니다."
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 북마크 추가 성공 메세지 O
  • fail response

    • request body 값이 비어있는 경우
    {
        "status": 400,
        "success": false,
        "message": "필요한 값이 없습니다"
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Delete BookMark

북마크 해제

Request

  • url

    /v1/board/bookMark/{boardId}

  • method

    DELETE

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • path params

    variable type Description Required
    boardId Long 북마크 해제할 글 번호 O

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "북마크가 정상적으로 삭제 되었습니다."
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 북마크 삭제 성공 메세지 O
  • fail response

    • param이 비어 있는 경우
    {
        "status": 400,
        "success": false,
        "message": "조회할 글 번호와 유저 아이디가 필요합니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Hide Board

게시물 숨김 처리

Request

  • url

    /v1/board/hidden

  • method

    POST

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • request body

    {
        "boardId": 1
    }
    
    Field Type Description Example Required
    boardId Long 게시글 ID O

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "게시글이 정상적으로 숨김처리 되었습니다."
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 북마크 삭제 성공 메세지 O
  • fail response

    • param이 비어 있는 경우
    {
        "status": 400,
        "success": false,
        "message": "숨김처리 할 글 번호가 필요합니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Report Board

게시물 신고 처리

Request

  • url

    /v1/board/report

  • method

    POST

  • header

    method parameter Description Required
    Authorization {{token}} access token O
  • request body

    {
        "boardId": 1,
        "reportType": 2,
        "content": "그냥"
    }
    
    Field Type Description Example Required
    boardId Long 게시글 ID O
    reportType Long 신고 이유 O
    content String 기타 선택 후 신고 이유

Response

  • success response

    • body

      {
          "status": 200,
          "success": true,
          "message": "게시글이 정상적으로 신고처리 되었습니다."
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 신고 성공 메세지 O
  • fail response

    • param이 비어 있는 경우
    {
        "status": 400,
        "success": false,
        "message": "신고처리 할 글 번호가 필요합니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 글일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 글입니다."
    }
    
    • 글 번호가 올바르지 않은 경우
    {
        "status": 400,
        "success": false,
        "message": "글 번호가 올바르지 않습니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O