Skip to content

shopAds Api

atsanan edited this page Oct 18, 2018 · 2 revisions

16. ShopAds

[x] 16.1 Get ShopAds

GET /api/v1/shopAds

Query parameters:

Field Description Optional Default
page Current index of page Yes
limit Maximum of page Yes 10
Returns:
{
    "data": {
        "pageIndex": 0,
        "pageLimit": 10,
        "pages": 1,
        "paging": {
            "next": "",
            "previous": ""
        },
        "shopAds": [
            {
                "_id": "5b8f28fbaaea3c222caa6f2c",
                "createAt": "2018-09-05T00:53:15.114Z",
                "filenameLogo1": {},
                "filenameLogo2": {},
                "lastModified": "2018-09-05T00:53:15.114Z",
                "shopAdsImage": "fileName.png",
                "shopAdsImageLists": [
                    "fileName1.png",
                    "fileName2.png"
                ],
                "shopAdsName": {
                    "chi1": "shopAdsName",
                    "chi2": "shopAdsName",
                    "eng": "shopAdsName",
                    "thai": "shopAdsName"
                },
                "shopName": {
                    "chi1": "test",
                    "chi2": "test",
                    "eng": "test",
                    "thai": "test"
                },
                "updated_at": "2018-10-18T01:24:01Z"
            }
        ]
    },
    "isSuccess": true
}

[x] 16.2 Add ShopAds

POST /api/v1/shopAds/add

Json Body:

Field Description Optional Default
shopAdsNameEng Name of ShopAds English yes
shopAdsNameThai Name of ShopAds Thai yes
shopAdsNameChi1 Name of ShopAds Chinese yes
shopAdsNameChi2 Name of ShopAds Chinese 2 yes
shopAdsImage Image of ShopAds yes
shopAdsImageLists list Image of ShopAds yes
Returns:
{
    "data": {
        "_id": "5b90aa987f58a3000105a0db",
        "createAt": "2018-09-06T04:18:32.059Z",
        "shopAdsImage": "/path",
        "shopAdsImageLists": [
            "/path"
        ],
        "shopAdsNameChi1": "shopAdsNameChi1",
        "shopAdsNameChi2": "shopAdsNameChi2",
        "shopAdsNameEng": "shopAdsNameEng",
        "shopAdsNameThai": "shopAdsNameThai"
    },
    "isSuccess": true
}

[x] 16.3 Update ShopAds

POST /api/v1/shopAds/{id:string}

Json Body:

Field Description Optional Default
shopAdsNameEng Name of ShopAds English yes
shopAdsNameThai Name of ShopAds Thai yes
shopAdsNameChi1 Name of ShopAds Chinese yes
shopAdsNameChi2 Name of ShopAds Chinese 2 yes
shopAdsImage Image of ShopAds yes
shopAdsImageLists list Image of ShopAds yes
Returns:
{
    "data": {
        "_id": "5b90aa987f58a3000105a0db",
        "createAt": "2018-09-06T04:18:32.059Z",
        "shopAdsImage": "/path",
        "shopAdsImageLists": [
            "/path"
        ],
        "shopAdsNameChi1": "shopAdsNameChi1",
        "shopAdsNameChi2": "shopAdsNameChi2",
        "shopAdsNameEng": "shopAdsNameEng",
        "shopAdsNameThai": "shopAdsNameThai"
    },
    "isSuccess": true
}
Clone this wiki locally