User

사용자 등록

Request

POST /api/users HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Accept: application/json
Content-Length: 249
Host: localhost:8080

{
  "firstname" : "testFirstName",
  "lastname" : "TestLastName",
  "email" : "test@example.com",
  "password" : "12345678",
  "imageUrl" : "test/image.png",
  "phoneNumber" : "01000000000",
  "description" : "This is testUser",
  "seller" : false
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 334

{
  "user" : {
    "id" : 1,
    "firstname" : "testFirstName",
    "lastname" : "TestLastName",
    "email" : "test@example.com",
    "role" : "USER",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser",
    "seller" : false
  },
  "token" : "token"
}

Response Field Description

Path Type Description

user

Object

created user’s information

user.id

Number

user id

user.firstname

String

user firstname

user.lastname

String

user lastname

user.email

String

user email

user.role

String

user role

user.imageUrl

String

user image url

user.phoneNumber

String

user phoneNumber

user.level

String

user activity level

user.description

String

user description

user.seller

Boolean

whether user is seller or not

token

String

user token

사용자 이미지 등록

Request

POST /api/users/images HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Accept: multipart/form-data
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: multipart/form-data;charset=UTF-8
Content-Length: 14

test/image.png

사용자 로그인 with 이메일, 패스워드

Request

POST /api/sign-in HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Accept: application/json
Content-Length: 64
Host: localhost:8080

{
  "username" : "test@example.com",
  "password" : "12345678"
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 334

{
  "user" : {
    "id" : 1,
    "firstname" : "testFirstName",
    "lastname" : "TestLastName",
    "email" : "test@example.com",
    "role" : "USER",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser",
    "seller" : false
  },
  "token" : "token"
}

Response Field Description

Path Type Description

user

Object

created user’s information

user.id

Number

user id

user.firstname

String

user firstname

user.lastname

String

user lastname

user.email

String

user email

user.role

String

user role

user.imageUrl

String

user image url

user.phoneNumber

String

user phoneNumber

user.level

String

user activity level

user.description

String

user description

user.seller

Boolean

whether user is seller or not

token

String

user token

사용자 로그인 with 토큰

Request

POST /api/sign-in HTTP/1.1
Accept: application/json
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

token=token

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 334

{
  "user" : {
    "id" : 1,
    "firstname" : "testFirstName",
    "lastname" : "TestLastName",
    "email" : "test@example.com",
    "role" : "USER",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser",
    "seller" : false
  },
  "token" : "token"
}

Response Field Description

Path Type Description

user

Object

created user’s information

user.id

Number

user id

user.firstname

String

user firstname

user.lastname

String

user lastname

user.email

String

user email

user.role

String

user role

user.imageUrl

String

user image url

user.phoneNumber

String

user phoneNumber

user.level

String

user activity level

user.description

String

user description

user.seller

Boolean

whether user is seller or not

token

String

user token

단일 사용자 조회

Request

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

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 276

{
  "id" : 1,
  "firstname" : "testFirstName",
  "lastname" : "TestLastName",
  "email" : "test@example.com",
  "role" : "USER",
  "imageUrl" : "test/image.png",
  "phoneNumber" : "01000000000",
  "level" : "Starter",
  "description" : "This is testUser",
  "seller" : false
}

Response Field Description

Path Type Description

id

Number

user id

firstname

String

user firstname

lastname

String

user lastname

email

String

user email

role

String

user role

imageUrl

String

user image url

phoneNumber

String

user phoneNumber

level

String

user activity level

description

String

user description

seller

Boolean

whether user is seller or not

모든 사용자 조회 by 페이지, 분류

Request

GET /api/users?page=1&sort=id HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 665

{
  "users" : [ {
    "id" : 1,
    "firstname" : "testFirstName",
    "lastname" : "TestLastName",
    "email" : "test@example.com",
    "role" : "USER",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser",
    "seller" : false
  }, {
    "id" : 1,
    "firstname" : "test2FirstName",
    "lastname" : "Test2LastName",
    "email" : "test2@example.com",
    "role" : "SELLER",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testSeller",
    "seller" : true
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

users

Array

found user’s information

users.[].id

Number

user id

users.[].firstname

String

user firstname

users.[].lastname

String

user lastname

users.[].email

String

user email

users.[].role

String

user role

users.[].imageUrl

String

user image url

users.[].phoneNumber

String

user phoneNumber

users.[].level

String

user activity level

users.[].description

String

user description

users.[].seller

Boolean

whether user is seller or not

totalElement

Number

the number of total element

totalPage

Number

the number of total page

사용자 검색

Request

GET /api/users?keyword=test HTTP/1.1
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 335

{
  "users" : [ {
    "id" : 1,
    "firstname" : "testFirstName",
    "lastname" : "TestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png"
  }, {
    "id" : 1,
    "firstname" : "test2FirstName",
    "lastname" : "Test2LastName",
    "email" : "test2@example.com",
    "imageUrl" : "test/image.png"
  } ]
}

Response Field Description

Path Type Description

users

Array

found user’s information

users.[].id

Number

user id

users.[].firstname

String

user firstname

users.[].lastname

String

user lastname

users.[].email

String

user email

users.[].imageUrl

String

user image url

사용자 정보 수정

Request

PUT /api/users/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 249
Host: localhost:8080

{
  "firstname" : "testFirstName",
  "lastname" : "TestLastName",
  "email" : "test@example.com",
  "password" : "12345678",
  "imageUrl" : "test/image.png",
  "phoneNumber" : "01000000000",
  "description" : "This is testUser",
  "seller" : false
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 276

{
  "id" : 1,
  "firstname" : "testFirstName",
  "lastname" : "TestLastName",
  "email" : "test@example.com",
  "role" : "USER",
  "imageUrl" : "test/image.png",
  "phoneNumber" : "01000000000",
  "level" : "Starter",
  "description" : "This is testUser",
  "seller" : false
}

Response Field Description

Path Type Description

id

Number

user id

firstname

String

user firstname

lastname

String

user lastname

email

String

user email

role

String

user role

imageUrl

String

user image url

phoneNumber

String

user phoneNumber

level

String

user activity level

description

String

user description

seller

Boolean

whether user is seller or not

사용자 삭제

Request

DELETE /api/users/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

사용자 임시 비밀번호 전송

Request

POST /api/users HTTP/1.1
Accept: application/json
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

email=test%40example.com

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Activity

액티비티 등록

Request

POST /api/activities HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 133
Host: localhost:8080

{
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png"
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 145

{
  "id" : 1,
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png"
}

Response Field Description

Path Type Description

id

Number

activity id

name

String

activity name

score

Number

activity score

description

String

activity description

imageUrl

String

activity image url

액티비티 이미지 등록

Request

POST /api/activities/images HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer token
Accept: multipart/form-data
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: multipart/form-data;charset=UTF-8
Content-Length: 23

firstActivity/image.png

단일 액티비티 조회

Request

GET /api/activities/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 530

{
  "id" : 1,
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png",
  "activityUsers" : [ {
    "id" : null,
    "status" : "ONGOING",
    "userId" : 1,
    "userImageUrl" : "test/image.png",
    "userFullname" : "testFirstNameTestLastName",
    "updatedAt" : null
  }, {
    "id" : null,
    "status" : "FINISHED",
    "userId" : 1,
    "userImageUrl" : "test/image.png",
    "userFullname" : "testFirstNameTestLastName",
    "updatedAt" : null
  } ]
}

Response Field Description

Path Type Description

id

Number

activity id

name

String

activity name

score

Number

activity score

description

String

activity description

imageUrl

String

activity image url

activityUsers

Array

userActivity of someone who is doing or has finished this activity

activityUsers.[].id

Null

userActivity id

activityUsers.[].status

String

userActivity’s status

activityUsers.[].userId

Number

user’s id

activityUsers.[].userImageUrl

String

user’s imageUrl

activityUsers.[].userFullname

String

user’s fullName

activityUsers.[].updatedAt

Null

last time when user did this activity

모든 액티비티 조회

Request

GET /api/activities HTTP/1.1
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 298

[ {
  "id" : 1,
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png"
}, {
  "id" : 2,
  "name" : "secondActivity",
  "score" : 50,
  "description" : "This is second activity.",
  "imageUrl" : "firstActivity/image.png"
} ]

Response Field Description

Path Type Description

[].id

Number

activity id

[].name

String

activity name

[].score

Number

activity score

[].description

String

activity description

[].imageUrl

String

activity image url

액티비티 정보 수정

Request

PUT /api/activities/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 133
Host: localhost:8080

{
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png"
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 145

{
  "id" : 1,
  "name" : "firstActivity",
  "score" : 20,
  "description" : "This is first activity.",
  "imageUrl" : "firstActivity/image.png"
}

Response Field Description

Path Type Description

id

Number

activity id

name

String

activity name

score

Number

activity score

description

String

activity description

imageUrl

String

activity image url

액티비티 삭제

Request

DELETE /api/activities/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

UserActivity

사용자 액티비티 등록

Request

POST /api/user-activities HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 78
Host: localhost:8080

{
  "userId" : 1,
  "activityId" : 1,
  "distance" : 10,
  "finished" : true
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 223

{
  "id" : null,
  "activityId" : 1,
  "activityImageUrl" : "firstActivity/image.png",
  "activityName" : "firstActivity",
  "score" : 20,
  "finished" : false,
  "createdAt" : null,
  "updatedAt" : null,
  "level" : null
}

Response Field Description

Path Type Description

id

Null

user’s activity id

activityId

Number

activity id

activityImageUrl

String

activity imageUrl

activityName

String

activity name

score

Number

activity score

finished

Boolean

whether user’s activity is finished or not

createdAt

Null

the time when user’s activity has started

updatedAt

Null

the time when user’s activity has recently updated

level

Null

user’s current level

사용자의 모든 액티비티 조회

Request

GET /api/users/1/user-activities?page=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 579

{
  "activities" : [ {
    "id" : null,
    "activityId" : 1,
    "activityImageUrl" : "firstActivity/image.png",
    "activityName" : "firstActivity",
    "score" : 20,
    "finished" : false,
    "createdAt" : null,
    "updatedAt" : null,
    "level" : "Starter"
  }, {
    "id" : null,
    "activityId" : 1,
    "activityImageUrl" : "firstActivity/image.png",
    "activityName" : "firstActivity",
    "score" : 20,
    "finished" : true,
    "createdAt" : null,
    "updatedAt" : null,
    "level" : "Starter"
  } ],
  "totalPage" : 1,
  "totalElement" : 2,
  "score" : 20
}

Response Field Description

Path Type Description

activities

Array

user’s activities

activities.[].id

Null

user’s activity id

activities.[].activityId

Number

activity id

activities.[].activityImageUrl

String

activity imageUrl

activities.[].activityName

String

activity name

activities.[].score

Number

activity score

activities.[].finished

Boolean

whether user’s activity is finished or not

activities.[].createdAt

Null

the time when user’s activity has started

activities.[].updatedAt

Null

the time when user’s activity has recently updated

activities.[].level

String

user’s current level

totalPage

Number

the number of total pages

totalElement

Number

the number of total userActivities

score

Number

user’s current score

사용자 액티비티 상태 정보 수정

Request

PUT /api/user-activities/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 78
Host: localhost:8080

{
  "userId" : 1,
  "activityId" : 1,
  "distance" : 10,
  "finished" : true
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 223

{
  "id" : null,
  "activityId" : 1,
  "activityImageUrl" : "firstActivity/image.png",
  "activityName" : "firstActivity",
  "score" : 20,
  "finished" : false,
  "createdAt" : null,
  "updatedAt" : null,
  "level" : null
}

Response Field Description

Path Type Description

id

Null

user’s activity id

activityId

Number

activity id

activityImageUrl

String

activity imageUrl

activityName

String

activity name

score

Number

activity score

finished

Boolean

whether user’s activity is finished or not

createdAt

Null

the time when user’s activity has started

updatedAt

Null

the time when user’s activity has recently updated

level

Null

user’s current level

사용자 액티비티 삭제

Request

DELETE /api/users/1/user-activities/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Follow

팔로우

Request

POST /api/follows?fromId=1&toId=2 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

fromId=1&toId=2

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 128

{
  "id" : 2,
  "user" : {
    "id" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }
}

Response Field Description

Path Type Description

id

Number

follow id

user

Object

following user(toId user)'s information

user.id

Number

following’s id

user.fullname

String

following’s fullName

user.imageUrl

String

following’s imageUrl

모든 팔로우 조회

Request

GET /api/users/1/follows HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 619

{
  "followers" : [ {
    "id" : 3,
    "user" : {
      "id" : 3,
      "fullname" : "test3FirstNameTest3LastName",
      "imageUrl" : "test/image.png"
    }
  }, {
    "id" : 2,
    "user" : {
      "id" : 2,
      "fullname" : "test2FirstNameTest2LastName",
      "imageUrl" : "test/image.png"
    }
  } ],
  "followings" : [ {
    "id" : 2,
    "user" : {
      "id" : 2,
      "fullname" : "test2FirstNameTest2LastName",
      "imageUrl" : "test/image.png"
    }
  }, {
    "id" : 3,
    "user" : {
      "id" : 3,
      "fullname" : "test3FirstNameTest3LastName",
      "imageUrl" : "test/image.png"
    }
  } ]
}

Response Field Description

Path Type Description

followers

Array

the information of followers

followers.[].id

Number

follow id

followers.[].user

Object

follower user’s information

followers.[].user.id

Number

follower’s id

followers.[].user.fullname

String

follower’s fullName

followers.[].user.imageUrl

String

follower’s imageUrl

followings

Array

the information of followings

followings.[].id

Number

follow id

followings.[].user

Object

following user’s information

followings.[].user.id

Number

following’s id

followings.[].user.fullname

String

following’s fullName

followings.[].user.imageUrl

String

following’s imageUrl

모든 팔로워 조회

Request

GET /api/users/1/followers HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 262

[ {
  "id" : 3,
  "user" : {
    "id" : 3,
    "fullname" : "test3FirstNameTest3LastName",
    "imageUrl" : "test/image.png"
  }
}, {
  "id" : 2,
  "user" : {
    "id" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }
} ]

Response Field Description

Path Type Description

[].id

Number

follow id

[].user

Object

follower user’s information

[].user.id

Number

follower’s id

[].user.fullname

String

follower’s fullName

[].user.imageUrl

String

follower’s imageUrl

모든 팔로잉 조회

Request

GET /api/users/1/followings HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 262

[ {
  "id" : 2,
  "user" : {
    "id" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }
}, {
  "id" : 3,
  "user" : {
    "id" : 3,
    "fullname" : "test3FirstNameTest3LastName",
    "imageUrl" : "test/image.png"
  }
} ]

Response Field Description

Path Type Description

[].id

Number

follow id

[].user

Object

follower user’s information

[].user.id

Number

follower’s id

[].user.fullname

String

follower’s fullName

[].user.imageUrl

String

follower’s imageUrl

언팔로우

Request

DELETE /api/follows/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Post

게시물 생성

Request

POST /api/posts HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer token
Accept: multipart/form-data, application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=postRequest
Content-Type: application/json

{"title":"firstPost","content":"This is first post.","userId":1}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 695

{
  "id" : 1,
  "title" : "firstPost",
  "content" : "This is first post.",
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "description" : "This is testUser"
  },
  "postLikes" : [ {
    "id" : 1,
    "userId" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }, {
    "id" : 2,
    "userId" : 3,
    "fullname" : "test3FirstNameTest3LastName",
    "imageUrl" : "test/image.png"
  } ],
  "postImages" : [ {
    "id" : 1,
    "imageUrl" : "testPostImage/image.png"
  }, {
    "id" : 2,
    "imageUrl" : "testPostImage/image.png"
  } ],
  "createdAt" : null
}

Response Field Description

Path Type Description

id

Number

post id

title

String

post title

content

String

post content

user

Object

post writer’s information

user.id

Number

writer id

user.fullname

String

writer fullname

user.email

String

writer email

user.imageUrl

String

writer imageUrl

user.description

String

writer description

postLikes

Array

users who like this post

postLikes.[].id

Number

likePost id

postLikes.[].userId

Number

user id

postLikes.[].fullname

String

user fullName

postLikes.[].imageUrl

String

user imageUrl

postImages

Array

post’s images

postImages.[].id

Number

postImage id

postImages.[].imageUrl

String

post imageUrl

createdAt

Null

the time when post created

단일 게시물 조회

Request

GET /api/posts/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 695

{
  "id" : 1,
  "title" : "firstPost",
  "content" : "This is first post.",
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "description" : "This is testUser"
  },
  "postLikes" : [ {
    "id" : 1,
    "userId" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }, {
    "id" : 2,
    "userId" : 3,
    "fullname" : "test3FirstNameTest3LastName",
    "imageUrl" : "test/image.png"
  } ],
  "postImages" : [ {
    "id" : 1,
    "imageUrl" : "testPostImage/image.png"
  }, {
    "id" : 2,
    "imageUrl" : "testPostImage/image.png"
  } ],
  "createdAt" : null
}

Response Field Description

Path Type Description

id

Number

post id

title

String

post title

content

String

post content

user

Object

post writer’s information

user.id

Number

writer id

user.fullname

String

writer fullname

user.email

String

writer email

user.imageUrl

String

writer imageUrl

user.description

String

writer description

postLikes

Array

users who like this post

postLikes.[].id

Number

likePost id

postLikes.[].userId

Number

user id

postLikes.[].fullname

String

user fullName

postLikes.[].imageUrl

String

user imageUrl

postImages

Array

post’s images

postImages.[].id

Number

postImage id

postImages.[].imageUrl

String

post imageUrl

createdAt

Null

the time when post created

사용자의 모든 게시물 조회

Request

GET /api/users/1/posts HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 820

{
  "posts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "testFirstNameTestLastName",
    "userId" : 1
  }, {
    "id" : 2,
    "title" : "secondPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "test2FirstNameTest2LastName",
    "userId" : 2
  } ],
  "likePosts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "testFirstNameTestLastName",
    "userId" : 1
  }, {
    "id" : 2,
    "title" : "secondPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "test2FirstNameTest2LastName",
    "userId" : 2
  } ]
}

Response Field Description

Path Type Description

posts

Array

the information of user’s posts

posts.[].id

Number

post id

posts.[].title

String

post title

posts.[].imageUrl

String

post first image url

posts.[].userImageUrl

String

user imageUrl

posts.[].userName

String

user fullName

posts.[].userId

Number

user id

likePosts

Array

the information of the posts which user likes

likePosts.[].id

Number

like post id

likePosts.[].title

String

like post title

likePosts.[].imageUrl

String

like post first image url

likePosts.[].userImageUrl

String

writer imageUrl

likePosts.[].userName

String

writer fullName

likePosts.[].userId

Number

writer id

추천 게시물 조회

Request

GET /api/users/1/posts/discover?page=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 450

{
  "posts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "testFirstNameTestLastName",
    "userId" : 1
  }, {
    "id" : 2,
    "title" : "secondPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "test2FirstNameTest2LastName",
    "userId" : 2
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

posts

Array

the information of user’s posts

posts.[].id

Number

post id

posts.[].title

String

post title

posts.[].imageUrl

String

post first image url

posts.[].userImageUrl

String

user imageUrl

posts.[].userName

String

user fullName

posts.[].userId

Number

user id

totalElement

Number

the number of total posts

totalPage

Number

the number of total page

팔로우하는 사람의 게시물 조회

Request

GET /api/users/1/posts/follow?page=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1573

{
  "posts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "content" : "This is first post.",
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "email" : "test@example.com",
      "imageUrl" : "test/image.png",
      "description" : "This is testUser"
    },
    "postLikes" : [ {
      "id" : 1,
      "userId" : 2,
      "fullname" : "test2FirstNameTest2LastName",
      "imageUrl" : "test/image.png"
    }, {
      "id" : 2,
      "userId" : 3,
      "fullname" : "test3FirstNameTest3LastName",
      "imageUrl" : "test/image.png"
    } ],
    "postImages" : [ {
      "id" : 1,
      "imageUrl" : "testPostImage/image.png"
    }, {
      "id" : 2,
      "imageUrl" : "testPostImage/image.png"
    } ],
    "createdAt" : null
  }, {
    "id" : 1,
    "title" : "firstPost",
    "content" : "This is first post.",
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "email" : "test@example.com",
      "imageUrl" : "test/image.png",
      "description" : "This is testUser"
    },
    "postLikes" : [ {
      "id" : 1,
      "userId" : 2,
      "fullname" : "test2FirstNameTest2LastName",
      "imageUrl" : "test/image.png"
    }, {
      "id" : 2,
      "userId" : 3,
      "fullname" : "test3FirstNameTest3LastName",
      "imageUrl" : "test/image.png"
    } ],
    "postImages" : [ {
      "id" : 1,
      "imageUrl" : "testPostImage/image.png"
    }, {
      "id" : 2,
      "imageUrl" : "testPostImage/image.png"
    } ],
    "createdAt" : null
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

posts

Array

the posts of following’s and mine

posts.[].id

Number

post id

posts.[].title

String

post title

posts.[].content

String

post content

posts.[].user

Object

post writer’s information

posts.[].user.id

Number

writer id

posts.[].user.fullname

String

writer fullname

posts.[].user.email

String

writer email

posts.[].user.imageUrl

String

writer imageUrl

posts.[].user.description

String

writer description

posts.[].postLikes

Array

users who like this post

posts.[].postLikes.[].id

Number

likePost id

posts.[].postLikes.[].userId

Number

user id

posts.[].postLikes.[].fullname

String

user fullName

posts.[].postLikes.[].imageUrl

String

user imageUrl

posts.[].postImages

Array

post’s images

posts.[].postImages.[].id

Number

postImage id

posts.[].postImages.[].imageUrl

String

post imageUrl

posts.[].createdAt

Null

the time when post created

totalElement

Number

the number of total posts

totalPage

Number

the number of total page

메인 페이지의 게시물 조회

Request

GET /api/posts?page=1&sort=id HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 450

{
  "posts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "testFirstNameTestLastName",
    "userId" : 1
  }, {
    "id" : 2,
    "title" : "secondPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "test2FirstNameTest2LastName",
    "userId" : 2
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

posts

Array

the information of user’s posts

posts.[].id

Number

post id

posts.[].title

String

post title

posts.[].imageUrl

String

post first image url

posts.[].userImageUrl

String

user imageUrl

posts.[].userName

String

user fullName

posts.[].userId

Number

user id

totalElement

Number

the number of total posts

totalPage

Number

the number of total page

게시물 키워드 검색 조회

Request

GET /api/posts?page=1&sort=id&keyword=post HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 450

{
  "posts" : [ {
    "id" : 1,
    "title" : "firstPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "testFirstNameTestLastName",
    "userId" : 1
  }, {
    "id" : 2,
    "title" : "secondPost",
    "imageUrl" : "testPostImage/image.png",
    "userImageUrl" : "test/image.png",
    "userName" : "test2FirstNameTest2LastName",
    "userId" : 2
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

posts

Array

the information of user’s posts

posts.[].id

Number

post id

posts.[].title

String

post title

posts.[].imageUrl

String

post first image url

posts.[].userImageUrl

String

user imageUrl

posts.[].userName

String

user fullName

posts.[].userId

Number

user id

totalElement

Number

the number of total posts

totalPage

Number

the number of total page

게시물 수정

Request

PUT /api/posts/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 80
Host: localhost:8080

{
  "title" : "firstPost",
  "content" : "This is first post.",
  "userId" : 1
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 695

{
  "id" : 1,
  "title" : "firstPost",
  "content" : "This is first post.",
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "description" : "This is testUser"
  },
  "postLikes" : [ {
    "id" : 1,
    "userId" : 2,
    "fullname" : "test2FirstNameTest2LastName",
    "imageUrl" : "test/image.png"
  }, {
    "id" : 2,
    "userId" : 3,
    "fullname" : "test3FirstNameTest3LastName",
    "imageUrl" : "test/image.png"
  } ],
  "postImages" : [ {
    "id" : 1,
    "imageUrl" : "testPostImage/image.png"
  }, {
    "id" : 2,
    "imageUrl" : "testPostImage/image.png"
  } ],
  "createdAt" : null
}

Response Field Description

Path Type Description

id

Number

post id

title

String

post title

content

String

post content

user

Object

post writer’s information

user.id

Number

writer id

user.fullname

String

writer fullname

user.email

String

writer email

user.imageUrl

String

writer imageUrl

user.description

String

writer description

postLikes

Array

users who like this post

postLikes.[].id

Number

likePost id

postLikes.[].userId

Number

user id

postLikes.[].fullname

String

user fullName

postLikes.[].imageUrl

String

user imageUrl

postImages

Array

post’s images

postImages.[].id

Number

postImage id

postImages.[].imageUrl

String

post imageUrl

createdAt

Null

the time when post created

게시물 삭제

Request

DELETE /api/posts/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

PostImage

게시물 이미지 등록

Request

POST /api/posts/1/post-images HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer token
Accept: multipart/form-data, application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 151

{
  "postImages" : [ {
    "id" : 1,
    "imageUrl" : "testPostImage/image.png"
  }, {
    "id" : 2,
    "imageUrl" : "testPostImage/image.png"
  } ]
}

Response Field Description

Path Type Description

postImages

Array

post’s images

postImages.[].id

Number

postImage id

postImages.[].imageUrl

String

post imageUrl

게시물 이미지 삭제

Request

DELETE /api/posts/1/post-images?deletedImages=testPostImage%2Fimage.png&deletedImages=testPostImage%2Fimage.png HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

LikePost

게시물 좋아요 표시 등록

Request

POST /api/like-posts HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 30
Host: localhost:8080

{
  "post" : 1,
  "user" : 2
}

Response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 109

{
  "id" : 1,
  "userId" : 2,
  "fullname" : "test2FirstNameTest2LastName",
  "imageUrl" : "test/image.png"
}

Response Field Description

Path Type Description

id

Number

likePost id

userId

Number

the id of user who liked post

fullname

String

the fullName of user who liked post

imageUrl

String

the imageUrl of user who liked post

게시물 좋아요 표시 삭제

Request

DELETE /api/like-posts/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Product

상품 생성

Request

POST /api/products HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer token
Accept: multipart/form-data, application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=productRequest
Content-Type: application/json

{"name":"firstProduct","description":"This is first product.","brand":"testBrand","category":"TUMBLER","stock":100,"price":15.0,"userId":1}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1029

{
  "id" : 1,
  "name" : "firstProduct",
  "brand" : "testBrand",
  "category" : "TUMBLER",
  "stock" : 100,
  "price" : 15.0,
  "average" : 3.5,
  "imagesUrl" : [ "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png" ],
  "description" : "This is first product."
}

Response Field Description

Path Type Description

id

Number

product id

name

String

product name

brand

String

product brand

category

String

product category

stock

Number

product stock

price

Number

product price

average

Number

product rating average

imagesUrl

Array

product’s images

imagesUrl.[]

Array

product imageUrl

description

String

product description

단일 상품 조회

Request

GET /api/products/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1106

{
  "id" : 1,
  "name" : "firstProduct",
  "description" : "This is first product.",
  "brand" : "testBrand",
  "category" : "TUMBLER",
  "stock" : 100,
  "price" : 15.0,
  "average" : 3.5,
  "productImages" : [ {
    "name" : "firstProductImage",
    "imageUrl" : "firstProductImage/image.png"
  }, {
    "name" : "secondProductImage",
    "imageUrl" : "secondProductImage/image.png"
  } ],
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "description" : "This is testUser"
  },
  "productReviews" : [ {
    "id" : 1,
    "rating" : 4,
    "comment" : "firstTestReview",
    "userId" : 2,
    "userFullname" : "test2FirstNameTest2LastName",
    "userImageUrl" : "test/image.png",
    "productId" : 1,
    "createdAt" : null,
    "updatedAt" : null
  }, {
    "id" : 2,
    "rating" : 3,
    "comment" : "secondTestReview",
    "userId" : 3,
    "userFullname" : "test3FirstNameTest3LastName",
    "userImageUrl" : "test/image.png",
    "productId" : 1,
    "createdAt" : null,
    "updatedAt" : null
  } ]
}

Response Field Description

Path Type Description

id

Number

product id

name

String

product name

brand

String

product brand

category

String

product category

stock

Number

product stock

price

Number

product price

average

Number

product rating average

description

String

product description

productImages

Array

product’s images

productImages.[].name

String

product image name

productImages.[].imageUrl

String

product imageUrl

user

Object

product seller

user.id

Number

seller id

user.fullname

String

seller fullName

user.email

String

seller email

user.imageUrl

String

seller imageUrl

user.description

String

seller description

productReviews

Array

product’s reviews

productReviews.[].id

Number

review id

productReviews.[].rating

Number

review rating

productReviews.[].comment

String

review comment

productReviews.[].userId

Number

review writer id

productReviews.[].userFullname

String

review writer name

productReviews.[].userImageUrl

String

review writer imageUrl

productReviews.[].productId

Number

product id

productReviews.[].createdAt

Null

the time when review has created

productReviews.[].updatedAt

Null

the time when review has recently updated

조건별 모든 상품 조회

Request

GET /api/products?page=1&sort=id&category=tumbler&keyword=test HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 2372

{
  "products" : [ {
    "id" : 1,
    "name" : "firstProduct",
    "brand" : "testBrand",
    "category" : "TUMBLER",
    "stock" : 100,
    "price" : 15.0,
    "average" : 3.5,
    "imagesUrl" : [ "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png" ],
    "description" : "This is first product."
  }, {
    "id" : 1,
    "name" : "secondProduct",
    "brand" : "testBrand",
    "category" : "TUMBLER",
    "stock" : 100,
    "price" : 15.0,
    "average" : 0,
    "imagesUrl" : [ "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png" ],
    "description" : "This is second product."
  } ],
  "seller" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser"
  },
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

products

Array

found products

products.[].id

Number

product id

products.[].name

String

product name

products.[].brand

String

product brand

products.[].category

String

product category

products.[].stock

Number

product stock

products.[].price

Number

product price

products.[].average

Number

product rating average

products.[].imagesUrl

Array

product’s images

products.[].imagesUrl.[]

Array

product imageUrl

products.[].description

String

product description

seller

Object

product seller

seller.id

Number

seller id

seller.fullname

String

seller fullname

seller.email

String

seller email

seller.imageUrl

String

seller imageUrl

seller.phoneNumber

String

seller phoneNumber

seller.level

String

seller activity level

seller.description

String

seller description

totalElement

Number

the number of products

totalPage

Number

the number of totalPage

판매자의 조건별 모든 상품 조회

Request

GET /api/users/1/products?page=1&sort=id&category=tumbler&keyword=test HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 2184

{
  "products" : [ {
    "id" : 1,
    "name" : "firstProduct",
    "brand" : "testBrand",
    "category" : "TUMBLER",
    "stock" : 100,
    "price" : 15.0,
    "average" : 3.5,
    "imagesUrl" : [ "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png" ],
    "description" : "This is first product."
  }, {
    "id" : 1,
    "name" : "secondProduct",
    "brand" : "testBrand",
    "category" : "TUMBLER",
    "stock" : 100,
    "price" : 15.0,
    "average" : 0,
    "imagesUrl" : [ "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png", "thirdProductImage/image.png" ],
    "description" : "This is second product."
  } ],
  "seller" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "email" : "test@example.com",
    "imageUrl" : "test/image.png",
    "phoneNumber" : "01000000000",
    "level" : "Starter",
    "description" : "This is testUser"
  },
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

products

Array

found products

products.[].id

Number

product id

products.[].name

String

product name

products.[].brand

String

product brand

products.[].category

String

product category

products.[].stock

Number

product stock

products.[].price

Number

product price

products.[].average

Number

product rating average

products.[].imagesUrl

Array

product’s images

products.[].imagesUrl.[]

Array

product imageUrl

products.[].description

String

product description

seller

Object

product seller

seller.id

Number

seller id

seller.fullname

String

seller fullname

seller.email

String

seller email

seller.imageUrl

String

seller imageUrl

seller.phoneNumber

String

seller phoneNumber

seller.level

String

seller activity level

seller.description

String

seller description

totalElement

Number

the number of products

totalPage

Number

the number of totalPage

상품 정보 수정

Request

PUT /api/products/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 175
Host: localhost:8080

{
  "name" : "firstProduct",
  "description" : "This is first product.",
  "brand" : "testBrand",
  "category" : "TUMBLER",
  "stock" : 100,
  "price" : 15.0,
  "userId" : 1
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 966

{
  "id" : 1,
  "name" : "firstProduct",
  "brand" : "testBrand",
  "category" : "TUMBLER",
  "stock" : 100,
  "price" : 15.0,
  "average" : 3.5,
  "imagesUrl" : [ "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png", "firstProductImage/image.png", "secondProductImage/image.png" ],
  "description" : "This is first product."
}

Response Field Description

Path Type Description

id

Number

product id

name

String

product name

brand

String

product brand

category

String

product category

stock

Number

product stock

price

Number

product price

average

Number

product rating average

imagesUrl

Array

product’s images

imagesUrl.[]

Array

product imageUrl

description

String

product description

상품 삭제

Request

DELETE /api/products/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Product

상품 이미지 등록

Request

POST /api/products/1/product-images HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer token
Accept: multipart/form-data, application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=multipartFile; filename=image.png
Content-Type: image/png

image data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 85

{
  "imagesUrl" : [ "firstProductImage/image.png", "secondProductImage/image.png" ]
}

Response Field Description

Path Type Description

imagesUrl

Array

product’s imageUrls

imagesUrl.[]

Array

product imageUrl

상품 이미지 삭제

Request

DELETE /api/products/1/product-images?deletedImages=firstProductImage%2Fimage.png&deletedImages=secondProductImage%2Fimage.png HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Review

상품 리뷰 등록

Request

POST /api/reviews HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 86
Host: localhost:8080

{
  "rating" : 4,
  "comment" : "firstTestReview",
  "productId" : 1,
  "userId" : 2
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 229

{
  "id" : 1,
  "rating" : 4,
  "comment" : "firstTestReview",
  "userId" : 2,
  "userFullname" : "test2FirstNameTest2LastName",
  "userImageUrl" : "test/image.png",
  "productId" : 1,
  "createdAt" : null,
  "updatedAt" : null
}

Response Field Description

Path Type Description

id

Number

review id

rating

Number

review rating

comment

String

review comment

userId

Number

reviewer id

userFullname

String

reviewer name

userImageUrl

String

reviewer imageUrl

productId

Number

product id

createdAt

Null

the time when review has created

updatedAt

Null

the time when review has recently updated

상품 리뷰 수정

Request

PUT /api/reviews/1 HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 86
Host: localhost:8080

{
  "rating" : 4,
  "comment" : "firstTestReview",
  "productId" : 1,
  "userId" : 2
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 229

{
  "id" : 1,
  "rating" : 4,
  "comment" : "firstTestReview",
  "userId" : 2,
  "userFullname" : "test2FirstNameTest2LastName",
  "userImageUrl" : "test/image.png",
  "productId" : 1,
  "createdAt" : null,
  "updatedAt" : null
}

Response Field Description

Path Type Description

id

Number

review id

rating

Number

review rating

comment

String

review comment

userId

Number

reviewer id

userFullname

String

reviewer name

userImageUrl

String

reviewer imageUrl

productId

Number

product id

createdAt

Null

the time when review has created

updatedAt

Null

the time when review has recently updated

상품 리뷰 삭제

Request

DELETE /api/reviews/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Cart

장바구니 생성

Request

POST /api/carts?userId=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

userId=1

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1

0

사용자 장바구니 조회

Request

GET /api/carts?userId=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 592

{
  "id" : 1,
  "items" : [ {
    "id" : 1,
    "qty" : 2,
    "stock" : 100,
    "productId" : 1,
    "productName" : "firstProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is first product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "firstProductImage/image.png"
  }, {
    "id" : 1,
    "qty" : 2,
    "stock" : 100,
    "productId" : 1,
    "productName" : "secondProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is second product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "thirdProductImage/image.png"
  } ]
}

Response Field Description

Path Type Description

id

Number

cart id

items

Array

cart items

items.[].id

Number

item id

items.[].qty

Number

item qty

items.[].stock

Number

product stock

items.[].productId

Number

product id

items.[].productName

String

product name

items.[].productPrice

Number

product price

items.[].productDescription

String

product description

items.[].productBrand

String

product brand

items.[].productImageUrl

String

product main imageUrl

CartItem

장바구니 상품 추가

Request

POST /api/cart-items HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 50
Host: localhost:8080

{
  "qty" : 2,
  "productId" : 1,
  "cartId" : 1
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 258

{
  "id" : 1,
  "qty" : 2,
  "stock" : 100,
  "productId" : 1,
  "productName" : "firstProduct",
  "productPrice" : 15.0,
  "productDescription" : "This is first product.",
  "productBrand" : "testBrand",
  "productImageUrl" : "firstProductImage/image.png"
}

Response Field Description

Path Type Description

id

Number

item id

qty

Number

item qty

stock

Number

product stock

productId

Number

product id

productName

String

product name

productPrice

Number

product price

productDescription

String

product description

productBrand

String

product brand

productImageUrl

String

product main imageUrl

장바구니 상품 수량 수정

Request

PUT /api/cart-items/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

qty=2

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 258

{
  "id" : 1,
  "qty" : 2,
  "stock" : 100,
  "productId" : 1,
  "productName" : "firstProduct",
  "productPrice" : 15.0,
  "productDescription" : "This is first product.",
  "productBrand" : "testBrand",
  "productImageUrl" : "firstProductImage/image.png"
}

Response Field Description

Path Type Description

id

Number

item id

qty

Number

item qty

stock

Number

product stock

productId

Number

product id

productName

String

product name

productPrice

Number

product price

productDescription

String

product description

productBrand

String

product brand

productImageUrl

String

product main imageUrl

장바구니 상품 삭제

Request

DELETE /api/cart-items/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

Order

주문 생성

Request

POST /api/orders HTTP/1.1
Content-Type: application/hal+json;charset=utf-8
Authorization: Bearer token
Accept: application/json
Content-Length: 334
Host: localhost:8080

{
  "userId" : 1,
  "shipping" : 10.0,
  "paymentMethod" : "testPaymentMethod",
  "transactionId" : "testTransactionId",
  "address" : {
    "name" : "testAddress",
    "country" : "testCountry",
    "city" : "testCity",
    "zipcode" : "testZipcode",
    "address" : "testAddress",
    "latitude" : null,
    "longitude" : null
  }
}

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1153

{
  "id" : 1,
  "orderStatus" : "ORDER",
  "paymentMethod" : "testPaymentMethod",
  "transactionId" : "testTransactionId",
  "paidAt" : "2022-06-23T16:55:19.158488",
  "deliveredAt" : null,
  "address" : {
    "name" : "testAddress",
    "country" : "testCountry",
    "city" : "testCity",
    "zipcode" : "testZipcode",
    "address" : "testAddress",
    "latitude" : null,
    "longitude" : null
  },
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "imageUrl" : "test/image.png"
  },
  "items" : [ {
    "id" : 1,
    "qty" : 3,
    "stock" : 100,
    "productId" : 1,
    "productName" : "firstProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is first product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "firstProductImage/image.png"
  }, {
    "id" : 2,
    "qty" : 3,
    "stock" : 100,
    "productId" : 1,
    "productName" : "secondProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is second product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "thirdProductImage/image.png"
  } ],
  "total" : 90.0,
  "shipping" : 10,
  "delivered" : false
}

Response Field Description

Path Type Description

id

Number

order id

orderStatus

String

order status

paymentMethod

String

order payment method

transactionId

String

order transaction id

paidAt

String

the time when order has payed

delivered

Boolean

whether this order has delivered or not

deliveredAt

Null

the time when order has delivered

address

Object

where to deliver this order

address.name

String

address name

address.country

String

address country

address.city

String

address city

address.zipcode

String

address zipcode

address.address

String

address details

address.latitude

Null

address latitude

address.longitude

Null

address longitude

user

Object

user who ordered this

user.id

Number

user id

user.fullname

String

user fullName

user.imageUrl

String

user imageUrl

items

Array

order items

items.[].id

Number

item id

items.[].qty

Number

item qty

items.[].stock

Number

product stock

items.[].productId

Number

product id

items.[].productName

String

product name

items.[].productPrice

Number

product price

items.[].productDescription

String

product description

items.[].productBrand

String

product brand

items.[].productImageUrl

String

product main imageUrl

total

Number

the total amount of this order

shipping

Number

shipping cost of this order

단일 주문 조회

Request

GET /api/orders/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 1153

{
  "id" : 1,
  "orderStatus" : "ORDER",
  "paymentMethod" : "testPaymentMethod",
  "transactionId" : "testTransactionId",
  "paidAt" : "2022-06-23T16:55:19.158488",
  "deliveredAt" : null,
  "address" : {
    "name" : "testAddress",
    "country" : "testCountry",
    "city" : "testCity",
    "zipcode" : "testZipcode",
    "address" : "testAddress",
    "latitude" : null,
    "longitude" : null
  },
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "imageUrl" : "test/image.png"
  },
  "items" : [ {
    "id" : 1,
    "qty" : 3,
    "stock" : 100,
    "productId" : 1,
    "productName" : "firstProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is first product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "firstProductImage/image.png"
  }, {
    "id" : 2,
    "qty" : 3,
    "stock" : 100,
    "productId" : 1,
    "productName" : "secondProduct",
    "productPrice" : 15.0,
    "productDescription" : "This is second product.",
    "productBrand" : "testBrand",
    "productImageUrl" : "thirdProductImage/image.png"
  } ],
  "total" : 90.0,
  "shipping" : 10,
  "delivered" : false
}

Response Field Description

Path Type Description

id

Number

order id

orderStatus

String

order status

paymentMethod

String

order payment method

transactionId

String

order transaction id

paidAt

String

the time when order has payed

delivered

Boolean

whether this order has delivered or not

deliveredAt

Null

the time when order has delivered

address

Object

where to deliver this order

address.name

String

address name

address.country

String

address country

address.city

String

address city

address.zipcode

String

address zipcode

address.address

String

address details

address.latitude

Null

address latitude

address.longitude

Null

address longitude

user

Object

user who ordered this

user.id

Number

user id

user.fullname

String

user fullName

user.imageUrl

String

user imageUrl

items

Array

order items

items.[].id

Number

item id

items.[].qty

Number

item qty

items.[].stock

Number

product stock

items.[].productId

Number

product id

items.[].productName

String

product name

items.[].productPrice

Number

product price

items.[].productDescription

String

product description

items.[].productBrand

String

product brand

items.[].productImageUrl

String

product main imageUrl

total

Number

the total amount of this order

shipping

Number

shipping cost of this order

모든 주문 조회

Request

GET /api/orders?page=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 643

{
  "orders" : [ {
    "id" : 1,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 90.0,
    "delivered" : false
  }, {
    "id" : 2,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 0,
    "delivered" : false
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

orders

Array

found orders

orders.[].id

Number

order id

orders.[].orderStatus

String

order status

orders.[].paidAt

String

the time when order has payed

orders.[].delivered

Boolean

whether this order has delivered or not

orders.[].deliveredAt

Null

the time when order has delivered

orders.[].user

Object

user who ordered this order

orders.[].user.id

Number

user id

orders.[].user.fullname

String

user fullName

orders.[].user.imageUrl

String

user imageUrl

orders.[].totalAmount

Number

the total amount of this order

totalElement

Number

the number of orders

totalPage

Number

the number of totalPage

판매자의 주문 목록 조회

Request

GET /api/orders?page=1&sellerId=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 643

{
  "orders" : [ {
    "id" : 1,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 90.0,
    "delivered" : false
  }, {
    "id" : 2,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 0,
    "delivered" : false
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

orders

Array

found orders

orders.[].id

Number

order id

orders.[].orderStatus

String

order status

orders.[].paidAt

String

the time when order has payed

orders.[].delivered

Boolean

whether this order has delivered or not

orders.[].deliveredAt

Null

the time when order has delivered

orders.[].user

Object

user who ordered this order

orders.[].user.id

Number

user id

orders.[].user.fullname

String

user fullName

orders.[].user.imageUrl

String

user imageUrl

orders.[].totalAmount

Number

the total amount of this order

totalElement

Number

the number of orders

totalPage

Number

the number of totalPage

사용자의 주문 목록 조회

Request

GET /api/orders?page=1&userId=1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 643

{
  "orders" : [ {
    "id" : 1,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 90.0,
    "delivered" : false
  }, {
    "id" : 2,
    "orderStatus" : "ORDER",
    "paidAt" : "2022-06-23T16:55:19.158488",
    "deliveredAt" : null,
    "user" : {
      "id" : 1,
      "fullname" : "testFirstNameTestLastName",
      "imageUrl" : "test/image.png"
    },
    "totalAmount" : 0,
    "delivered" : false
  } ],
  "totalElement" : 2,
  "totalPage" : 1
}

Response Field Description

Path Type Description

orders

Array

found orders

orders.[].id

Number

order id

orders.[].orderStatus

String

order status

orders.[].paidAt

String

the time when order has payed

orders.[].delivered

Boolean

whether this order has delivered or not

orders.[].deliveredAt

Null

the time when order has delivered

orders.[].user

Object

user who ordered this order

orders.[].user.id

Number

user id

orders.[].user.fullname

String

user fullName

orders.[].user.imageUrl

String

user imageUrl

orders.[].totalAmount

Number

the total amount of this order

totalElement

Number

the number of orders

totalPage

Number

the number of totalPage

주문 배송

Request

PUT /api/orders/1/delivery HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 286

{
  "id" : 1,
  "orderStatus" : "ORDER",
  "paidAt" : "2022-06-23T16:55:19.158488",
  "deliveredAt" : "2022-06-23T16:55:19.15858",
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "imageUrl" : "test/image.png"
  },
  "totalAmount" : 0,
  "delivered" : true
}

Response Field Description

Path Type Description

id

Number

order id

orderStatus

String

order status

paidAt

String

the time when order has payed

delivered

Boolean

whether this order has delivered or not

deliveredAt

String

the time when order has delivered

user

Object

user who ordered this order

user.id

Number

user id

user.fullname

String

user fullName

user.imageUrl

String

user imageUrl

totalAmount

Number

the total amount of this order

주문 취소

Request

PUT /api/orders/1/cancellation HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 287

{
  "id" : 1,
  "orderStatus" : "CANCEL",
  "paidAt" : "2022-06-23T16:55:19.158488",
  "deliveredAt" : "2022-06-23T16:55:19.15858",
  "user" : {
    "id" : 1,
    "fullname" : "testFirstNameTestLastName",
    "imageUrl" : "test/image.png"
  },
  "totalAmount" : 0,
  "delivered" : true
}

Response Field Description

Path Type Description

id

Number

order id

orderStatus

String

order status

paidAt

String

the time when order has payed

delivered

Boolean

whether this order has delivered or not

deliveredAt

String

the time when order has delivered

user

Object

user who ordered this order

user.id

Number

user id

user.fullname

String

user fullName

user.imageUrl

String

user imageUrl

totalAmount

Number

the total amount of this order

OrderItem

주문 상품 삭제

Request

DELETE /api/order-items/1 HTTP/1.1
Authorization: Bearer token
Accept: application/json
Host: localhost:8080

Response

HTTP/1.1 204 No Content
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers