# Blog Api

### <https://jihos-organization.gitbook.io/spring-lv-1-api/> 여기로 가시면 더 깔끔하게 보실 수 있습니다.. 깃 사용이 미숙해서.. 죄송합니다

### description: 게시판 조회 / 선택조회 / 게시글 작성 / 수정 / 삭제 기능 api 입니다.

## Blog Api

### 게시글 목록 조회

## 게시글 목록 조회

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/blogs`

게시글 목록을 조회합니다.

#### Request Body

| Name                                       | Type        | Description |
| ------------------------------------------ | ----------- | ----------- |
| Method<mark style="color:red;">\*</mark>   | @GetMapping | GET         |
| Request Header                             | String      |             |
| Request                                    | String      |             |
| Response<mark style="color:red;">\*</mark> | String      | Error       |
| Response Header                            | String      |             |

{% tabs %}
{% tab title="200: OK Method" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Response" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 게시글 상세 조회

## 게시글 상세 조회

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/blogs/{id}`

게시글 상세 조회합니다.

#### Request Body

| Name                                       | Type        | Description |
| ------------------------------------------ | ----------- | ----------- |
| Method<mark style="color:red;">\*</mark>   | @GetMapping | GET         |
| Request Header                             | String      |             |
| Request                                    | String      |             |
| Response<mark style="color:red;">\*</mark> | String      | Error       |
| Response Header                            | String      |             |

{% tabs %}
{% tab title="500: Internal Server Error Method, Response" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 게시글 작성

## 게시글 작성

<mark style="color:green;">`POST`</mark> `http://localhost:8080/api/blog`

게시글을 작성합니다

#### Request Body

| Name                                              | Type         | Description                                                                                                                                                     |
| ------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method<mark style="color:red;">\*</mark>          | @PostMapping | POST                                                                                                                                                            |
| Request Header<mark style="color:red;">\*</mark>  | String       | BearereyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiaW4xMjM0IiwiYXV0aCI6IlVTRVIiLCJleHAiOjE2NzEyMDQ5MjUsImlhdCI6MTY3MTIwMTMyNX0.3RQjY3v-TMb56kGoLNt8B3PJZEmhHkGm5DFpPgw-N\_0 |
| Request<mark style="color:red;">\*</mark>         | String       | { "title" : "게시글2", "content" : "내용" }                                                                                                                          |
| Response<mark style="color:red;">\*</mark>        | String       | Error                                                                                                                                                           |
| Response Header<mark style="color:red;">\*</mark> | String       | Error                                                                                                                                                           |

{% tabs %}
{% tab title="200: OK Method, Request Header" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Request, Response, Response Header" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 게시글 수정

## 게시글 수정

<mark style="color:orange;">`PUT`</mark> `http://localhost:8080/api/blog/{id}`

게시글을 수정합니다.

#### Request Body

| Name                                              | Type        | Description                                                                                                                                                     |
| ------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method<mark style="color:red;">\*</mark>          | @PutMapping | PUT                                                                                                                                                             |
| Request Header<mark style="color:red;">\*</mark>  | String      | BearereyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiaW4xMjM0IiwiYXV0aCI6IlVTRVIiLCJleHAiOjE2NzEyMDQ5MjUsImlhdCI6MTY3MTIwMTMyNX0.3RQjY3v-TMb56kGoLNt8B3PJZEmhHkGm5DFpPgw-N\_0 |
| Request<mark style="color:red;">\*</mark>         | String      | Error                                                                                                                                                           |
| Response<mark style="color:red;">\*</mark>        | String      | Error                                                                                                                                                           |
| Response Header<mark style="color:red;">\*</mark> | String      | Error                                                                                                                                                           |

{% tabs %}
{% tab title="500: Internal Server Error Method, Request Header, Request, Response, Response Header" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 게시글 삭제

## 게시글 삭제

<mark style="color:red;">`DELETE`</mark> `http://localhost:8080/api/blog/{id}`

게시글을 삭제합니다.

#### Request Body

| Name                                     | Type           | Description                                                                                                                                                     |
| ---------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method<mark style="color:red;">\*</mark> | @DeleteMapping | DELETE                                                                                                                                                          |
| Requset Header                           | String         | BearereyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiaW4xMjM0IiwiYXV0aCI6IlVTRVIiLCJleHAiOjE2NzEyMDQ5MjUsImlhdCI6MTY3MTIwMTMyNX0.3RQjY3v-TMb56kGoLNt8B3PJZEmhHkGm5DFpPgw-N\_0 |
| Request                                  | String         |                                                                                                                                                                 |
| Response                                 | String         | Error                                                                                                                                                           |
| Response Header                          | String         |                                                                                                                                                                 |

{% tabs %}
{% tab title="500: Internal Server Error Method, Request Header, Response" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
