...
|
...
|
@@ -10,8 +10,6 @@ const resourcesProcess = require(`${utils}/resources-process`); |
|
|
const logger = global.yoho.logger;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const _ = require('lodash');
|
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const api = global.yoho.API;
|
|
|
|
|
|
const contentCode = contentCodeConfig.guang;
|
|
|
|
...
|
...
|
@@ -26,9 +24,13 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* @return {[array]}
|
|
|
*/
|
|
|
_getResources(page) {
|
|
|
return serviceAPI.get('operations/api/v5/resource/get', {
|
|
|
content_code: contentCode[page],
|
|
|
platform: 'iphone'
|
|
|
return this.get({
|
|
|
url: 'operations/api/v5/resource/get',
|
|
|
data: {
|
|
|
content_code: contentCode[page],
|
|
|
platform: 'iphone'
|
|
|
},
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -165,9 +167,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* 星潮首页
|
|
|
*/
|
|
|
getIndexData() {
|
|
|
return api.get('', {
|
|
|
method: 'app.starClass.index',
|
|
|
code: '8adc27fcf5676f356602889afcfd2a8e'
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.starClass.index',
|
|
|
code: '8adc27fcf5676f356602889afcfd2a8e'
|
|
|
},
|
|
|
api: global.yoho.API
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -184,12 +189,15 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* 明星专题
|
|
|
*/
|
|
|
getDetailData(params, uid) {
|
|
|
return api.get('', {
|
|
|
method: 'app.starClass.lastTagArticle',
|
|
|
tag: params.tag,
|
|
|
page: params.page || 1,
|
|
|
size: 10,
|
|
|
uid: uid
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.starClass.lastTagArticle',
|
|
|
tag: params.tag,
|
|
|
page: params.page || 1,
|
|
|
size: 10,
|
|
|
uid: uid
|
|
|
},
|
|
|
api: global.yoho.API
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -237,10 +245,14 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* 星搭配
|
|
|
*/
|
|
|
getCollocationListData(params, uid) {
|
|
|
return serviceAPI.get('guang/api/v5/article/getStarClassroomArticleList', Object.assign({
|
|
|
limit: '20',
|
|
|
uid: uid
|
|
|
}, params), {
|
|
|
return this.get({
|
|
|
url: 'guang/api/v5/article/getStarClassroomArticleList',
|
|
|
data: Object.assign({
|
|
|
limit: '20',
|
|
|
uid: uid
|
|
|
}, params),
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -260,11 +272,14 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
});
|
|
|
}
|
|
|
|
|
|
return api.get('', {
|
|
|
method: params.type === 'del' ? 'app.sns.cancelFavorBackCount' : 'app.sns.setFavorBackCount',
|
|
|
client_type: 'h5',
|
|
|
article_id: params.articleId,
|
|
|
uid: uid
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: params.type === 'del' ? 'app.sns.cancelFavorBackCount' : 'app.sns.setFavorBackCount',
|
|
|
client_type: 'h5',
|
|
|
article_id: params.articleId,
|
|
|
uid: uid
|
|
|
},
|
|
|
api: global.yoho.API
|
|
|
});
|
|
|
}
|
|
|
}; |
...
|
...
|
|