Authored by 郝肖肖

'guangDetail-redis'

... ... @@ -12,7 +12,7 @@ const urlHelper = require('./url-helper');
const videoPlayerTpl = require('../helpers/video-player-tpl');
const helpers = global.yoho.helpers;
const redis = global.yoho.redis;
const URL_OPERATIONS_RESOURCE_GET = 'operations/api/v5/resource/get';
// guang banner code
... ... @@ -835,14 +835,23 @@ module.exports = class extends global.yoho.BaseModel {
article_id: aid
};
return this.get({
url: 'guang/service/v2/article/getArticleContent',
data: data,
param: {
cache: true
},
api: global.yoho.ServiceAPI
return redis.all([
['get', `global:yoho:guang:detail:${aid}`]
]).then(redisData => {
redisData = JSON.parse(redisData[0] || '{}');
if (!redisData.data) {
return this.get({
url: 'guang/service/v2/article/getArticleContent',
data: data,
param: {
cache: true
},
api: global.yoho.ServiceAPI
});
}
return redisData;
}).then(res => { // 内容内推荐的商品
let gpromises = [], ggpromises = [];
... ...