...
|
...
|
@@ -2,16 +2,25 @@ |
|
|
|
|
|
const utils = '../../../utils';
|
|
|
const productNameProcess = require(`${utils}/product-name-process`);
|
|
|
const api = global.yoho.API;
|
|
|
const _ = require('lodash');
|
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
const getHotRank = (codeKey) => {
|
|
|
return serviceAPI.get('operations/api/v5/resource/get', {
|
|
|
module.exports = class extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
|
|
super(ctx);
|
|
|
}
|
|
|
|
|
|
getHotRank(codeKey) {
|
|
|
return this.get({
|
|
|
api: serviceAPI,
|
|
|
url: 'operations/api/v5/resource/get',
|
|
|
data: {
|
|
|
content_code: codeKey
|
|
|
}, {
|
|
|
},
|
|
|
param: {
|
|
|
cache: true
|
|
|
}
|
|
|
}).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -38,9 +47,9 @@ const getHotRank = (codeKey) => { |
|
|
return {};
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
const selectHotrank = (yhChannel, sort, tabId, limit, page, notab) => {
|
|
|
selectHotrank(yhChannel, sort, tabId, limit, page, notab) {
|
|
|
let param = {
|
|
|
method: 'app.search.top',
|
|
|
yh_channel: yhChannel,
|
...
|
...
|
@@ -56,8 +65,11 @@ const selectHotrank = (yhChannel, sort, tabId, limit, page, notab) => { |
|
|
param.tab_id = tabId;
|
|
|
}
|
|
|
|
|
|
return api.get('', param, {
|
|
|
return this.get({
|
|
|
data: param,
|
|
|
param: {
|
|
|
cache: true
|
|
|
}
|
|
|
}).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200 && result.data.product_list) {
|
...
|
...
|
@@ -127,9 +139,5 @@ const selectHotrank = (yhChannel, sort, tabId, limit, page, notab) => { |
|
|
}
|
|
|
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getHotRank,
|
|
|
selectHotrank
|
|
|
}
|
|
|
}; |
...
|
...
|
|