...
|
...
|
@@ -4,7 +4,6 @@ const ROOT_PATH = global.ROOT_PATH; |
|
|
const _ = require('lodash');
|
|
|
const redis = require(`${ROOT_PATH}/libs/redis`);
|
|
|
const YohoApiModel = require('./../interface/yoho-api');
|
|
|
const TaskLogModel = require('./../interface/task-log');
|
|
|
const co = Promise.coroutine;
|
|
|
const rp = require('request-promise');
|
|
|
const senUrl = 'http://data.zz.baidu.com/urls';
|
...
|
...
|
@@ -18,7 +17,6 @@ class BaiduLinkSubmit extends global.yoho.BaseModel { |
|
|
super(ctx);
|
|
|
|
|
|
this.yohoApiModel = new YohoApiModel(ctx);
|
|
|
this.taskLogModel = new TaskLogModel(ctx);
|
|
|
}
|
|
|
|
|
|
// 向百度发送数据
|
...
|
...
|
@@ -115,18 +113,7 @@ class BaiduLinkSubmit extends global.yoho.BaseModel { |
|
|
|
|
|
return rdata;
|
|
|
|
|
|
})().then(rdata => {
|
|
|
let key = this.taskLogModel.getKey('http://127.0.0.1:6005/goodsUrl');
|
|
|
|
|
|
return this.taskLogModel.ltrim(key).then(() => {
|
|
|
return Promise.all([
|
|
|
this.taskLogModel.add(key, rdata[0]),
|
|
|
this.taskLogModel.add(key, rdata[1])
|
|
|
]);
|
|
|
}).then(() => {
|
|
|
return rdata;
|
|
|
});
|
|
|
});
|
|
|
})();
|
|
|
}
|
|
|
|
|
|
// 提交逛详情URL
|
...
|
...
|
@@ -194,18 +181,7 @@ class BaiduLinkSubmit extends global.yoho.BaseModel { |
|
|
Object.assign(rdata[1], {message: `WAP: ${message}`});
|
|
|
|
|
|
return rdata;
|
|
|
})().then(rdata => {
|
|
|
let key = this.taskLogModel.getKey('http://127.0.0.1:6005/guangUrl');
|
|
|
|
|
|
return this.taskLogModel.ltrim(key).then(() => {
|
|
|
return Promise.all([
|
|
|
this.taskLogModel.add(key, rdata[0]),
|
|
|
this.taskLogModel.add(key, rdata[1])
|
|
|
]);
|
|
|
}).then(() => {
|
|
|
return rdata;
|
|
|
});
|
|
|
});
|
|
|
})();
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
|