# 건물 기능

## &#x20;건물 조회 - 전체 & 지역별

<mark style="color:blue;">`GET`</mark> `/api/v1/buildings?location={location}`

&#x20;건물조회&#x20;

#### Query Parameters

| Name     | Type   | Description                                  |
| -------- | ------ | -------------------------------------------- |
| size     | string | 한 페이지 사이즈                                    |
| page     | string | 페이지 번호                                       |
| location | string | <p> 지역별 조회 원할 시, 쿼리 파라미터로 해당 지역명 <br>전송 </p> |

#### Headers

| Name          | Type   | Description           |
| ------------- | ------ | --------------------- |
| Authorization | string | access 토큰 Bearer Type |

{% tabs %}
{% tab title="200  조회 성" %}

```
{
    "success": true,
    "code": 0,
    "msg": "성공하였습니다",
    "data": {
        "content": [
            {
                "id": 42,
                "location": "철문",
                "address": "서울시 종로구 명륜9가",
                "lotNumber": "9",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 41,
                "location": "철문",
                "address": "서울시 종로구 명륜8가",
                "lotNumber": "8",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 39,
                "location": "철문",
                "address": "서울시 종로구 명륜6가",
                "lotNumber": "6",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 38,
                "location": "철문",
                "address": "서울시 종로구 명륜5가",
                "lotNumber": "5",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 44,
                "location": "철문",
                "address": "서울시 종로구 명륜11가",
                "lotNumber": "11",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 43,
                "location": "철문",
                "address": "서울시 종로구 명륜10가",
                "lotNumber": "10",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 62,
                "location": "철문",
                "address": "서울시 종로구 명륜29가",
                "lotNumber": "29",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 34,
                "location": "철문",
                "address": "서울시 종로구 명륜1가",
                "lotNumber": "1",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 40,
                "location": "철문",
                "address": "서울시 종로구 명륜7가",
                "lotNumber": "7",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            },
            {
                "id": 33,
                "location": "철문",
                "address": "서울시 종로구 명륜0가",
                "lotNumber": "0",
                "oneRoomPrice": null,
                "completionDate": "2020-12-27"
            }
        ],
        "pageable": {
            "sort": {
                "sorted": true,
                "unsorted": false,
                "empty": false
            },
            "offset": 0,
            "pageNumber": 0,
            "pageSize": 10,
            "paged": true,
            "unpaged": false
        },
        "last": false,
        "totalElements": 92,
        "totalPages": 10,
        "size": 10,
        "number": 0,
        "sort": {
            "sorted": true,
            "unsorted": false,
            "empty": false
        },
        "numberOfElements": 10,
        "first": true,
        "empty": false
    }
}

```

{% endtab %}
{% endtabs %}

&#x20;location 형식

&#x20;아래 영문으로 요청 보내야함 (JJOKMOON, JUNGMOON, CHULMOON ...)

```
JJOKMOON("JJOKMOON", "쪽문"),
JUNGMOON("JUNGMOON", "정문"),
CHULMOON("CHULMOON", "철문"),
DAEMYUNG("DAEMYUNG", "대명/대학로"),
HANSUNGSHIN("HANSUNGSHIN","한성/성신");
```

## &#x20;건물 검색 - 주소&#x20;

<mark style="color:blue;">`GET`</mark> `/api/v1/buildings?address={address}&lotNumber={lotNumber}`

&#x20;지번 주소로 해당하는 건물들 검색\
&#x20;구현 아직&#x20;

#### Query Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| page      | string | 페이 번호       |
| size      | string | 한 페이지 사이즈   |
| lotNumber | string | 지번          |
| address   | string | 주소          |

#### Headers

| Name          | Type   | Description           |
| ------------- | ------ | --------------------- |
| Authorization | string | access 토큰 Bearer Type |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## &#x20;건물 썸네일&#x20;

<mark style="color:blue;">`GET`</mark> `/api/v1/buildings/{buildingId}/thumbnail`

&#x20;건물 리뷰에 포함된 사진이 있다면, 해당 사진들 중 썸네일 용으로 사용하도록 임의의 사진을 하나 가져온다.

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| buildingId | string | 건물 번호       |

{% tabs %}
{% tab title="200  이미지 url 리턴한다 (썸네일 없는 경우 빈 문자열 "" 리턴한다) " %}

```
{
    "success": true,
    "code": 0,
    "msg": "성공하였습니다"
    "data": "	https://thumbnailimageurl.jpg"
}
```

{% endtab %}
{% endtabs %}
