erp2goods-service.js
392 Bytes
/**
* Created by TaoHuang on 2016/11/14.
*/
'use strict';
const api = require('./erp2goods-api');
const _ = require('lodash');
const url = require('url');
const findBySkn = (skn) => {
return api.getProductAsync(skn).then((result) => {
return {
url: url.parse(_.get(result, 'data.product_url', '')).path
};
});
};
module.exports = {
findBySkn
};