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 |
|---|---|---|
|
|
created user’s information |
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
whether user is seller or not |
|
|
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 |
|---|---|---|
|
|
created user’s information |
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
whether user is seller or not |
|
|
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 |
|---|---|---|
|
|
created user’s information |
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
whether user is seller or not |
|
|
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 |
|---|---|---|
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
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 |
|---|---|---|
|
|
found user’s information |
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
whether user is seller or not |
|
|
the number of total element |
|
|
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 |
|---|---|---|
|
|
found user’s information |
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
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 |
|---|---|---|
|
|
user id |
|
|
user firstname |
|
|
user lastname |
|
|
user email |
|
|
user role |
|
|
user image url |
|
|
user phoneNumber |
|
|
user activity level |
|
|
user description |
|
|
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 |
|---|---|---|
|
|
activity id |
|
|
activity name |
|
|
activity score |
|
|
activity description |
|
|
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 |
|---|---|---|
|
|
activity id |
|
|
activity name |
|
|
activity score |
|
|
activity description |
|
|
activity image url |
|
|
userActivity of someone who is doing or has finished this activity |
|
|
userActivity id |
|
|
userActivity’s status |
|
|
user’s id |
|
|
user’s imageUrl |
|
|
user’s fullName |
|
|
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 |
|---|---|---|
|
|
activity id |
|
|
activity name |
|
|
activity score |
|
|
activity description |
|
|
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 |
|---|---|---|
|
|
activity id |
|
|
activity name |
|
|
activity score |
|
|
activity description |
|
|
activity image url |
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 |
|---|---|---|
|
|
user’s activity id |
|
|
activity id |
|
|
activity imageUrl |
|
|
activity name |
|
|
activity score |
|
|
whether user’s activity is finished or not |
|
|
the time when user’s activity has started |
|
|
the time when user’s activity has recently updated |
|
|
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 |
|---|---|---|
|
|
user’s activities |
|
|
user’s activity id |
|
|
activity id |
|
|
activity imageUrl |
|
|
activity name |
|
|
activity score |
|
|
whether user’s activity is finished or not |
|
|
the time when user’s activity has started |
|
|
the time when user’s activity has recently updated |
|
|
user’s current level |
|
|
the number of total pages |
|
|
the number of total userActivities |
|
|
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 |
|---|---|---|
|
|
user’s activity id |
|
|
activity id |
|
|
activity imageUrl |
|
|
activity name |
|
|
activity score |
|
|
whether user’s activity is finished or not |
|
|
the time when user’s activity has started |
|
|
the time when user’s activity has recently updated |
|
|
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 |
|---|---|---|
|
|
follow id |
|
|
following user(toId user)'s information |
|
|
following’s id |
|
|
following’s fullName |
|
|
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 |
|---|---|---|
|
|
the information of followers |
|
|
follow id |
|
|
follower user’s information |
|
|
follower’s id |
|
|
follower’s fullName |
|
|
follower’s imageUrl |
|
|
the information of followings |
|
|
follow id |
|
|
following user’s information |
|
|
following’s id |
|
|
following’s fullName |
|
|
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 |
|---|---|---|
|
|
follow id |
|
|
follower user’s information |
|
|
follower’s id |
|
|
follower’s fullName |
|
|
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 |
|---|---|---|
|
|
follow id |
|
|
follower user’s information |
|
|
follower’s id |
|
|
follower’s fullName |
|
|
follower’s imageUrl |
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 |
|---|---|---|
|
|
post id |
|
|
post title |
|
|
post content |
|
|
post writer’s information |
|
|
writer id |
|
|
writer fullname |
|
|
writer email |
|
|
writer imageUrl |
|
|
writer description |
|
|
users who like this post |
|
|
likePost id |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
post’s images |
|
|
postImage id |
|
|
post imageUrl |
|
|
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 |
|---|---|---|
|
|
post id |
|
|
post title |
|
|
post content |
|
|
post writer’s information |
|
|
writer id |
|
|
writer fullname |
|
|
writer email |
|
|
writer imageUrl |
|
|
writer description |
|
|
users who like this post |
|
|
likePost id |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
post’s images |
|
|
postImage id |
|
|
post imageUrl |
|
|
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 |
|---|---|---|
|
|
the information of user’s posts |
|
|
post id |
|
|
post title |
|
|
post first image url |
|
|
user imageUrl |
|
|
user fullName |
|
|
user id |
|
|
the information of the posts which user likes |
|
|
like post id |
|
|
like post title |
|
|
like post first image url |
|
|
writer imageUrl |
|
|
writer fullName |
|
|
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 |
|---|---|---|
|
|
the information of user’s posts |
|
|
post id |
|
|
post title |
|
|
post first image url |
|
|
user imageUrl |
|
|
user fullName |
|
|
user id |
|
|
the number of total posts |
|
|
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 |
|---|---|---|
|
|
the posts of following’s and mine |
|
|
post id |
|
|
post title |
|
|
post content |
|
|
post writer’s information |
|
|
writer id |
|
|
writer fullname |
|
|
writer email |
|
|
writer imageUrl |
|
|
writer description |
|
|
users who like this post |
|
|
likePost id |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
post’s images |
|
|
postImage id |
|
|
post imageUrl |
|
|
the time when post created |
|
|
the number of total posts |
|
|
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 |
|---|---|---|
|
|
the information of user’s posts |
|
|
post id |
|
|
post title |
|
|
post first image url |
|
|
user imageUrl |
|
|
user fullName |
|
|
user id |
|
|
the number of total posts |
|
|
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 |
|---|---|---|
|
|
the information of user’s posts |
|
|
post id |
|
|
post title |
|
|
post first image url |
|
|
user imageUrl |
|
|
user fullName |
|
|
user id |
|
|
the number of total posts |
|
|
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 |
|---|---|---|
|
|
post id |
|
|
post title |
|
|
post content |
|
|
post writer’s information |
|
|
writer id |
|
|
writer fullname |
|
|
writer email |
|
|
writer imageUrl |
|
|
writer description |
|
|
users who like this post |
|
|
likePost id |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
post’s images |
|
|
postImage id |
|
|
post imageUrl |
|
|
the time when post created |
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 |
|---|---|---|
|
|
post’s images |
|
|
postImage id |
|
|
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 |
|---|---|---|
|
|
likePost id |
|
|
the id of user who liked post |
|
|
the fullName of user who liked post |
|
|
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 |
|---|---|---|
|
|
product id |
|
|
product name |
|
|
product brand |
|
|
product category |
|
|
product stock |
|
|
product price |
|
|
product rating average |
|
|
product’s images |
|
|
product imageUrl |
|
|
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 |
|---|---|---|
|
|
product id |
|
|
product name |
|
|
product brand |
|
|
product category |
|
|
product stock |
|
|
product price |
|
|
product rating average |
|
|
product description |
|
|
product’s images |
|
|
product image name |
|
|
product imageUrl |
|
|
product seller |
|
|
seller id |
|
|
seller fullName |
|
|
seller email |
|
|
seller imageUrl |
|
|
seller description |
|
|
product’s reviews |
|
|
review id |
|
|
review rating |
|
|
review comment |
|
|
review writer id |
|
|
review writer name |
|
|
review writer imageUrl |
|
|
product id |
|
|
the time when review has created |
|
|
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 |
|---|---|---|
|
|
found products |
|
|
product id |
|
|
product name |
|
|
product brand |
|
|
product category |
|
|
product stock |
|
|
product price |
|
|
product rating average |
|
|
product’s images |
|
|
product imageUrl |
|
|
product description |
|
|
product seller |
|
|
seller id |
|
|
seller fullname |
|
|
seller email |
|
|
seller imageUrl |
|
|
seller phoneNumber |
|
|
seller activity level |
|
|
seller description |
|
|
the number of products |
|
|
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 |
|---|---|---|
|
|
found products |
|
|
product id |
|
|
product name |
|
|
product brand |
|
|
product category |
|
|
product stock |
|
|
product price |
|
|
product rating average |
|
|
product’s images |
|
|
product imageUrl |
|
|
product description |
|
|
product seller |
|
|
seller id |
|
|
seller fullname |
|
|
seller email |
|
|
seller imageUrl |
|
|
seller phoneNumber |
|
|
seller activity level |
|
|
seller description |
|
|
the number of products |
|
|
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 |
|---|---|---|
|
|
product id |
|
|
product name |
|
|
product brand |
|
|
product category |
|
|
product stock |
|
|
product price |
|
|
product rating average |
|
|
product’s images |
|
|
product imageUrl |
|
|
product description |
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 |
|---|---|---|
|
|
product’s imageUrls |
|
|
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 |
|---|---|---|
|
|
review id |
|
|
review rating |
|
|
review comment |
|
|
reviewer id |
|
|
reviewer name |
|
|
reviewer imageUrl |
|
|
product id |
|
|
the time when review has created |
|
|
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 |
|---|---|---|
|
|
review id |
|
|
review rating |
|
|
review comment |
|
|
reviewer id |
|
|
reviewer name |
|
|
reviewer imageUrl |
|
|
product id |
|
|
the time when review has created |
|
|
the time when review has recently updated |
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 |
|---|---|---|
|
|
cart id |
|
|
cart items |
|
|
item id |
|
|
item qty |
|
|
product stock |
|
|
product id |
|
|
product name |
|
|
product price |
|
|
product description |
|
|
product brand |
|
|
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 |
|---|---|---|
|
|
item id |
|
|
item qty |
|
|
product stock |
|
|
product id |
|
|
product name |
|
|
product price |
|
|
product description |
|
|
product brand |
|
|
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 |
|---|---|---|
|
|
item id |
|
|
item qty |
|
|
product stock |
|
|
product id |
|
|
product name |
|
|
product price |
|
|
product description |
|
|
product brand |
|
|
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 |
|---|---|---|
|
|
order id |
|
|
order status |
|
|
order payment method |
|
|
order transaction id |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
where to deliver this order |
|
|
address name |
|
|
address country |
|
|
address city |
|
|
address zipcode |
|
|
address details |
|
|
address latitude |
|
|
address longitude |
|
|
user who ordered this |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
order items |
|
|
item id |
|
|
item qty |
|
|
product stock |
|
|
product id |
|
|
product name |
|
|
product price |
|
|
product description |
|
|
product brand |
|
|
product main imageUrl |
|
|
the total amount of this order |
|
|
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 |
|---|---|---|
|
|
order id |
|
|
order status |
|
|
order payment method |
|
|
order transaction id |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
where to deliver this order |
|
|
address name |
|
|
address country |
|
|
address city |
|
|
address zipcode |
|
|
address details |
|
|
address latitude |
|
|
address longitude |
|
|
user who ordered this |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
order items |
|
|
item id |
|
|
item qty |
|
|
product stock |
|
|
product id |
|
|
product name |
|
|
product price |
|
|
product description |
|
|
product brand |
|
|
product main imageUrl |
|
|
the total amount of this order |
|
|
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 |
|---|---|---|
|
|
found orders |
|
|
order id |
|
|
order status |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
user who ordered this order |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
the total amount of this order |
|
|
the number of orders |
|
|
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 |
|---|---|---|
|
|
found orders |
|
|
order id |
|
|
order status |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
user who ordered this order |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
the total amount of this order |
|
|
the number of orders |
|
|
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 |
|---|---|---|
|
|
found orders |
|
|
order id |
|
|
order status |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
user who ordered this order |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
the total amount of this order |
|
|
the number of orders |
|
|
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 |
|---|---|---|
|
|
order id |
|
|
order status |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
user who ordered this order |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
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 |
|---|---|---|
|
|
order id |
|
|
order status |
|
|
the time when order has payed |
|
|
whether this order has delivered or not |
|
|
the time when order has delivered |
|
|
user who ordered this order |
|
|
user id |
|
|
user fullName |
|
|
user imageUrl |
|
|
the total amount of this order |