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

  • status code: 200
  • body
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

  • body
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

  • status code: 200
  • body
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

  • body
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

  • status code: 204
  • header
Key Value Type Info
session-token akjiodfj-asdkjf string ์„ธ์…˜ํ† ํฐ

Fail

  • body
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

  • status code: 204
Key Value Type Info
expired-token true boolean ์„ธ์…˜ํ† ํฐํ๊ธฐ ํ™•์ธ

Fail

  • body
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

  • status code: 204
  • header
Key Value Type Info
isDup true boolean ์ค‘๋ณต์œ ๋ฌด

Fail

  • body
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

  • status code: 200
  • body
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

  • body
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 ๋กœ๊ทธ์ธ์„ ์„ฑ๊ณตํ•œ ์œ ์ €์•„์ด๋””
  • body
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

  • status code: 200
  • body
Key Value Type Info
userId gksxodnd string ์•„์ด๋””
userName ํ•œํƒœ์›… string ์ด๋ฆ„
email [email protected] string ์ด๋ฉ”์ผ
birth 1994-05-20 date ์ƒ๋…„์›”์ผ
introduce ๋‚˜๋Š” ์ฝ”๋”ฉํ•˜๋Š” ์˜ค์ง•์–ด์•ผ string ์ž๊ธฐ์†Œ๊ฐœ

Fail

  • body
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

  • status code: 204

Fail

  • body
Key Value Type Info
code 400 int ์ƒํƒœ์ฝ”๋“œ
message bad request string ์—๋Ÿฌ๋ฉ”์‹œ์ง€

Fail์ด ๋  ์ˆ˜ ์žˆ๋Š” ๊ฒฝ์šฐ

400 : BAD_REQUEST

  • path variable์ด ์—†์„ ๊ฒฝ์šฐ

401 : UNAUTHORIZED

  • header์— ํ† ํฐ๊ฐ’์ด ์—†๊ฑฐ๋‚˜ ๋งŒ๋ฃŒ ๋˜์—ˆ์„ ๊ฒฝ์šฐ

500 : INTERNAL SERVER ERROR