ufo-product-api.js
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const rp = require('request-promise');
module.exports.getUfoSpecialSizeProducts = async() => {
return rp({
uri : 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/querySpecialSizeProducts',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
});
};
module.exports.getsSizeData = async() => {
return rp({
uri : 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/querySizeList',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
});
};
module.exports.handleChannelSkuCompare = async(data) => {
try {
return rp({
uri: 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/handleChannelSkuCompare',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify(data)
});
} catch (error) {
return Promise.reject(new Error(`更新channel_sku_compare表错误: ${JSON.stringify(data)}, ${error.message}`));
}
};
module.exports.queryAllChannelProductRelations = async() => {
try {
return rp({
uri: 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/queryAllChannelProductRelations',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify({status: 1, productSign: 1})
});
} catch (error) {
return Promise.reject(new Error(`获取绑定关系错误: ${error.message}`));
}
};
module.exports.queryTopSellProductRelations = async() => {
try {
return rp({
uri: 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/queryAllChannelProductRelations',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify({status: 1, productSign: 1})
});
} catch (error) {
return Promise.reject(new Error(`获取绑定关系错误: ${error.message}`));
}
};
module.exports.queryNormalSellProductRelations = async(data) => {
try {
return rp({
uri: 'http://erp-pre.yohops.com/erp-gateway-web/spiderUfo/queryChannelProductRelationsPages',
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify(data)
});
} catch (error) {
return Promise.reject(new Error(`获取绑定关系错误: ${error.message}`));
}
};