resouces.js 888 Bytes
/**
 * 资源位查询
 */

'use strict';

const api = global.yoho.ServiceAPI;
const logger = global.yoho.logger;

const Resources = {
    /**
     * 获取新品到着-列表页-banner  资源位
     * @returns {Promise.<T>}
     */
    newProductBanner() {

        let params = {
            content_code: 'a7989369aa86681c678bc40f171b8f1d'
        };

        return api.get('/operations/api/v5/resource/get', params).then(result => {
            if (result && result.code === 200 && result.data) {
                let data = result.data;

                if (data.length > 0) {
                    let d = data[0].data;

                    return d ? d[0] : {};
                }
            }

            return {};
        }).catch(e => {
            logger.error('get new product list banner error', e);
            return {};
        });
    }
};

module.exports = Resources;