Blame view

apps/common/models/erp2goods-api.js 639 Bytes
htoooth authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/**
 * Created by TaoHuang on 2016/11/14.
 */

'use strict';

const api = global.yoho.API;
const config = global.yoho.config;

/**
 * 获得产品信息
 * @param pid
 * @returns {Promise.<type>}
 */
htoooth authored
15
const getProductBySknAsync = (skn) => {
htoooth authored
16 17 18 19 20 21 22 23
    let params = {
        method: 'app.product.data',
        product_skn: skn
    };

    return api.get('', params, config.apiCache);
};
htoooth authored
24 25 26 27 28 29 30 31 32
const getProductBySkuAsync = (sku) => {
    let params = {
        method: 'app.shops.productListByskus',
        skus: sku
    };

    return api.get('', params, config.apiCache);
};
htoooth authored
33
module.exports = {
htoooth authored
34 35
    getProductBySknAsync,
    getProductBySkuAsync
htoooth authored
36
};