...
|
...
|
@@ -7,6 +7,7 @@ |
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const redis = require('../../../utils/redis');
|
|
|
|
|
|
const URI_PACKAGE_ARTICLE = 'guang/service/v2/article/';
|
|
|
const URI_PACKAGE_AUTHOR = 'guang/service/v1/author/';
|
...
|
...
|
@@ -204,6 +205,21 @@ class DetailModel extends global.yoho.BaseModel { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 获取逛文章分词内容
|
|
|
_getGuangArticleKeyword(id) {
|
|
|
return redis.all([
|
|
|
['get', `global:yoho:guang:detail:${id}`]
|
|
|
]).then(redisData => {
|
|
|
redisData = JSON.parse(redisData[0] || '{}');
|
|
|
|
|
|
if (!redisData.data) {
|
|
|
return this._getArticleContent(id);
|
|
|
}
|
|
|
|
|
|
return redisData;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* [逛资讯详情页数据封装]
|
|
|
* @param {[int]} id [内容ID]
|
...
|
...
|
@@ -229,7 +245,7 @@ class DetailModel extends global.yoho.BaseModel { |
|
|
let article = result.getArticle = data && data.data || {};
|
|
|
let promises = [
|
|
|
this._getAuthor(article.author_id),
|
|
|
this._getArticleContent(id),
|
|
|
this._getGuangArticleKeyword(id),
|
|
|
this._getBrand(id)
|
|
|
];
|
|
|
|
...
|
...
|
|