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

# 관리자 페이지

## 유저 전체 목록

<mark style="color:blue;">`GET`</mark> `/api/users`

#### Query Parameters

| Name       | Type   | Description             |
| ---------- | ------ | ----------------------- |
| pageNumber | Number | pageNumber 1 is default |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

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

```javascript
[
    {
        "general": {
            "email": "test@test.com"
        },
        "active": {
            "lastAccessTime": "2021-11-30T01:28:29.942Z",
            "isClosed": false
        },
        "_id": "61a43a308f72e06afa31d",
        "name": "알로",
        "createdAt": "2021-11-29T02:25:52.260Z"
    },
    {
        "general": {
            "email": "a@test.com"
        },
        "active": {
            "isClosed": false
        },
        "_id": "61a4e52b4f5f6aabfec61",
        "name": "남대문",
        "createdAt": "2021-11-29T14:35:23.353Z"
    },
    ...
    "page": 2,
    "pages": 4
]
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "message": "Not authorized as an admin"
}
```

{% endtab %}
{% endtabs %}

### 작가

## 작가 등록 / + 첫 상품 등록

<mark style="color:green;">`POST`</mark> `/api/artists`

생성 시 반드시 상품 하나 함 등록

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |

#### Request Body

| Name                                                     | Type   | Description |
| -------------------------------------------------------- | ------ | ----------- |
| product.image<mark style="color:red;">\*</mark>          | String |             |
| product.title<mark style="color:red;">\*</mark>          | String |             |
| product.artCode<mark style="color:red;">\*</mark>        | String |             |
| artist.record<mark style="color:red;">\*</mark>          | String |             |
| artist.aka<mark style="color:red;">\*</mark>             | String |             |
| artist.name<mark style="color:red;">\*</mark>            | String |             |
| artist.code<mark style="color:red;">\*</mark>            | String |             |
| product.theme<mark style="color:red;">\*</mark>          | String |             |
| product.info.details<mark style="color:red;">\*</mark>   | String |             |
| product.info.size<mark style="color:red;">\*</mark>      | String |             |
| product.info.canvas<mark style="color:red;">\*</mark>    | Number |             |
| product.info.createdAt<mark style="color:red;">\*</mark> | String |             |
| product.price<mark style="color:red;">\*</mark>          | Number |             |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "code": "0001",
    "name": "안영희",
    "aka": "Bye",
    "record": "안영희 작가는 자신의 작품을 통해 따듯한 기운을 전파하고자 노력합니다. 특히 빛에 초점을 두고 형체를 가늠할 수 없는 빛의 특징을 다른 대상에 투과 혹은 반사를 통해 나타내어 인지하기 어려운 것에 대한 감각을 자극해 일깨우려는 시도가 돋보입니다.",
    "joinAt": "2021-11-29T12:33:24.988Z",
    "countOfWorks": 1
}
```

{% endtab %}
{% endtabs %}

## 작가 비활성화(중단) | 활성화

<mark style="color:purple;">`PATCH`</mark> `/api/artists`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |

#### Request Body

| Name                                       | Type     | Description |
| ------------------------------------------ | -------- | ----------- |
| isActive<mark style="color:red;">\*</mark> | Boolean  |             |
| artistId<mark style="color:red;">\*</mark> | ObjectId |             |

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

```javascript
{
    "message": "해당 작가 비활성화 해제 or 완료"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "message": "true? or false"
}
```

{% endtab %}
{% endtabs %}

## 작가 내용 수정

<mark style="color:purple;">`PATCH`</mark> `/api/artists/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId | 작가 고유 아이디   |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |

#### Request Body

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| name      | String |             |
| aka       | String |             |
| record    | String |             |
| thumbnail | String |             |

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

```javascript
{
    "code": "0001",
    "name": "안영희",
    "aka": "Bye Hee",
    "record": "안영희 작가는 자신의 작품을 통해 따듯한 기운을 전파하고자 노력합니다. 특히 빛에 초점을 두고 형체를 가늠할 수 없는 빛의 특징을 다른 대상에 투과 혹은 반사를 통해 나타내어 인지하기 어려운 것에 대한 감각을 자극해 일깨우려는 시도가 돋보입니다.",
    "joinAt": "2021-11-29T12:31:38.051Z",
    "countOfWorks": 1
}
```

{% endtab %}
{% endtabs %}

### 상품

## 상품 등록

<mark style="color:green;">`POST`</mark> `/api/products`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |

#### Request Body

| Name                                      | Type     | Description                         |
| ----------------------------------------- | -------- | ----------------------------------- |
| artist<mark style="color:red;">\*</mark>  | ObjectId |                                     |
| artCode<mark style="color:red;">\*</mark> | String   |                                     |
| title<mark style="color:red;">\*</mark>   | String   |                                     |
| image<mark style="color:red;">\*</mark>   | String   |                                     |
| theme<mark style="color:red;">\*</mark>   | String   |                                     |
| info<mark style="color:red;">\*</mark>    | Object   | details / size / canvas / createdAt |
| price<mark style="color:red;">\*</mark>   | Number   |                                     |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "message": "상품이 등록되었습니다",
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "message": "상품 정보를 모두 입력해주세요",
}
```

{% endtab %}
{% endtabs %}

## 해당 상품 수정

<mark style="color:purple;">`PATCH`</mark> `/api/products/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId | 해당 상품고유아이디  |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |

#### Request Body

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| title | String |                                     |
| image | String |                                     |
| theme | String |                                     |
| info  | Object | details / size / canvas / createdAt |
| price | Number |                                     |

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

```javascript
{
    "message": "해당 상품 수정이 완료되었습니다",
}
```

{% endtab %}
{% endtabs %}

## 해당 상품 삭제 (미판매 시)

<mark style="color:red;">`DELETE`</mark> `/api/products/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId |             |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

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

```javascript
{
    "message": "해당 상품이 삭제되었습니다"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "message": "해당 상품은 삭제할 수 없습니다"
}
```

{% endtab %}
{% endtabs %}

### 주문&#x20;

## 주문 진행단계 변경 ( 발송 준비, 배송 중, 배송 완료, 반품 신청)

<mark style="color:purple;">`PATCH`</mark> `/api/orders/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId |             |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |

#### Request Body

| Name                                     | Type   | Description                     |
| ---------------------------------------- | ------ | ------------------------------- |
| status<mark style="color:red;">\*</mark> | Number | 발송준비중 1, 배송중 2, 배송완료 3, 반품요청중 4 |

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

```javascript
{
    "message": "해당 주문이 발송 준비 중 단계로 변경되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "message": "진행 단계를 알 수 없습니다"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "message": "해당 주문내역이 존재하지 않습니다"
}
```

{% endtab %}
{% endtabs %}

## 전체 주문 내역

<mark style="color:blue;">`GET`</mark> `/api/orders`

#### Query Parameters

| Name       | Type   | Description             |
| ---------- | ------ | ----------------------- |
| pageNumber | Number | pageNumber 1 is default |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

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

```javascript
[
    {
        "result": {
            "id": "20211130111111",
            "paidAt": "2021-12-01T17:15:53.146Z",
            "status": 0,
            "updatedAt": "2021-12-01T17:15:53.146Z"
        },
        "_id": "61a7adc903b7708e5dbba693",
        "user": {
            "general": {
                "email": "a@test.com"
            },
            "_id": "61a4e52b4f5f6aa036bfec61"
        },
        "orderItems": [
            {
                "image": "/images/bye/1.jpg",
                "title": "잠식",
                "artist": "안영희",
                "size": "73x61cm(20호)",
                "price": 99000,
                "product": "61a4c895f59ea1b7a727a658"
            },
            {
                "image": "/images/owner/1.jpg",
                "title": "파멸",
                "artist": "로키산맥",
                "size": "163x131cm(100호)",
                "price": 469000,
                "product": "61a4debe4f5f6aa036bfec5f"
            }
        ],
        "totalPrice": 578000
    },
    ...
    "page": 1,
    "pages": 4
]
```

{% endtab %}
{% endtabs %}

### 이벤트&#x20;

## 배너 등록

<mark style="color:green;">`POST`</mark> `/api/events`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| heading<mark style="color:red;">\*</mark>  | String |             |
| content<mark style="color:red;">\*</mark>  | String |             |
| linkname<mark style="color:red;">\*</mark> | String |             |
| link<mark style="color:red;">\*</mark>     | String |             |
| image<mark style="color:red;">\*</mark>    | String |             |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "heading": "[Welcome to Lumiere]",
    "content": "여기 루미에르에서 당신의 예술적 감성을 일깨워보세요",
    "linkname": "작품 구경하기",
    "link": "http://example.com",
    "image": "/images/owner/5.jpg",
    "_id": "61a586353a08eda835961cb1"
}
```

{% endtab %}
{% endtabs %}

## 해당 배너 수정

<mark style="color:purple;">`PATCH`</mark> `/api/events/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId | 이벤트 고유아이디   |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json |
| authorization<mark style="color:red;">\*</mark> | String | Bearer Token     |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| heading  | String |             |
| content  | String |             |
| linkname | String |             |
| link     | String |             |
| image    | String |             |

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

```javascript
{
        "_id": "61a587133a08eda835961cb7",
        "heading": "[루미에르의 새로운 작가] 로키산맥",
        "content": "보는 이의 눈길을 사로잡는 로키산맥 작가만의 세계관이 돋보이는 작품들!",
        "linkname": "작가 구경하기",
        "link": "http://example.com",
        "image": "/images/owner/3.jpeg"
 }
```

{% endtab %}
{% endtabs %}

## 해당 배너 삭제

<mark style="color:red;">`DELETE`</mark> `/api/events/:id`

#### Path Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| id<mark style="color:red;">\*</mark> | ObjectId | 배너고유아이디     |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | String | Bearer Token |

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

```javascript
{
        "message": "해당 배너가 정상적으로 삭제되었습니다",
}
```

{% endtab %}
{% endtabs %}
