-
Notifications
You must be signed in to change notification settings - Fork 0
Costumes API
atsanan edited this page Oct 18, 2018
·
11 revisions
- GET /api/v1/costumeStore?page=0&limit=10
| Field | Description | Optional | Default | Auth |
|---|---|---|---|---|
| page | Current index of page | Yes | 0 | Yes |
| limit | Maximum of page | Yes | 10 | Yes |
{
"data": {
"costumes": [
{
"_id": "5bb779f468efd8710326696a",
"coin": 1000,
"costumeDetail": {
"chi1": "coutumeDetail",
"chi2": "coutumeDetail",
"eng": "coutumeDetail",
"thai": "coutumeDetail"
},
"costumeName": {
"chi1": "coutumeName",
"chi2": "coutumeName",
"eng": "coutumeName",
"thai": "coutumeName"
},
"created_at": "2018-10-08T08:50:09Z",
"diamond": 1000,
"isActive": true,
"updated_at": "2018-10-08T09:00:01Z"
},
{
"_id": "5bc6b4c25ae5871fa80029c3",
"coin": 11,
"costumeDetail": {
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "tha"
},
"costumeName": {
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "tha"
},
"created_at": "2018-10-17T04:04:18Z",
"diamond": 11,
"isActive": true,
"updated_at": "2018-10-17T12:26:21Z"
}
],
"pageIndex": 0,
"pageLimit": 10,
"pages": 1,
"paging": {
"next": "",
"previous": ""
}
},
"isSuccess": true
}- POST /api/v1/costumeStore/add
| Field | Description | Optional | Auth |
|---|---|---|---|
| costumeName | Name of the costume | No | admin |
| costumeDetail | Detail this costume | Yes | admin |
| coin | Costume price in coins | No | admin |
| diamond | Costume price in diamonds | No | admin |
| isActive | Can interact with | No | admin |
{
"data": [
{
"id": "5b31c2efbdfdd84f1fb62fc2",
"costumeName":{
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "thai"
},
"costumeDetail": {
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "thai"
},
"coin": 1,
"diamond": 500,
"isActive": true,
"createAt": "2018-06-26T04:41:45.477Z",
"lastModified": "2018-06-26T04:41:45.477Z"
}
],
"isSuccess": true
}DELETE /api/v1/costumeStore/{id : string}
| Field | Description | Optional | Auth |
|---|
{
"data": null,
"isSuccess": true
}POST /api/v1/costumeStore/{id: string}
| Field | Description | Optional | Auth |
|---|---|---|---|
| costumeName | Name of the costume | No | admin |
| costumeDetail | Detail about this costume | Yes | admin |
| coin | Price of a costume by coins | Yes | admin |
| diamond | Price of a costume by diamonds | Yes | admin |
| isActive | Can buy or not | Yes | admin |
{
"data": {
"id": "5b31d6f0bdfdd84f1fb77e2d",
"costumeName":{
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "thai"
},
"costumeDetail": {
"chi1": "chi1",
"chi2": "chi2",
"eng": "eng",
"thai": "thai"
},
"coin": 1000,
"diamond": 1,
"isActive": true,
"createAt": "2018-06-26T06:07:06.023Z",
"lastModified": "2018-06-26T07:37:52.906Z"
},
"isSuccess": true
}