plustar.js 909 Bytes
'use strict';
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const _ = require('lodash');
const productProcess = require('../../../utils/product-process');


const getContentData = (gender, type) => {
    
    return serviceAPI.get('guang/api/v3/plustar/getlist', {
        gender: gender,
        brand_type: type
    }).then((result) => {
        if (result && result.code === 200) {
            //console.log(result)
            return result;
        } else {
            logger.error('列表 list data return code is not 200');
            return {};
        }
    });
};

const getListData = (gender, recom, all) => {
    return Promise.all([getContentData(gender, recom), getContentData(gender, all)]).then((result) => {
        return {
            star: result[0],
            plus: result[1]
        };
    });  
};

module.exports = {
    getListData,
    getContentData
};