USER API Doc - Kim-Gyuri/bookstore GitHub Wiki

  • νšŒμ›κ°€μž…
    • νšŒμ› κ°€μž… μ„±κ³΅ν–ˆμ„ λ•Œ
    • νšŒμ› κ°€μž… μ‹€νŒ¨ν–ˆμ„ λ•Œ (μ€‘λ³΅λœ 아이디)
  • 둜그인
    • 둜그인 μ„±κ³΅ν–ˆμ„ λ•Œ
    • 둜그인 μ‹€νŒ¨ν–ˆμ„ λ•Œ (잘λͺ»λœ ID, PASSWORD μž…λ ₯)
  • λ‘œκ·Έμ•„μ›ƒ
  • λ§ˆμ΄νŽ˜μ΄μ§€ (κ°œμΈμ •λ³΄ 쑰회)

βœ… νšŒμ›κ°€μž…

request-fields

Path Type Description
loginId String 둜그인 아이디
password String λΉ„λ°€λ²ˆν˜Έ
name String 이용자 이름
email String 이용자 이메일
city String μ£Όμ†Œ λ„μ‹œ
street String μ£Όμ†Œ 지역
zipcode String μ£Όμ†Œ 우편번호

1. νšŒμ› κ°€μž… μ„±κ³΅ν–ˆμ„ λ•Œ

Example request

POST http://localhost:8080/api/users
Content-Type: multipart/form-data;
Content-Length: 186081
Host: localhost:8080
Request Body { loginId: "test20", password: "test20!", name: "userAA", email: "[email protected]", city: "bucheon", street: "sosa", zipcode: "1234" }

Example response

HTTP 201 Created
Content-Type: application/json
response body {"name":"userAA","email":"[email protected]","password":"test20!"}

2. νšŒμ› κ°€μž… μ‹€νŒ¨ν–ˆμ„ λ•Œ (μ€‘λ³΅λœ 아이디)

Example response

HTTP 409 Conflict
Content-Type: text/plain;charset=UTF-8
Content-Length: 39
Response Body : 이미 μ‘΄μž¬ν•˜λŠ” μ•„μ΄λ””μž…λ‹ˆλ‹€.

βœ… 둜그인

request-fields

Path Type Description
loginId String 둜그인 아이디
password String λΉ„λ°€λ²ˆν˜Έ

1. 둜그인 μ„±κ³΅ν–ˆμ„ λ•Œ

Example request

POST /api/users/login
Content-Type: multipart/form-data
Content-Length: 282
Host: localhost:8080
Request Body : { loginId: "test20", password: "test20!"}

Example response

HTTP 200 ok
Response Body :{"loginId":"test20","password":"test20!"}

2. 둜그인 μ‹€νŒ¨ν–ˆμ„ λ•Œ (잘λͺ»λœ ID, PASSWORD μž…λ ₯)

Example response

HTTP 404 Not Found
Content-Type : text/plain;charset=UTF-8
Content-Length : 59
Response Body : 아이디 λ˜λŠ” λΉ„λ°€λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

βœ… λ‘œκ·Έμ•„μ›ƒ

Example request

POST /api/users/logout

Example response

HTTP 200 OK
Response Body : {"success":true,"message":"logout success!"}

βœ… λ§ˆμ΄νŽ˜μ΄μ§€

νšŒμ› 정보 쑰회

Example request

GET /api/users/info
Content-Type: multipart/form-data
Content-Length: 167
Host: localhost:8080
Request Body : { loginId: "test2"}

Example response

HTTP 200 ok
Content-Type: application/json
Response Body : {"email":"[email protected]","name":"userB","city":"진주","income":0}
⚠️ **GitHub.com Fallback** ⚠️