Skip to content

게시물 검색

HwangJaeSuk edited this page Sep 24, 2019 · 4 revisions

공연 검색 (post/search/{pagination})

Request

URL

[post] /post/search

Header

메소드 파라미터 설명
Content-Type application/json
token {user token} 토큰값

Body

변수 타입 설명
query String 검색 질의어
{
  "query":"바지"
}

Response

Body

변수 타입 설명
isNewMessage Int 새 메시지 왔을 때 1, 새 메시지 안 왔을 때 0의 값을 가짐
postTitle String 12글자 넘어갈 때 12글자까지만 표시되고 뒤에 ..로 표시됨

SUCCESS

{
    "status": 200,
    "success": true,
    "message": "게시물 조회 성공",
    "data": {
        "isNewMessage": 0,
        "allPost": [
            {
                "postIdx": 239,
                "postTitle": "반바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/30months31.jpg",
                "areaName": [
                    "종로구"
                ]
            },
            {
                "postIdx": 224,
                "postTitle": "반바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/30months17.jpg",
                "areaName": [
                    "동대문구"
                ]
            },
            {
                "postIdx": 204,
                "postTitle": "밴딩 긴바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/24months45.jpg",
                "areaName": [
                    "동작구"
                ]
            },
            {
                "postIdx": 201,
                "postTitle": "반바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/24months42.jpg",
                "areaName": [
                    "동작구"
                ]
            },
            {
                "postIdx": 199,
                "postTitle": "올드네이비(18~24)..",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/24months40.jpg",
                "areaName": [
                    "강동구",
                    "용산구"
                ]
            },
            {
                "postIdx": 155,
                "postTitle": "리바이스 반바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/12months45.jpg",
                "areaName": [
                    "강동구"
                ]
            },
            {
                "postIdx": 131,
                "postTitle": "하기스 긴바지",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/12months21.jpg",
                "areaName": [
                    "강북구"
                ]
            },
            {
                "postIdx": 121,
                "postTitle": "올드네이비(18~24)..",
                "deadline": "D-2",
                "mainImage": "https://sopt24server.s3.ap-northeast-2.amazonaws.com/12months12.jpg",
                "areaName": [
                    "도봉구"
                ]
            }
        ]
    }
}

FAIL : query값을 입력하지 않았을 때

{
    "status": 400,
    "success": false,
    "message": "필요한 값이 없습니다."
}

FAIL : 토큰이 존재하지 않는 경우

{
    "status": 400,
    "success": false,
    "message": "토큰값이 존재하지 않습니다."
}

FAIL : 토큰의 형식이 잘못된 경우

{
    "status": 401,
    "success": false,
    "message": "잘못된 형식의 토큰입니다."
}

FAIL : 토큰값이 만료된 경우

{
    "status": 401,
    "success": false,
    "message": "만료된 토큰입니다."
}

FAIL : 서버 내부 에러의 경우

{
    "status": 600,
    "success": false,
    "message": "게시물 조회 실패"
}
Clone this wiki locally