Skip to content

Costumes API

atsanan edited this page Oct 18, 2018 · 11 revisions

2. Costumes API

2.1 Get data costumes store list

  • GET /api/v1/costumeStore?page=0&limit=10
Query parameters:
Field Description Optional Default Auth
page Current index of page Yes 0 Yes
limit Maximum of page Yes 10 Yes
Returns:
{
    "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
}

2.2 Add costumes store (backend)

  • POST /api/v1/costumeStore/add
Query parameters:
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
Returns:
{
    "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
}

2.3 Delete costumes store (backend)

DELETE /api/v1/costumeStore/{id : string}
Query parameters:
Field Description Optional Auth
Returns:
{
    "data": null,
    "isSuccess": true
}

2.4 Update costumes store (backend)

POST /api/v1/costumeStore/{id: string}
Query parameters:
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
Returns:
{
    "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
}

Clone this wiki locally