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

# Admin API

관리자 전용 API

## 회원 삭제

<mark style="color:blue;">`GET`</mark> `https://soojle.io/admin_remove_user/<string:user_id>`

&#x20; 회원 삭제를 위한 API

#### Path Parameters

| Name     | Type   | Description  |
| -------- | ------ | ------------ |
| user\_id | string | 삭제 대상 회원 아이디 |

#### Headers

| Name          | Type   | Description                                   |
| ------------- | ------ | --------------------------------------------- |
| Authorization | string | <p>"Bearer " + \<token><br>(관리자 전용 토큰 필수)</p> |

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

```javascript
1. 성공
{
    result: "success"
}
2. 관리자 토큰이 아닐 시
{
    result: "Not admin"
}
3. 삭제 대상 회원이 없을 시
{
    result: "Not found"
}
```

{% endtab %}
{% endtabs %}

## 공지사항 전체 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_all_notice`

&#x20; 공지사항 전체 반환을 위한 API

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

```javascript
1. 성공
{
    result: "success",
    notice_list: <json_array>
    [
        {
            _id: <object_id>
            title: <string>
            post: <string>
            view: <int>
            date: <Datetime>
            activation: <int>
        }
    ]
}

```

{% endtab %}
{% endtabs %}

## 공지사항 단일 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_notice/<string:notice_obi>`

&#x20; 공지사항 단일 반환을 위한 API

#### Path Parameters

| Name        | Type   | Description        |
| ----------- | ------ | ------------------ |
| notice\_obi | string | 공지사항 단일 Object\_id |

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

```javascript
1. 성공
{
    result: "success",
    notice_list: <json>
    {
        _id: <object_id>
        title: <string>
        post: <string>
        view: <int>
        date: <Datetime>
        activation: <int>
    }
}
```

{% endtab %}
{% endtabs %}

## 공지사항 추가

<mark style="color:green;">`POST`</mark> `https://soojle.io/insert_notice`

&#x20; 공지사항 추가를 위한 API

#### Headers

| Name          | Type   | Description                                  |
| ------------- | ------ | -------------------------------------------- |
| Authorization | string | <p>"Bearer" + \<Token><br>(관리자 전용 토큰 필수)</p> |

#### Request Body

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| title | string | 제목          |
| post  | string | 내용          |

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

```javascript
1. 성공
{
    result: "success"
}
2. 관리자 토큰이 아닐 시
{
    result: "Not admin"
}
```

{% endtab %}
{% endtabs %}

## 공지사항 수정

<mark style="color:green;">`POST`</mark> `https://soojle.io/update_notice/<string:notice_obi>`

&#x20; 공지사항 전체 반환 위한 API

#### Path Parameters

| Name        | Type   | Description           |
| ----------- | ------ | --------------------- |
| notice\_obi | string | 수정 대상 공지사항 Object\_id |

#### Headers

| Name          | Type   | Description                                  |
| ------------- | ------ | -------------------------------------------- |
| Authorization | string | <p>"Bearer" + \<Token><br>(관리자 전용 토큰 필수)</p> |

#### Request Body

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| title | string | 제목          |
| post  | string | 내용          |

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

```javascript
1. 성공
{
    result: "success"
}
2. 관리자 토큰이 아닐 시
{
    result: "Not admin"
}
```

{% endtab %}
{% endtabs %}

## 공지사항 삭제&#x20;

<mark style="color:blue;">`GET`</mark> `https://soojle.io/remove_notice/<string:notice_obi>`

&#x20; 공지사항 삭제를 위한 API

#### Path Parameters

| Name        | Type   | Description           |
| ----------- | ------ | --------------------- |
| notice\_obi | string | 수정 대상 공지사항 Object\_id |

#### Headers

| Name          | Type   | Description                                  |
| ------------- | ------ | -------------------------------------------- |
| Authorization | string | <p>"Bearer" + \<Token><br>(관리자 전용 토큰 필수)</p> |

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

```javascript
1. 성공
{
    result: "success"
}
2. 관리자 토큰이 아닐 시
{
    result: "Not admin"
}
3. 해당 게시글이 없을 시
{
    result: "Not found"
}
```

{% endtab %}
{% endtabs %}

## 피드백 전송&#x20;

<mark style="color:green;">`POST`</mark> `https://soojle.io/remove_notice/<string:notice_obi>`

&#x20; 피드백 전송을 위한 API

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | "Bearer" + \<Token> |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| type     | string | 피드백 종류      |
| post     | string | 내용          |
| user\_id | string | 보낸이         |

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

```javascript
1. 성공
{
    result: "success"
}
2. 옳바른 토큰이 아닐 시
{
    result: "bad request"
}
3. 실패
{
    result: "fail"
}
```

{% endtab %}
{% endtabs %}

## 관리자 판단용 API&#x20;

<mark style="color:blue;">`GET`</mark> `https://soojle.io/check_admin`

&#x20; 관리자 판을 위한 API

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | "Bearer" + \<Token> |

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

```javascript
1. 성공
{
    result: "success"
}
2. 관리자 아닐 때
{
    result: "Not admin"
}
```

{% endtab %}
{% endtabs %}
