User api protocol - SG-Finder/auth_server GitHub Wiki
             Sign up User
Request
- endpoint: POST /user/signup
- body
| Key | Value | Type | Essential | Info | 
| userId | gksxodnd | string(45byte) | true | ์์ด๋ | 
| passwd | dkgh12 | string(200byte) | true | ๋น๋ฐ๋ฒํธ | 
| userName | ํํ์ | string(40byte) | true | ์ด๋ฆ | 
| email | [email protected] | string(60byte) | true | ์ด๋ฉ์ผ | 
| birth | 1994-05-20 | string | true | ์๋
์์ผ | 
| introduce | ์๋
 ๋๋ ์ฝ๋ฉํ๋ ์ค์ง์ด์ผ | string(128byte) | true | ์๊ธฐ์๊ฐ | 
Response
Success
| Key | Value | Type | Essential | Info | 
| userId | gksxodnd | string(45byte) | true | ์์ด๋ | 
| userName | ํํ์ | string(40byte) | true | ์ด๋ฆ | 
| email | [email protected] | string(60byte) | true | ์ด๋ฉ์ผ | 
| birth | 1994-05-20 | string | true | ์๋
์์ผ | 
| introduce | ์๋
 ๋๋ ์ฝ๋ฉํ๋ ์ค์ง์ด์ผ | string(128byte) | true | ์๊ธฐ์๊ฐ | 
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- Essentialํ ํ๋ผ๋ฏธํฐ๊ฐ ์์ ๊ฒฝ์ฐ
- parameter ๊ท๊ฒฉ์ด ๋ง์ง ์์ ๊ฒฝ์ฐ (ex. age : -1)
409 : DUPLICATED
- userId๊ฐ ์ค๋ณต๋  ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
Register Player nickname for game
request
- endpoint: POST /user/register/game
- body
| Key | Value | Type | Essential | Info | 
| nickname | Zookeeper | string(50byte) | true | ๊ฒ์ ๋๋ค์ | 
response
Success
| Key | Value | Type | Info | 
| nickname | Zookeeper | string | ํ๋ ์ด์ด์ ๋๋ค์ | 
| tier | BRONZE | string | ํ๋ ์ด์ด์ ํฐ์ด | 
| score | 0 | int | ํ๋ ์ด์ด์ ์ ์ | 
| history | data | json object | ํ๋ ์ด์ด์ ํ์คํ ๋ฆฌ ์ ๋ณด | 
| point | 0 | int | ํ๋ ์ด์ด์ ํฌ์ธํธ | 
history data
| Key | Value | Type | Info | 
| win | 0 | int | ์น๋ฆฌ ํ์ | 
| lose | 0 | int | ํจ๋ฐฐ ํ์ | 
| oneShot | 0 | int | ํ๋ฒ์ ์ ์ ์ฐพ๋ ๋ฏธ์
 ๋ฌ์ฑ ํ์ | 
| finder | 0 | int | ์งง์ ์๊ฐ์์ ์ ์ ์ฐพ๋ ๋ฏธ์
 ๋ฌ์ฑ ํ์ | 
| lastWeekRank | 0 | int | ํ๋ ์ด์ด์ ๋ญํฌ(ref: ํํ๋ ์คํํ์ง ์์์ผ๋ฉด 0) | 
example
{
    "nickname": "zookeeper1",
    "tier": "BRONZE",
    "score": 0,
    "history": {
        "win": 0,
        "lose": 0,
        "oneShot": 0,
        "finder": 0,
        "lastWeekRank": 0
    },
    "weapon": [
        {
            "name": "hand",
            "damage": 0,
            "price": 0,
            "usableCount": 2147483647
        }
    ],
    "point": 0
}
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- Essentialํ ํ๋ผ๋ฏธํฐ๊ฐ ์์ ๊ฒฝ์ฐ
- parameter ๊ท๊ฒฉ์ด ๋ง์ง ์์ ๊ฒฝ์ฐ
401 : UNAUTHORIZED
- header์ ํ ํฐ๊ฐ์ด ์๊ฑฐ๋ ๋ง๋ฃ ๋์์ ๊ฒฝ์ฐ
409 : DUPLICATED
- nickname์ด ์ค๋ณต๋  ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
Sign in User
Request
- endpoint: POST /user/signin
- body
| Key | Value | Type | Essential | Info | 
| userId | gksxodnd | string(45byte) | true | ์์ด๋ | 
| passwd | dkgh12 | string(200byte) | true | ๋น๋ฐ๋ฒํธ | 
Response
Success
| Key | Value | Type | Info | 
| session-token | akjiodfj-asdkjf | string | ์ธ์
ํ ํฐ | 
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- Essentialํ ํ๋ผ๋ฏธํฐ๊ฐ ์์ ๊ฒฝ์ฐ
- parameter ๊ท๊ฒฉ์ด ๋ง์ง ์์ ๊ฒฝ์ฐ (ex. age : -1)
401 : UNAUTHORIZED
- ์ ์ ์์ด๋๊ฐ ์กด์ฌํ์ง ์์ ๊ฒฝ์ฐ
- ๋น๋ฐ๋ฒํธ๊ฐ ํ๋ ธ์ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
Sign out User
Request
- endpoint: GET /user/signout
- header
| Key | Value | Type | Info | 
| session-token | akjiodfj-asdkjf | string | ์ธ์
ํ ํฐ | 
| userId | gksxodnd007 | string | ์์ด๋ | 
Response
Success
| Key | Value | Type | Info | 
| expired-token | true | boolean | ์ธ์
ํ ํฐํ๊ธฐ ํ์ธ | 
Fail
| Key | Value | Type | Info | 
| code | 500 | int | ์ํ์ฝ๋ | 
| message | internal server error | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
User ID ์ค๋ณต์ฒดํฌ
Request
- endpoint: GET /user/checkDup/{userId}
Response
Success
| Key | Value | Type | Info | 
| isDup | true | boolean | ์ค๋ณต์ ๋ฌด | 
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- path variable์ด null์ผ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
User ์ ๋ณด ์กฐํ
Request
- endpoint: GET /user/{userId}
- header
| Key | Value | Type | Info | 
| session-token | akjiodfj-asdkjf | string | ์ธ์
ํ ํฐ | 
| userId | gksxodnd | string | ๋ก๊ทธ์ธ์ ์ฑ๊ณตํ ์ ์ ์์ด๋ | 
Response
Success
| Key | Value | Type | Info | 
| userId | gksxodnd | string | ์์ด๋ | 
| userName | ํํ์ | string | ์ด๋ฆ | 
| nickname | zookeeper | string | ํ๋ ์ด์ด ๋๋ค์ | 
| email | [email protected] | string | ์ด๋ฉ์ผ | 
| birth | 1994-05-20 | date | ์๋
์์ผ | 
| introduce | ๋๋ ์ฝ๋ฉํ๋ ์ค์ง์ด์ผ | string | ์๊ธฐ์๊ฐ | 
nickname๊ฐ์ด 0์ด๋ฉด ํ๋ ์ด์ด๋ฅผ ๋ฑ๋กํ์ง ์์ ๊ฒฝ์ฐ์ด๋ฏ๋ก ๋ฑ๋กํ์ฌ์ผํจ
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- path variable์ด null์ธ ๊ฒฝ์ฐ
401 : UNAUTHORIZED
- header์ ํ ํฐ๊ฐ์ด ์๊ฑฐ๋ ๋ง๋ฃ ๋์์ ๊ฒฝ์ฐ
404 : NOT FOUND
- userId๊ฐ ์กด์ฌํ์ง ์๋ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
User ์ ๋ณด ์์ 
Request
- endpoint: PUT /user/{userId}
- header
| Key | Value | Type | Info | 
| session-token | akjiodfj-asdkjf | string | ์ธ์
ํ ํฐ | 
| userId | gksxodnd | string | ๋ก๊ทธ์ธ์ ์ฑ๊ณตํ ์ ์ ์์ด๋ | 
| Key | Value | Type | Essential | Info | 
| userName | ํํ์ | string(45byte) | true | ์ด๋ฆ | 
| passwd | dkgh12 | string(200byte) | true | ๋น๋ฐ๋ฒํธ | 
| email | [email protected] | string(60byte) | true | ์ด๋ฉ์ผ | 
| birth | 1994-05-20 | string(yyyy-MM-dd) | true | ์๋
์์ผ | 
| introduce | ๋๋ ์ฝ๋ฉํ๋ ์ค์ง์ด์ผ | string(128byte) | true | ์๊ธฐ์๊ฐ | 
Response
Success
| Key | Value | Type | Info | 
| userId | gksxodnd | string | ์์ด๋ | 
| userName | ํํ์ | string | ์ด๋ฆ | 
| email | [email protected] | string | ์ด๋ฉ์ผ | 
| birth | 1994-05-20 | date | ์๋
์์ผ | 
| introduce | ๋๋ ์ฝ๋ฉํ๋ ์ค์ง์ด์ผ | string | ์๊ธฐ์๊ฐ | 
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- path variable์ด null์ธ ๊ฒฝ์ฐ
- Essentialํ ํ๋ผ๋ฏธํฐ๊ฐ ์์ ๊ฒฝ์ฐ
- parameter ๊ท๊ฒฉ์ด ๋ง์ง ์์ ๊ฒฝ์ฐ (ex. age : -1)
401 : UNAUTHORIZED
- header์ ํ ํฐ๊ฐ์ด ์๊ฑฐ๋ ๋ง๋ฃ ๋์์ ๊ฒฝ์ฐ
404 : NOT FOUND
- userId๊ฐ ์กด์ฌํ์ง ์๋ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR
User ์ญ์ 
request
- endpoint: DELETE /user/{userId}
- header
| Key | Value | Type | Info | 
| session-token | akjiodfj-asdkjf | string | ์ธ์
ํ ํฐ | 
| userId | gksxodnd | string | ๋ก๊ทธ์ธ์ ์ฑ๊ณตํ ์ ์ ์์ด๋ | 
response
Success
Fail
| Key | Value | Type | Info | 
| code | 400 | int | ์ํ์ฝ๋ | 
| message | bad request | string | ์๋ฌ๋ฉ์์ง | 
Fail์ด ๋  ์ ์๋ ๊ฒฝ์ฐ
400 : BAD_REQUEST
- path variable์ด ์์ ๊ฒฝ์ฐ
401 : UNAUTHORIZED
- header์ ํ ํฐ๊ฐ์ด ์๊ฑฐ๋ ๋ง๋ฃ ๋์์ ๊ฒฝ์ฐ
500 : INTERNAL SERVER ERROR