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

# User

## UserInfo

<mark style="color:blue;">`GET`</mark> `https://server.dorunapp.com/user/{userId}`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | Cookie      |

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

```javascript
{
    "data": {
        "nickname" : "string",
        "password" : "null"
        "email" : "string",
        "image" : "string",
        "medal" : [...,string],
        "log" : [...,string],
        "oauth" : "string"
        "isauth" : boolean,
        "crewId" : int
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "invalid userId"
    "errormsg" : error
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Signup

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/signup`

#### Request Body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| nickname<mark style="color:red;">\*</mark> | String | user nickname |
| password<mark style="color:red;">\*</mark> | String | user password |
| email<mark style="color:red;">\*</mark>    | String | user email    |

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

```javascript
{
    "data": {
        "id" : number,
        "nickname" : "string",
        "password" : "string"
        "email" : "string"
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}

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

```javascript
{
    "message" : `${email} already exists`
}

{
    "message" : `${nickname} already exists`
}
```

{% endtab %}
{% endtabs %}

## Signout

<mark style="color:red;">`DELETE`</mark> `https://server.dorunapp.com/user/signout/{userId}`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | Cookie      |

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

```javascript
{
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Login

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/login`

#### Request Body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| email<mark style="color:red;">\*</mark>    | String | user email    |
| password<mark style="color:red;">\*</mark> | String | user password |

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

```javascript
{
    "data": {
        "nickname" : "string",
        "password" : "null"
        "email" : "string",
        "image" : "string",
        "medal" : [...,string],
        "log" : [...,string],
        "oauth" : "string"
        "isauth" : boolean,
        "crewId" : int
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "invalid user Profile"
    "errormsg" : error
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Logout

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/logout`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | Cookie      |

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

```javascript
{
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## UserEdit

<mark style="color:purple;">`PATCH`</mark> `https://server.dorunapp.com/user`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | Cookie      |

#### Request Body

| Name     | Type   | Description   |
| -------- | ------ | ------------- |
| nickname | String | user nickname |
| image    | String | user iamge    |
| email    | String | user email    |
| password | String | user password |

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

```javascript
{
    "data": {
        "id" : number,
        "nickname" : "string",
        "password" : "string",
        "email" : "string",
        "image" : "string"
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Oauth login

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/oauth`

#### Request Body

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Authorization Grant |

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

```javascript
{
    "data": {
        "nickname" : "string",
        "password" : "null"
        "email" : "string",
        "image" : "string"
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Confirm Email Resend

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/confirm_email`

#### Request Body

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| userId<mark style="color:red;">\*</mark> | number |             |
| email<mark style="color:red;">\*</mark>  | String |             |

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

```javascript
{
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "invalid user info"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## User Password Reset

<mark style="color:purple;">`PATCH`</mark> `https://server.dorunapp.com/user/reset_password`

#### Request Body

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

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

```javascript
{
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}

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

```javascript
{
    "message" : "invalid user email"
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## Guest Login

<mark style="color:green;">`POST`</mark> `https://server.dorunapp.com/user/guest_login`

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

```javascript
{
    "data": {
        "nickname" : "string",
        "password" : "null"
        "email" : "string",
        "image" : "string"
    }
    "message" : "success"
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}

## User History Edit

<mark style="color:blue;">`GET`</mark> `https://server.dorunapp.com/user.history`

#### Request Body

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| userId<mark style="color:red;">\*</mark> | Number |             |
| data<mark style="color:red;">\*</mark>   | String |             |

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

```javascript
{
    "data":
    {
        userInfo
    }
}
```

{% endtab %}

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

```javascript
{
    "message" : "Internal Server Error",
    "errormsg" : error
}
```

{% endtab %}
{% endtabs %}
