...
|
...
|
@@ -9,6 +9,7 @@ const api = global.yoho.API; |
|
|
const logger = global.yoho.logger;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const guangProcess = require(`${global.utils}/guang-process`);
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
/**
|
|
|
* [获取作者信息]
|
...
|
...
|
@@ -65,12 +66,13 @@ const getArticleList = (gender, sortId, uid, udid, page, tag, authorId, limit, u |
|
|
sort_id: sortId,
|
|
|
tag: tag,
|
|
|
author_id: authorId,
|
|
|
limit: limit
|
|
|
limit: 20
|
|
|
};
|
|
|
|
|
|
return serviceAPI.get('guang/api/v2/article/getList', param, {
|
|
|
cache: useCache
|
|
|
}).then((result) => {
|
|
|
console.log(result)
|
|
|
if (result && result.code === 200) {
|
|
|
return result;
|
|
|
} else {
|
...
|
...
|
@@ -297,10 +299,60 @@ const getTagEditor = (param) => { |
|
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取制指定文章的动态信息
|
|
|
* @param ids
|
|
|
* @param udid
|
|
|
* @param other [Obejct] 包含uid,query,type等非必传参数
|
|
|
* @returns {Promise.<T>|*}
|
|
|
*/
|
|
|
const getDynamicDataByIds = (ids, udid, other) => {
|
|
|
let params = {
|
|
|
articleIds: ids,
|
|
|
udid: udid
|
|
|
};
|
|
|
|
|
|
if (other.uid) {
|
|
|
_.assign(params, {
|
|
|
uid: other.uid
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (other.query) {
|
|
|
_.assign(params, {
|
|
|
query: other.query
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (other.type) {
|
|
|
_.assign(params, {
|
|
|
type: other.type
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return serviceAPI.get('guang/api/*/article/getSimpleArticleList', params, {cache: true});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取制指定文章的动态信息
|
|
|
* @param ids
|
|
|
* @returns {Promise.<T>|*}
|
|
|
*/
|
|
|
const getDynamicDataById = (id, uid, udid) => {
|
|
|
return serviceAPI.get('/gateway/guang/api/*/article/getArticlePraiseAndFavor', {
|
|
|
id: id,
|
|
|
uid: uid,
|
|
|
udid: udid
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getAuthor,
|
|
|
getArticleList,
|
|
|
getPageData,
|
|
|
getArticle,
|
|
|
getTagEditor
|
|
|
getTagEditor,
|
|
|
getDynamicDataByIds,
|
|
|
getDynamicDataById
|
|
|
}; |
...
|
...
|
|