-
Notifications
You must be signed in to change notification settings - Fork 0
Friend API
atsanan edited this page Mar 25, 2019
·
11 revisions
POST /api/v1/friend/add
| Field | Description | Optional |
|---|---|---|
| playerId | playerId of a player | Yes |
| friendId | playerId of a player this friend | Yes |
{
"data": {
"_id": "5b629832aaea3c3d0cd1b8a9",
"createAt": "2018-08-02T05:35:46.265Z",
"friend": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
},
"friendActiveStatus": 1,
"friendId": "5b51a8577c74daf430bf2cb5",
"player": {
"_id": "5b5186817c74daf430bdcdef",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b5186817c74daf430bdcdea"
},
"playerId": "5b5186817c74daf430bdcdef"
}
},
"isSuccess": true
}GET /api/v1/friends/friend/{friendId: string}
| Field | Descriptio | Optional |
|---|---|---|
| page | Current page of friend on this player | Yes |
| limit | Maximum page of friend on this player | Yes |
{
"data":{
"friend":[{
"_id": "5b629832aaea3c3d0cd1b8a9",
"createAt": "2018-08-02T05:35:46.265Z",
"friend": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
},
"friendActiveStatus": 1,
"friendId": "5b51a8577c74daf430bf2cb5",
"playerId": "5b5186817c74daf430bdcdef"
}
}],
"pageIndex": -1,
"pageLimit": -1,
"pages": 1,
"paging": {
"next": "",
"previous": ""
},
},
"isSuccess": true
}GET /api/v1/friends/player/{playerId: string}
| Field | Description | Optional |
|---|---|---|
| page | Current page of friend on this player | Yes |
| limit | Maximum page of friend on this player | Yes |
| Returns: |
{
"data":{
"friend":[{
"_id": "5b629832aaea3c3d0cd1b8a9",
"createAt": "2018-08-02T05:35:46.265Z",
"friend": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
},
"friendActiveStatus": 1,
"friendId": "5b51a8577c74daf430bf2cb5",
"playerId": "5b5186817c74daf430bdcdef",
"player": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
},
}
}],
"pageIndex": -1,
"pageLimit": -1,
"pages": 1,
"paging": {
"next": "",
"previous": ""
},
},
"isSuccess": true
}POST /api/v1/friends/updateStatus
| Field | Description | Optional |
|---|---|---|
| Id | Id of a friend | Yes |
| friendStatus | friendStatus of a Friend | Yes |
| Returns: |
{
"data":{
"friend":{
"_id": "5b629832aaea3c3d0cd1b8a9",
"createAt": "2018-08-02T05:35:46.265Z",
"friend": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
},
"friendActiveStatus": false,
"friendId": "5b51a8577c74daf430bf2cb5",
"playerId": "5b5186817c74daf430bdcdef",
"player": {
"_id": "5b51a8577c74daf430bf2cb5",
"coin": 500,
"costumeList": [],
"costumeSelectId": -1,
"diamond": 0,
"gender": "",
"playerName": "undefined",
"teamPlayerId": -1,
"userId": "5b51a8f5083713c64d4a6d3d"
}
}
},
"isSuccess": true
}