-
Notifications
You must be signed in to change notification settings - Fork 0
[GET] 사용자 페이지
Gyunny edited this page Jun 27, 2021
·
8 revisions
메소드 | 경로 | 설명 |
---|---|---|
GET | /api/v2/users/{userId} | 사용자 페이지 조회 |
Default 요청 예시
http://{{base_url}}/api/v2/users/1
{
"accessToken": "[토큰]"
}
- 친구인 사용자 페이지 조회
사용자 정보, isFriend=1(친구), 2(요청중), 3(친구 아님), 버킷 수, 친구 수, 북마크 리스트(북마크 수 포함), 버킷 리스트를 응답합니다.
{
"status": 200,
"message": "사용자페이지 정보입니다.",
"data": {
"user": {
"id": 5,
"email": "[email protected]",
"nickname": "dd소로로",
"createdDate": "2021-05-01 08:33:41",
"intro": "테스트다",
"profileUrl": "sdsdsd",
"socialType": null,
"socialId": null
},
"friendCount": 0,
"bucketCount": 3,
"bookmark": {
"bookmarkList": [
{
"id": 58,
"bucketName": "취미222",
"endDate": "2021-05-05 00:00:00",
"categoryId": 2
},
{
"id": 85,
"bucketName": "버킷리스트 제목",
"endDate": "2021-05-05 00:00:00",
"categoryId": 2
},
{
"id": 92,
"bucketName": "버킷리스트 제목",
"endDate": "2021-05-05 00:00:00",
"categoryId": 2
}
],
"bookMarkCount": 3
},
"isFriend": 1,
"bucket": [
{
"id": 58,
"bucketName": "취미222",
"startDate": "2021-03-21 00:00:00",
"endDate": "2021-05-05 00:00:00",
"bucketState": "1",
"categoryId": 0
},
{
"id": 85,
"bucketName": "버킷리스트 제목",
"startDate": "2021-03-21 00:00:00",
"endDate": "2021-05-05 00:00:00",
"bucketState": "3",
"categoryId": 0
},
{
"id": 92,
"bucketName": "버킷리스트 제목",
"startDate": "2021-03-21 00:00:00",
"endDate": "2021-05-05 00:00:00",
"bucketState": "3",
"categoryId": 0
}
]
}
}
- 친구가 아닌 사용자 페이지 조회
사용자 정보, isFriend=1(친구), 2(요청중), 3(친구 아님), 버킷 수, 친구 수, 북마크 리스트(북마크 수 포함)를 응답합니다.
{
"status": 200,
"message": "사용자페이지 정보입니다.",
"data": {
"user": {
"id": 7,
"email": "[email protected]",
"nickname": "테스트2",
"createdDate": "2021-05-01 08:35:37",
"intro": "테스트다",
"profileUrl": "123123",
"socialType": null,
"socialId": null
},
"friendCount": 0,
"bucketCount": 0,
"bookmark": {
"bookmarkList": [],
"bookMarkCount": 0
},
"isFriend": 3
}
}
- 마이 페이지인 경우 (마이 페이지 조회 API와 동일합니다.)
{
"status": 200,
"message": "마이페이지 정보입니다.",
"data": {
"user": {
"id": 7,
"email": "[email protected]",
"nickname": "테스트2",
"createdDate": "2021-05-01 08:35:37",
"intro": "테스트다",
"profileUrl": "123123",
"socialType": null,
"socialId": null
},
"friendCount": 0,
"bucketCount": 0,
"bookmark": {
"bookmarkList": [],
"bookMarkCount": 0
}
}
}
- 존재하지 않는 사용자 조회
{
"message": "User is not Exist",
"status": 400,
"errors": [],
"code": "M003"
}
- 잘못된 토큰
{
"message": "JWT가 없거나 잘못된 값 입니다",
"status": 401,
"errors": [],
"code": "J001"
}
- 서버 에러
{
"message": "User is not Exist",
"status": 400,
"errors": [],
"code": "M003"
}