HTTP Methods

Verb Usage

GET

Used to retrieve a resource

POST

Used to create a new resource

PATCH

Used to update an existing resource, including partial updates

DELETE

Used to delete an existing resource

HTTP status codes

Status code Usage

200 OK

The request completed successfully

201 Created

A new resource has been created successfully. The resource’s URI is available from the response’s Location header

204 No Content

An update to an existing resource has been applied successfully

400 Bad Request

The request was malformed. The response body will include an error providing further information

401 Unauthorized

The request has not been applied because it lacks valid authentication credentials for the target resource.

403 Forbidden

The server understood the request but refuses to authorize it.

404 Not Found

The requested resource did not exist

409 Conflict

The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request.

USER API

1. CRUD USER

회원가입

1. Success

요청 필드

Path Type Description

email

String

The user’s email address

password

String

The user’s password

nickname

String

The user’s nickname

phone

String

The user’s phone

Example request

POST /users HTTP/1.1
Content-Type: application/json
Content-Length: 91
Host: localhost:8080

{"email":"rdj10149@gmail.com","password":"11000000","nickname":"ryu","phone":"01012123434"}

Example response

HTTP/1.1 201 Created

1. fail 요청 필드

Path Type Description

email

String

로그인시 사용할 이메일

password

String

8자 이상 20자 이하의 비밀번호

nickname

String

닉네임

phone

String

휴대폰 번호

Example request

POST /users HTTP/1.1
Content-Type: application/json
Content-Length: 91
Host: localhost:8080

{"email":"rdj10149@gmail.com","password":"11000000","nickname":"ryu","phone":"01012123434"}

Example response

HTTP/1.1 409 Conflict
Content-Type: text/plain;charset=UTF-8
Content-Length: 16

이메일 중복

회원 탈퇴

Path Type Description

password

String

회원 비밀번호

Example request

DELETE /users HTTP/1.1
Content-Type: application/json
Content-Length: 25
Host: localhost:8080

{"password":"test121213"}

Example response

HTTP/1.1 200 OK

2. Fail

Path Type Description

password

String

회원 비밀번호

Example request

DELETE /users HTTP/1.1
Content-Type: application/json
Content-Length: 25
Host: localhost:8080

{"password":"test121213"}

Example response

HTTP/1.1 401 Unauthorized
Content-Type: text/plain;charset=UTF-8
Content-Length: 68

잘못된 비밀번호입니다. 비밀번호를 확인해주세요.

이메일 중복 검사

1. Success

Table 1. /users/user-emails/{email}/exists
Parameter Description

email

이메일

Example request

GET /users/user-emails/rdj10149@gmail.com/exists HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 5

false

2. Fail

Table 2. /users/user-emails/{email}/exists
Parameter Description

email

이메일

Example request

GET /users/user-emails/rdj10149@gmail.com/exists HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4

true
중복 검사 통과시 false , 중복 검사 실패시 true가 리턴됩니다.

닉네임 중복 검사

1. Success

Table 3. /users/user-nicknames/{nickname}/exists
Parameter Description

nickname

닉네임

Example request

GET /users/user-nicknames/ryu/exists HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 5

false

2. Fail

Table 4. /users/user-nicknames/{nickname}/exists
Parameter Description

nickname

닉네임

Example request

GET /users/user-nicknames/ryu/exists HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4

true
중복 검사 통과시 false , 중복 검사 실패시 true가 리턴됩니다.

휴대폰 인증

1. Send SMS

request-fields

Path Type Description

phone

String

인증번호를 받을 휴대폰

certificationNumber

String

null: 인증 번호 발송시 사용하지 않는 값

Example request

POST /users/sms-certification/sends HTTP/1.1
Content-Type: application/json
Content-Length: 52
Host: localhost:8080

{"phone":"01022334455","certificationNumber":"null"}

Example response

HTTP/1.1 201 Created

2. Success : Authentication Successful

request-fields

Path Type Description

phone

String

인증번호를 받은 휴대폰 번호

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/sms-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 53
Host: localhost:8080

{"phone":"01011223344","certificationNumber":"12345"}

Example response

HTTP/1.1 200 OK

3. Fail : Authentication failed
request-fields

Path Type Description

phone

String

인증번호를 받은 휴대폰 번호

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/sms-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 53
Host: localhost:8080

{"phone":"01011223344","certificationNumber":"12345"}

Example response

HTTP/1.1 400 Bad Request

COMMENT : 휴대폰 인증 성공시 200 OK,실패시 4000 Bad Request
+certificationNumber 는 휴대폰 Api 사용
---

이메일 인증(토큰)

1. Success : Authentication Successful

request-parameters

Parameter Description

token

회원가입시 발송되는 토큰

email

회원가입시 입력한 이메일

Example request

GET /users/email-check-token?token=e315d70b-2805-4c09-b354-b5f253e724e9&email=rdj10149%40gmail.com HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK

2. Fail : Authentication failed

request-parameters

Parameter Description

token

회원가입시 발송되는 랜덤 토큰

email

회원가입시 입력한 이메일

Example request

GET /users/email-check-token?token=37eefd45-385d-4eaf-9198-b902964ac7b9&email=rdj10149%40gmail.com HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 401 Unauthorized
Content-Type: text/plain;charset=UTF-8
Content-Length: 115

인증 토큰이 만료되었습니다. 마이페이지에서 인증 토큰 재전송 버튼을 클릭해주세요.

3. resend

Example request

POST /users/resend-email-token HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
회원가입시 입력한 이메일로 인증 토큰이 전송됩니다. 해당 토큰은 24시간동안 유효하며, 24시간이 경과되었을 경우 토큰 재전송 요청을 진행해야 합니다.

2. login / logout

로그인

1. Success

request-fields

Path Type Description

email

String

login ID(email)

password

String

password

Example request

POST /users/login HTTP/1.1
Content-Type: application/json
Content-Length: 50
Host: localhost:8080

{"email":"test11@naver.com","password":"test1234"}

Example response

HTTP/1.1 200 OK

2. Failed

request-fields

Path Type Description

email

String

login ID(email)

password

String

password

Example request

POST /users/login HTTP/1.1
Content-Type: application/json
Content-Length: 50
Host: localhost:8080

{"email":"test11@naver.com","password":"test1234"}

Example response

HTTP/1.1 404 Not Found
Content-Type: text/plain;charset=UTF-8
Content-Length: 32

ID 또는 PW를 확인하세요.

로그아웃

1. Success

Example request

DELETE /users/logout HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK

3. 비밀번호 찾기

회원 리소스

1. successful get resource

Table 5. /users/find/{email}
Parameter Description

email

이메일

Example request

GET /users/find/test123@test.com HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Disposition: inline;filename=f.txt
Content-Type: application/json
Content-Length: 50

{"email":"test123@test.com","phone":"01012334444"}

2. Failed to get resources

Table 6. /users/find/{email}
Parameter Description

email

이메일

Example request

GET /users/find/test123@test.com HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 404 Not Found
Content-Disposition: inline;filename=f.txt
Content-Type: text/plain;charset=UTF-8
Content-Length: 32

ID 또는 PW를 확인하세요.

휴대폰 인증

1. Send SMS

request-fields

Path Type Description

phone

String

인증번호를 받을 휴대폰

certificationNumber

String

null: 인증 번호 발송시 사용하지 않는 값

Example request

POST /users/sms-certification/sends HTTP/1.1
Content-Type: application/json
Content-Length: 52
Host: localhost:8080

{"phone":"01022334455","certificationNumber":"null"}

Example response

HTTP/1.1 201 Created

2. Success : Authentication Successful
request-fields

Path Type Description

phone

String

인증번호를 받은 휴대폰 번호

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/sms-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 53
Host: localhost:8080

{"phone":"01011223344","certificationNumber":"12345"}

Example response

HTTP/1.1 200 OK

3. Fail : Authentication failed
request-fields

Path Type Description

phone

String

인증번호를 받은 휴대폰 번호

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/sms-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 53
Host: localhost:8080

{"phone":"01011223344","certificationNumber":"12345"}

Example response

HTTP/1.1 400 Bad Request

이메일 인증

1. Send Email

request-fields

Path Type Description

email

String

인증받을 이메일

certificationNumber

Null

null: 인증 이메일 발송시 사용하지 않는 값

Example request

POST /users/email-certification/sends HTTP/1.1
Content-Type: application/json
Content-Length: 56
Host: localhost:8080

{"email":"rdj1014@naver.com","certificationNumber":null}

Example response

HTTP/1.1 201 Created

2. Success : Authentication Successful
request-fields

Path Type Description

email

String

비밀번호를 찾기를 원하는 이메일

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/email-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 59
Host: localhost:8080

{"email":"rdj1014@naver.com","certificationNumber":"12345"}

Example response

HTTP/1.1 200 OK

3. Fail : Authentication failed
request-fields

Path Type Description

email

String

비밀번호를 찾기를 원하는 이메일

certificationNumber

String

사용자가 입력한 인증번호

Example request

POST /users/email-certification/confirms HTTP/1.1
Content-Type: application/json
Content-Length: 59
Host: localhost:8080

{"email":"rdj1014@naver.com","certificationNumber":"12345"}

Example response

HTTP/1.1 400 Bad Request
비밀번호 분실시 이메일 또는 휴대폰중 하나를 선택하여 인증을 진행한 후 비밀번호를 변경할 수 있습니다.
인증 번호는 10분동안 유효하며, 10분이 경과되면 자동으로 Redis 메모리에서 삭제됩니다.

인증 후 비밀번호 변경

3.인증 후 비밀번호 변경_성공
request-fields

Path Type Description

email

String

비밀번호를 변경할 회원 ID(email)

passwordAfter

String

변경할 비밀번호

passwordBefore

Null

null : 비밀번호 찾기에서는 이전 비밀번호를 알 수 없음

Example request

PATCH /users/forget/password HTTP/1.1
Content-Type: application/json
Content-Length: 78
Host: localhost:8080

{"email":"rdj1014@naver.com","passwordAfter":"test1231","passwordBefore":null}

Example response

HTTP/1.1 200 OK

비밀번호 변경

1. Success

request-fields

Path Type Description

email

String

비밀번호를 변경을 원하는 회원 ID

passwordAfter

String

변경할 비밀번호

passwordBefore

String

이전 비밀번호

Example request

PATCH /users/password HTTP/1.1
Content-Type: application/json
Content-Length: 84
Host: localhost:8080

{"email":"rdj1014@naver.com","passwordAfter":"12213132","passwordBefore":"10000000"}

Example response

HTTP/1.1 200 OK

2. Failed

request-fields

Path Type Description

email

String

비밀번호를 변경을 원하는 회원 ID

passwordAfter

String

변경할 비밀번호

passwordBefore

String

이전 비밀번호

Example request

PATCH /users/password HTTP/1.1
Content-Type: application/json
Content-Length: 87
Host: localhost:8080

{"email":"rdj1014@naver.com","passwordAfter":"12213132","passwordBefore":"newPassword"}

Example response

HTTP/1.1 401 Unauthorized
Content-Type: text/plain;charset=UTF-8
Content-Length: 68

잘못된 비밀번호입니다. 비밀번호를 확인해주세요.

환급 계좌 설정

1. get resource

Example request

GET /users/account HTTP/1.1
Content-Type: application/json
Content-Length: 68
Host: localhost:8080

{"bankName":"SC","accountNumber":"12121212","depositor":"류동재"}

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 68

{"bankName":"SC","accountNumber":"12121212","depositor":"류동재"}

response-fields

Path Type Description

bankName

String

은행명

accountNumber

String

계좌 번호

depositor

String

예금주


2. Successful : Modification

request-fields

Path Type Description

bankName

String

은행명

accountNumber

String

계좌 번호

depositor

String

예금주

Example request

PATCH /users/account HTTP/1.1
Content-Type: application/json
Content-Length: 68
Host: localhost:8080

{"bankName":"SC","accountNumber":"12121212","depositor":"류동재"}

Example response

HTTP/1.1 200 OK

주소록 설정

1. Successful : add

request-fields

Path Type Description

addressName

String

주소록 이름

roadAddress

String

도로명 주소

detailAddress

String

상세 주소

postalCode

String

우편번호

Example request

POST /users/addressBook HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: localhost:8080

{"id":1,"addressName":"새 집","roadAddress":"새집로 123","detailAddress":"789동 123호","postalCode":"23456"}

Example response

HTTP/1.1 200 OK

2. Successful : delete

request-fields

Path Type Description

id

Number

삭제할 주소의 ID[PK]

Example request

DELETE /users/addressBook HTTP/1.1
Content-Type: application/json
Content-Length: 8
Host: localhost:8080

{"id":2}

Example response

HTTP/1.1 200 OK

3. Successful : Modification
request-fields

Path Type Description

id

Number

ID

addressName

String

주소록 이름

roadAddress

String

도로명 주소

detailAddress

String

상세 주소

postalCode

String

우편번호

Example request

PATCH /users/addressBook HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: localhost:8080

{"id":1,"addressName":"새 집","roadAddress":"새집로 123","detailAddress":"789동 123호","postalCode":"23456"}

Example response

HTTP/1.1 200 OK

5. 마이페이지

1. Success : get my-infos resource

Example request

GET /users/my-infos HTTP/1.1
Content-Type: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 92

{"email":"rdj1022@naver.com","nickname":"121212","phone":"01012345678","userLevel":"UNAUTH"}

response-fields

Path Type Description

email

String

회원 이메일

nickname

String

회원 닉네임

phone

String

회원 전화번호

userLevel

String

이메일 인증 여부

현재 로그인되어있는 사용자의 my-infos 리소스를 가져옵니다.

PRODUCT API

1. 상품 관련 조회


상품 정보 조회

curl

$ curl 'http://localhost:8080/products/1' -i -X GET \
    -H 'Accept: application/json'

path-parameters

Table 7. /products/{id}
Parameter Description

id

조회할 상품의 Id

response-fields

Path Type Description

id

Number

product Id

name

String

product name

user

Object

상품 소유주

productDescription

String

productDescription

productState

String

productStatus

originImagePath

String

originImagePath

thumbnailImagePath

String

thumbnailImagePath

tradeCompleteInfos[].price

Number

tradeCompleteInfos.price

tradeCompleteInfos[].completeTime

String

tradeCompleteInfos.completeTime

Example request

GET /products/1 HTTP/1.1
Accept: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 534

{"id":1,"name":"화로","user":{"id":null,"email":"rddd@naver.com","password":null,"nickname":"ryu","phone":"01022334455","userLevel":"UNAUTH","nicknameModifiedDate":"2021-11-09T01:32:46.254423","userStatus":"NORMAL","point":null},"productDescription":"good","productState":"BEST","originImagePath":"https://cusproduct.s3.ap-northeast-2.amazonaws.com/product.png","thumbnailImagePath":"https://cusproduct.s3.ap-northeast-2.amazonaws.com/product.png","tradeCompleteInfos":[{"price":230000,"completeTime":"2021-11-09T01:32:46.256041"}]}

2. 상품 추가

curl

$ curl 'http://localhost:8080/products' -i -X POST \
    -H 'Content-Type: multipart/form-data;charset=utf-8' \
    -H 'Accept: application/json' \
    -F 'requestDto=@requestDto;type=application/json' \
    -F 'productImage=@productImage;type=image/png'

request-fields

Path Type Description

name

String

제품 이름

userInfo

Object

제품을 올린 유저

productDescription

String

제품 설명

productState

String

제품 상태

Example request

POST /products HTTP/1.1
Content-Type: multipart/form-data;charset=utf-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Accept: application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=requestDto; filename=requestDto
Content-Type: application/json

{"name":"텐트","productDescription":"good","userInfo":{"id":1,"email":"rdj10149@naver.com","password":"1221122121","nickname":"ryudd","phone":"01037734455","userLevel":"AUTH","nicknameModifiedDate":"2021-11-09T01:32:46.350747","userStatus":"NORMAL","point":1},"productState":"BEST","originImagePath":"https://cusproduct.s3.ap-northeast-2.amazonaws.com/product.png","thumbnailImagePath":null}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=productImage; filename=productImage
Content-Type: image/png

sample
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Example response

HTTP/1.1 201 Created

3. 상품 정보 수정

curl

$ curl 'http://localhost:8080/products/1' -i -X PATCH \
    -H 'Content-Type: multipart/form-data;charset=utf-8' \
    -H 'Accept: application/json' \
    -F 'requestDto=@requestDto;type=application/json' \
    -F 'productImage=@productImage;type=image/png'

request-fields

Path Type Description

name

String

제품 이름

userInfo

Object

제품을 올린 유저

productDescription

String

제품 설명

productState

String

제품 상태

Example request

PATCH /products/1 HTTP/1.1
Content-Type: multipart/form-data;charset=utf-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Accept: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK

4. 상품 삭제

curl

$ curl 'http://localhost:8080/products/1' -i -X DELETE

path-parameters

Table 8. /products/{id}
Parameter Description

id

삭제할 상품의 ID

Example request

DELETE /products/1 HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK

즉시 판매

curl

$ curl 'http://localhost:8080/trade/sell' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"tradeId":11,"addressId":3,"productId":1}'

request-fields

Path Type Description

tradeId

Number

tradeId

productId

Number

productId

addressId

Number

addressId

example request

POST /trade/sell HTTP/1.1
Content-Type: application/json
Content-Length: 42
Host: localhost:8080

{"tradeId":11,"addressId":3,"productId":1}

example response

HTTP/1.1 200 OK

즉시 구매

curl

$ curl 'http://localhost:8080/trade/buy' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"tradeId":11,"addressId":3,"productId":1}'

request-fields

Path Type Description

tradeId

Number

tradeId

addressId

Number

배송 주소

productId

Number

productId

example request

POST /trade/buy HTTP/1.1
Content-Type: application/json
Content-Length: 42
Host: localhost:8080

{"tradeId":11,"addressId":3,"productId":1}

example response

HTTP/1.1 200 OK

입고 운송장 번호 입력

curl

$ curl 'http://localhost:8080/trade/1/receiving-tracking-number' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{"trackingNumber":"12345678"}'

path-parameters

Table 9. /trade/{id}/receiving-tracking-number
Parameter Description

id

운송장을 등록할 ID

request-fields

Path Type Description

trackingNumber

String

등록할 운송장 번호

example request

PATCH /trade/1/receiving-tracking-number HTTP/1.1
Content-Type: application/json
Content-Length: 29
Host: localhost:8080

{"trackingNumber":"12345678"}

example response

HTTP/1.1 200 OK

출고 운송장 번호 입력

curl

$ curl 'http://localhost:8080/trade/1/forwarding-tracking-number' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{"trackingNumber":"12345678"}'

path-parameters

Table 10. /trade/{id}/forwarding-tracking-number
Parameter Description

id

운송장을 등록할 ID

example request

PATCH /trade/1/forwarding-tracking-number HTTP/1.1
Content-Type: application/json
Content-Length: 29
Host: localhost:8080

{"trackingNumber":"12345678"}

example response

HTTP/1.1 200 OK

거래 완료

curl

$ curl 'http://localhost:8080/trade/1/purchase-confirmation' -i -X PATCH

path-parameters

Table 11. /trade/{id}/purchase-confirmation
Parameter Description

id

거래완료 처리할 거래 ID

example request

PATCH /trade/1/purchase-confirmation HTTP/1.1
Host: localhost:8080

example response

HTTP/1.1 200 OK

회원 전체 조회

curl

$ curl 'http://localhost:8080/admin/users' -i -X GET \
    -H 'Accept: application/json'

response-fields

Path Type Description

content.[].id

Number

ID

content.[].email

String

email

content.[].userLevel

String

userLevel

example request

GET /admin/users HTTP/1.1
Accept: application/json
Host: localhost:8080

example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 429

{"content":[{"id":0,"email":"rdj1014@naver.com0","userLevel":"AUTH"},{"id":1,"email":"rdj1014@naver.com1","userLevel":"AUTH"}],"pageable":{"sort":{"sorted":false,"unsorted":true,"empty":true},"offset":0,"pageNumber":0,"pageSize":10,"paged":true,"unpaged":false},"totalElements":2,"totalPages":1,"last":true,"numberOfElements":2,"first":true,"sort":{"sorted":false,"unsorted":true,"empty":true},"size":10,"number":0,"empty":false}

회원 조회(IDX)

curl

$ curl 'http://localhost:8080/admin/users?id=1' -i -X GET \
    -H 'Accept: application/json'

request-parameters

Parameter Description

id

검색회원의 ID

response-fields

Path Type Description

content.[].id

Number

ID

content.[].email

String

email

content.[].userLevel

String

userLevel

example request

GET /admin/users?id=1 HTTP/1.1
Accept: application/json
Host: localhost:8080

example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 429

{"content":[{"id":0,"email":"rdj1014@naver.com0","userLevel":"AUTH"},{"id":1,"email":"rdj1014@naver.com1","userLevel":"AUTH"}],"pageable":{"sort":{"sorted":false,"unsorted":true,"empty":true},"offset":0,"pageNumber":0,"pageSize":10,"paged":true,"unpaged":false},"totalElements":2,"totalPages":1,"last":true,"numberOfElements":2,"first":true,"sort":{"sorted":false,"unsorted":true,"empty":true},"size":10,"number":0,"empty":false}

회원 조회(User Level)

curl

$ curl 'http://localhost:8080/admin/users?userLevel=AUTH' -i -X GET \
    -H 'Accept: application/json'

request-parameters

Parameter Description

userLevel

검색회원의 userLevel

response-fields

Path Type Description

content.[].id

Number

ID

content.[].email

String

email

content.[].userLevel

String

userLevel

example request

GET /admin/users?userLevel=AUTH HTTP/1.1
Accept: application/json
Host: localhost:8080

example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 429

{"content":[{"id":0,"email":"rdj1014@naver.com0","userLevel":"AUTH"},{"id":1,"email":"rdj1014@naver.com1","userLevel":"AUTH"}],"pageable":{"sort":{"sorted":false,"unsorted":true,"empty":true},"offset":0,"pageNumber":0,"pageSize":10,"paged":true,"unpaged":false},"totalElements":2,"totalPages":1,"last":true,"numberOfElements":2,"first":true,"sort":{"sorted":false,"unsorted":true,"empty":true},"size":10,"number":0,"empty":false}

회원 조회(Email)

curl

$ curl 'http://localhost:8080/admin/users?email=rdj1014@naver.com0' -i -X GET \
    -H 'Accept: application/json'

request-parameters

Parameter Description

email

검색회원의 email

response-fields

Path Type Description

content.[].id

Number

ID

content.[].email

String

email

content.[].userLevel

String

userLevel

example request

GET /admin/users?email=rdj1014@naver.com0 HTTP/1.1
Accept: application/json
Host: localhost:8080

example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 429

{"content":[{"id":0,"email":"rdj1014@naver.com0","userLevel":"AUTH"},{"id":1,"email":"rdj1014@naver.com1","userLevel":"AUTH"}],"pageable":{"sort":{"sorted":false,"unsorted":true,"empty":true},"offset":0,"pageNumber":0,"pageSize":10,"paged":true,"unpaged":false},"totalElements":2,"totalPages":1,"last":true,"numberOfElements":2,"first":true,"sort":{"sorted":false,"unsorted":true,"empty":true},"size":10,"number":0,"empty":false}

회원 상세 조회

curl

$ curl 'http://localhost:8080/admin/users/1' -i -X GET \
    -H 'Accept: application/json'

path-parameters

Table 12. /admin/users/{id}
Parameter Description

id

상세 정보를 조회할 회원의 ID[PK]

response-fields

Path Type Description

id

Number

회원 ID[PK]

email

String

회원 이메일

nickname

String

회원 닉네임

phoneNumber

String

회원 휴대폰번호

account

Object

회원의 계좌정보

createDate

Varies

회원 가입 일시

modifiedDate

Varies

회원 정보 수정 일시

userLevel

String

회원 권한[UNAUTH/AUTH/ADMIN

userStatus

String

회원 상태[BAN/NORMAL]

Example request

GET /admin/users/1 HTTP/1.1
Accept: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 291

{"id":1,"email":"rdj1014@naver.com","nickname":"ryudjdasd","phoneNumber":"01012345678","account":{"bankName":"Sc","accountNumber":"7999999999","depositor":"ryu"},"modifiedDate":"2021-11-09T01:32:41.832588","createDate":"2021-11-09T01:32:41.832618","userLevel":"UNAUTH","userStatus":"NORMAL"}

회원 정지

curl

$ curl 'http://localhost:8080/admin/users/ban' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"id":1,"userStatus":"BAN"}'

example request

POST /admin/users/ban HTTP/1.1
Content-Type: application/json
Content-Length: 27
Host: localhost:8080

{"id":1,"userStatus":"BAN"}

example response

HTTP/1.1 200 OK

CART API

장바구니 조회

curl

$ curl 'http://localhost:8080/wishlists' -i -X GET

response-fields

Path Type Description

[].id

Number

위시리스트 ID

[].productId

Number

Product ID

[].name

String

제품 이름

[].userInfoDto.email

String

회원 이메일

[].userInfoDto.phone

String

회원 전화번호

[].userInfoDto.nickname

String

회원 닉네임

[].userInfoDto.userLevel

String

회원 권한

Example request

GET /wishlists HTTP/1.1
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 142

[{"id":1,"productId":2,"name":"텐트","userInfoDto":{"email":"rdj1014@naver.com","nickname":"ryu","phone":"01011121233","userLevel":"AUTH"}}]

장바구니 추가

curl

$ curl 'http://localhost:8080/wishlists' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"id":1}'

request-fields

Path Type Description

id

Number

상품 ID

Example request

POST /wishlists HTTP/1.1
Content-Type: application/json
Content-Length: 8
Host: localhost:8080

{"id":1}

Example response

HTTP/1.1 200 OK

장바구니 삭제

curl

$ curl 'http://localhost:8080/wishlists' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -d '{"id":1}'

request-fields

Path Type Description

id

Number

상품 ID

Example request

DELETE /wishlists HTTP/1.1
Content-Type: application/json
Content-Length: 8
Host: localhost:8080

{"id":1}

Example response

HTTP/1.1 200 OK

POINT API

포인트 충전(AJAX)

curl

$ curl 'http://localhost:8080/points/charging' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"chargeAmount":100000}'

request-fields

Path Type Description

chargeAmount

Number

충전할 포인트

Example request

POST /points/charging HTTP/1.1
Content-Type: application/json
Content-Length: 23
Host: localhost:8080

{"chargeAmount":100000}

Example response

HTTP/1.1 200 OK

포인트 출금

curl

$ curl 'http://localhost:8080/points/withdrawal' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"withdrawalAmount":4000,"password":"0070"}'

request-fields

Path Type Description

withdrawalAmount

Number

출금할 포인트

password

String

비밀번호

Example request

POST /points/withdrawal HTTP/1.1
Content-Type: application/json
Content-Length: 43
Host: localhost:8080

{"withdrawalAmount":4000,"password":"0070"}

Example response

HTTP/1.1 200 OK

포인트 차감 내역 조회

curl

$ curl 'http://localhost:8080/points/deduction-details' -i -X GET \
    -H 'Accept: application/json'

response-fields

Path Type Description

[].time

String

생성 날짜

[].amount

Number

충전 금액

[].division

String

종류

Example request

GET /points/deduction-details HTTP/1.1
Accept: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 154

[{"time":"2021-11-09T01:32:43.488619","amount":30000,"division":"CHARGE"},{"time":"2021-11-09T01:32:43.488636","amount":40000,"division":"SALES_REVENUE"}]

포인트 충전(대금 수령) 내역 조회

curl

$ curl 'http://localhost:8080/points/charging-details' -i -X GET \
    -H 'Accept: application/json'

response-fields

Path Type Description

[].time

String

생성 날짜

[].amount

Number

충전 금액

[].division

String

종류

Example request

GET /points/charging-details HTTP/1.1
Accept: application/json
Host: localhost:8080

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 154

[{"time":"2021-11-09T01:32:43.441743","amount":30000,"division":"CHARGE"},{"time":"2021-11-09T01:32:43.442021","amount":40000,"division":"SALES_REVENUE"}]