USER API
[참고사항]
[수정사항]
*user 테이블의 rank → rating 으로 수정되었습니다.
[GET] localhost:3000/user
parameter
x
response
[
{
"id": 4,
"username": "fake_U3",
"rank": 100,
"status": 0,
"profile": null
"username42":"jeonghwl"
},
{
"id": 2,
"username": "fake_U1",
"rank": 100,
"status": 0,
"profile": null
"username42":"jeonghwl"
},
{
"id": 3,
"username": "fake_U4",
"rank": 100,
"status": 0,
"profile": null
"username42":"jeonghwl"
},
{
"id": 1,
"username": "fake_U2",
"rank": 100,
"status": 0,
"profile": null
"username42":"jeonghwl"
}
]
[GET] localhost:3000/user/id/5
parameter
x
response
{
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0,
"username42":"jeonghwl"
}
[GET] localhost:3000/user/name/fake_U1
parameter
x
response
{
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0,
"username42":"jeonghwl"
}
[GET] localhost:3000/user/me
x
{
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0,
"username42":"jeonghwl"
}
[PATCH] localhost:3000/user/me
token
parameter
{"newUserName":"asdf"}
response
{
"id": 5,
"username": "asdf",
"rank": 100,
"status": 0,
"username42":"jeonghwl"
}
[GET] localhost:3000/user/avatar/id/:userId
x
1. { profilePhoto: "empty", profileUrl: "empty" }
2. { profilePhoto: "empty", profileUrl: "www.~~" }
3. buffer
[GET] localhost:3000/user/avatar/name/:name
x
1. { profilePhoto: "empty", profileUrl: "empty" }
2. { profilePhoto: "empty", profileUrl: "www.~~" }
3. buffer
[GET] localhost:3000/user/avatar/me
x
1. { profilePhoto: "empty", profileUrl: "empty" }
2. { profilePhoto: "empty", profileUrl: "www.~~" }
3. buffer
[PUT] localhost:3000/user/avatar/me
file
{
"id": 27,
"filename": "imagefile.png",
"profileUrl":"www..."
}
[GET] http://localhost:3000/user/match/id/9 (userId)
x
[
{
"id": 1,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:43:02.642Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 2,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:44:09.143Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 3,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:44:20.733Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 4,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:44:22.904Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 5,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:44:25.913Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 6,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:44:43.924Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 7,
"winnerScore": 2,
"loserScore": 7,
"createdAt": "2022-12-20T01:46:00.891Z",
"winner": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
},
"loser": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
}
},
{
"id": 8,
"winnerScore": 3,
"loserScore": 3,
"createdAt": "2022-12-20T01:48:01.247Z",
"winner": {
"id": 9,
"username": "jeonghwl",
"rank": 100,
"status": 0
},
"loser": {
"id": 5,
"username": "fake_U1",
"rank": 100,
"status": 0
}
}
]