> For the complete documentation index, see [llms.txt](https://documenttesting.gitbook.io/ecolog-api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documenttesting.gitbook.io/ecolog-api-reference/reference/api/follow.md).

# 팔로우

## 유저 팔로우 <a href="#add" id="add"></a>

## 유저를 팔로우할 수 있는 API

<mark style="color:green;">`POST`</mark> `https://www.eco-log-backend.kro.kr/api/user/follow`

#### Headers

| Name                                    | Type   | Description                                          |
| --------------------------------------- | ------ | ---------------------------------------------------- |
| key<mark style="color:red;">\*</mark>   | String | Authorization                                        |
| value<mark style="color:red;">\*</mark> | String | <p>로그인 시 JWT<br>  - ex. <code>Bearer {토큰}</code></p> |

#### Request Body

| Name                                        | Type   | Description  |
| ------------------------------------------- | ------ | ------------ |
| targetId	<mark style="color:red;">\*</mark> | String | 팔로우하려는 유저 ID |

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

{% endtab %}
{% endtabs %}

```
{
	"message": "Follow{fromUser=2, toUser=1팔로우 관계를 시작합니다)",
	"badgeAchieveList": [
		7
	]
}

```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="198">항목</th><th width="91">타입</th><th>설명</th></tr></thead><tbody><tr><td>message</td><td>String</td><td>요청 결과</td></tr><tr><td>badgeAchieveList</td><td>List</td><td>팔로우 시점에 유저가 획득한 뱃지 정보<br>- <code>7</code>: 함께 갈 동료</td></tr></tbody></table>

## 팔로우 취소 <a href="#unfollow" id="unfollow"></a>

## 유저 팔로우를 취소할 수 있는 API

<mark style="color:red;">`DELETE`</mark> `https://www.eco-log-backend.kro.kr/api/user/follow`

#### Headers

| Name                                    | Type   | Description                                          |
| --------------------------------------- | ------ | ---------------------------------------------------- |
| key<mark style="color:red;">\*</mark>   | String | Authorization                                        |
| value<mark style="color:red;">\*</mark> | String | <p>로그인 시 JWT<br>  - ex. <code>Bearer {토큰}</code></p> |

#### Request Body

| Name                                     | Type    | Description    |
| ---------------------------------------- | ------- | -------------- |
| target<mark style="color:red;">\*</mark> | Integer | 팔로우를 취소할 유저 ID |

{% tabs %}
{% tab title="200: OK 팔로우 취소 완료" %}

{% endtab %}
{% endtabs %}

## 팔로워 조회 <a href="#follower" id="follower"></a>

## 유저의 팔로워를 조회할 수 있는 API

<mark style="color:blue;">`GET`</mark> `https://www.eco-log-backend.kro.kr/api/user/follower`

#### Headers

| Name                                    | Type   | Description                                          |
| --------------------------------------- | ------ | ---------------------------------------------------- |
| key<mark style="color:red;">\*</mark>   | String | Authorization                                        |
| value<mark style="color:red;">\*</mark> | String | <p>로그인 시 JWT<br>  - ex. <code>Bearer {토큰}</code></p> |

{% tabs %}
{% tab title="200: OK 팔로우 취소 완료" %}
{% tabs %}
{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th width="204">항목</th><th width="111">타입</th><th>설명</th></tr></thead><tbody><tr><td>userId</td><td>Integer</td><td>팔로워 ID</td></tr><tr><td>userNickName</td><td>String</td><td>팔로워 닉네임</td></tr><tr><td>selfIntroduce</td><td>String</td><td>팔로워 자기소개</td></tr></tbody></table>

## 팔로잉 조회 <a href="#following" id="following"></a>

## 유저를 팔로우하는 타 유저를 조회할 수 있는 API

<mark style="color:blue;">`GET`</mark> `https://www.eco-log-backend.kro.kr/api/user/following`

#### Headers

| Name                                    | Type   | Description                                          |
| --------------------------------------- | ------ | ---------------------------------------------------- |
| key<mark style="color:red;">\*</mark>   | String | Authorization                                        |
| value<mark style="color:red;">\*</mark> | String | <p>로그인 시 JWT<br>  - ex. <code>Bearer {토큰}</code></p> |

{% tabs %}
{% tab title="200: OK 팔로우 취소 완료" %}
{% tabs %}
{% tab title="Schema" %}

{% endtab %}
{% endtabs %}

```
[
 {
	 "userId": 2,
	 "nickName"": "활기찬 활동가",
	 "selfIntroduce": "간단한 자기소개글을 적어주세요!"
 }
]
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="194">항목</th><th width="111">타입</th><th>설명</th></tr></thead><tbody><tr><td>userId</td><td>Integer</td><td>팔로잉 유저 ID</td></tr><tr><td>userNickName</td><td>String</td><td>팔로잉 유저 닉네임</td></tr><tr><td>selfIntroduce</td><td>String</td><td>팔로잉 유저 자기소개</td></tr></tbody></table>

## 팔로워 삭제 <a href="#view" id="view"></a>

## 유저의 팔로워를 삭제하는 API

<mark style="color:red;">`DELETE`</mark> `https://www.eco-log-backend.kro.kr/api/user/follower`

#### Headers

| Name                                    | Type   | Description                                          |
| --------------------------------------- | ------ | ---------------------------------------------------- |
| key<mark style="color:red;">\*</mark>   | String | Authorization                                        |
| value<mark style="color:red;">\*</mark> | String | <p>로그인 시 JWT<br>  - ex. <code>Bearer {토큰}</code></p> |

#### Request Body

| Name                                       | Type   | Description    |
| ------------------------------------------ | ------ | -------------- |
| targetId<mark style="color:red;">\*</mark> | String | 삭제할 팔로워의 유저 ID |

{% tabs %}
{% tab title="200: OK 팔로워 삭제 완료" %}
{% tabs %}
{% tab title="Schema" %}

{% endtab %}
{% endtabs %}

```
[
 {
	 "userId": 2,
	 "nickName"": "활기찬 활동가",
	 "selfIntroduce": "간단한 자기소개글을 적어주세요!"
 }
]
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="194">항목</th><th width="111">타입</th><th>설명</th></tr></thead><tbody><tr><td>userId</td><td>Integer</td><td>팔로잉 유저 ID</td></tr><tr><td>userNickName</td><td>String</td><td>팔로잉 유저 닉네임</td></tr><tr><td>selfIntroduce</td><td>String</td><td>팔로잉 유저 자기소개</td></tr></tbody></table>
