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

# Admin

admin 관련 api method를 설명한 페이지

## 유저 관리(밴 설정) 메서드

<mark style="color:blue;">`GET`</mark> `/admin/modify/userBan`

user의 isEnabled 값을 설정해 관

#### Query Parameters

| Name                                 | Type | Description  |
| ------------------------------------ | ---- | ------------ |
| id<mark style="color:red;">\*</mark> | Long | user의 id(PK) |

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | login시 발급 받은 accessToken |

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

```json
{
  "email": "test_f77c0d992b32",
  "username": "test_4bdc3bfad426",
  "oauthId": "test_665baa789f75",
  "oAuthProvider": "GOOGLE",
  "isBan": true,
  "accountType": "ROLE_USER"
}
```

{% endtab %}

{% tab title="404: Not Found 해당 id의 user가 없는 경우 발생" %}

{% endtab %}
{% endtabs %}

## Post 생성 메서드

<mark style="color:green;">`POST`</mark> `/admin/create/post`

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | login시 발급 받은 accessToken |

#### Request Body

| Name                                                                                  | Type | Description |
| ------------------------------------------------------------------------------------- | ---- | ----------- |
| restaurantName, category, hashTag, memberName, x, y<mark style="color:red;">\*</mark> | json |             |

{% tabs %}
{% tab title="204: No Content " %}

{% endtab %}
{% endtabs %}

## Post 변경 메서드

<mark style="color:purple;">`PATCH`</mark> `/admin/modify/post`

#### Query Parameters

| Name                                 | Type | Description  |
| ------------------------------------ | ---- | ------------ |
| id<mark style="color:red;">\*</mark> | Long | post의 id(pk) |

#### Request Body

| Name                                                                                  | Type | Description |
| ------------------------------------------------------------------------------------- | ---- | ----------- |
| restaurantName, category, hashTag, memberName, x, y<mark style="color:red;">\*</mark> | json |             |

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

```json
{
  "id": 10,
  "location": {},
  "restaurantName": "test_1a75c0a27641",
  "categories": [
    "test_f0a185acc9ef"
  ],
  "hashTags": [
    "test_b224fb893de0"
  ],
  "memberNames": [
    "test_63a25ec44a53"
  ],
  "scrapCount": 34,
  "visitorReviewScore": 82.25,
  "visitorReviewCount": 87
}
```

{% endtab %}

{% tab title="404: Not Found 해당 id의 post가 없는 경우 발생" %}

{% endtab %}
{% endtabs %}

## admin 로그인 메서드

<mark style="color:green;">`POST`</mark> `/admin/signin`

#### Request Body

| Name                                             | Type | Description |
| ------------------------------------------------ | ---- | ----------- |
| email, oauthId<mark style="color:red;">\*</mark> | json |             |

{% tabs %}
{% tab title="204: No Content " %}
header에 accessToken, refreshToken(httpOnlyCookie) 담아서 전달
{% endtab %}
{% endtabs %}
