-
Notifications
You must be signed in to change notification settings - Fork 0
API 명세서_Clothes API
Yeon Sang Shin edited this page Feb 19, 2021
·
28 revisions
2021.02.18 GET Clothes API에 optional query 'weathyid' 추가
2021.02.17 세 API에 clothesNum 변수 추가
2021.01.13 세 API의 response 형태 수정
메소드 | 경로 | 설명 | 구현 여부 |
---|---|---|---|
GET | ~/users/:user-id/clothes?weathyid={weathyid} |
옷 정보 조회 | |
POST | ~/users/:user-id/clothes |
옷 추가 | |
DELETE | ~/users/:user-id/clothes |
옷 삭제 |
- 옷 정보를 조회한다
메소드 | 경로 | 설명 |
---|---|---|
GET | ~/users/:user-id/clothes?weathyid={weathyid} |
옷 정보 조회 |
Name | Type | Description | Mandatory |
---|---|---|---|
x-access-token |
string | 토큰 | Y |
Content-Type |
string | 반환받을 타입 | Y |
x-access-token: {"token"}
Content-Type: application/json
Name | Type | Description | Mandatory |
---|---|---|---|
user-id |
integer | 유저 고유 식별자 | Y |
Name | Type | Description | Mandatory |
---|---|---|---|
weathyid |
int | 웨디 id | N |
- 특정 웨디의 옷 정보를 가져올 때는
weathyid
에 값을 넣어 준다. (예: 과거에 작성한 웨디 수정)
{
"clothesNum": 10,
"closet": {
"top": {
"categoryId": 1,
"clothes": [
{
"id": 1,
"name": "까만 후드티"
},
...
]
},
"bottom": { ... },
"outer": { ... },
"etc": { ... }
},
"message": "옷 정보 조회 성공"
}
Type | Name | Description |
---|---|---|
int | clothesNum | 실제로 현재 있는 옷 개수 |
ClosetObj | closet | 옷장 정보 목록 |
- object | top | 상의 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 상의 카테고리 옷 정보 |
--- int | id | 상의 카테고리 옷 id |
--- string | name | 상의 카테고리 옷 이름 |
- object | bottom | 하의 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 하의 카테고리 옷 정보 |
--- int | id | 하의 카테고리 옷 id |
--- string | name | 하의 카테고리 옷 이름 |
- object | outer | 외투 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 외투 카테고리 옷 정보 |
--- int | id | 외투 카테고리 옷 id |
--- string | name | 외투 카테고리 옷 이름 |
- object | etc | 기타 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 기타 카테고리 옷 정보 |
--- int | id | 기타 카테고리 옷 id |
--- string | name | 기타 카테고리 옷 이름 |
message | string | 상태 메시지 |
- 옷을 추가한다.
메소드 | 경로 | 설명 |
---|---|---|
POST | ~/users/:user-id/clothes |
옷 추가 |
Name | Type | Description | Mandatory |
---|---|---|---|
x-access-token |
string | 토큰 | Y |
Content-Type |
string | 반환받을 타입 | Y |
x-access-token: {"token"}
Content-Type: application/json
Name | Type | Description | Mandatory |
---|---|---|---|
user-id |
integer | 유저 고유 식별자 | Y |
Name | Type | Description | Mandatory |
---|---|---|---|
category |
integer | 추가하고자 하는 옷의 카테고리 id | Y |
name |
string | 옷의 이름 | Y |
- 예시
{
"category": 2,
"name": "기모 후드티"
}
- 추가한 옷과 같은 카테고리의 옷만 반환 (다른 카테고리의 경우 clothes가 [] 로 감)
{
"clothesNum": 5,
"closet": {
"top": {
"categoryId": 1,
"clothes": [
{
"id": 1,
"name": "까만 후드티"
},
...
]
},
"bottom": { ... },
"outer": { ... },
"etc": { ... }
},
"message": "옷 추가 성공"
}
Type | Name | Description |
---|---|---|
int | clothesNum | 실제로 현재 있는 옷 개수 |
Closet | closet | 옷장 정보 |
- obj | top | 상의 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 옷들의 배열 |
string | message | 상태 메시지 |
- 선택된 모든 옷을 옷 정보 리스트에서 삭제한다.
메소드 | 경로 | 설명 |
---|---|---|
DELETE | ~/users/:user-id/clothes |
옷 삭제 |
Name | Type | Description | Mandatory |
---|---|---|---|
x-access-token |
string | 토큰 | Y |
Content-Type |
string | 반환받을 타입 | Y |
x-access-token: {"token"}
Content-Type: application/json
Name | Type | Description | Mandatory |
---|---|---|---|
user-id |
integer | 유저 고유 식별자 | Y |
Name | Type | Description | Mandatory |
---|---|---|---|
clothes |
array | 삭제할 옷 id들이 담긴 list | Y |
- 예시
{
"clothes": [1, 4, 8]
}
{
"clothesNum": 6,
"closet": {
"top": {
"categoryId": 1,
"clothes": [
{
"id": 1,
"name": "까만 후드티"
},
...
]
},
"bottom": { ... },
"outer": { ... },
"etc": { ... }
},
"message": "옷 삭제 성공"
}
Type | Name | Description |
---|---|---|
int | clothesNum | 실제로 현재 있는 옷 개수 |
ClosetObj | closet | 옷장 정보 목록 |
- object | top | 상의 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 상의 카테고리 옷 정보 |
--- int | id | 상의 카테고리 옷 id |
--- string | name | 상의 카테고리 옷 이름 |
- object | bottom | 하의 정보 |
-- int | categoryId | 카테고리 id |
-- List | clothes | 하의 카테고리 옷 정보 |
--- int | id | 하의 카테고리 옷 id |
---- string | name | 하의 카테고리 옷 이름 |
- object | outer | 외투 정보 |
-- int | categoryId | 카테고리 id |
-- list | clothes | 외투 카테고리 옷 정보 |
--- int | id | 외투 카테고리 옷 id |
--- string | name | 외투 카테고리 옷 이름 |
- object | etc | 기타 정보 |
-- int | categoryId | 카테고리 id |
-- list | clothes | 기타 카테고리 옷 정보 |
--- int | id | 기타 카테고리 옷 id |
--- string | name | 기타 카테고리 옷 이름 |
message | string | 상태 메시지 |