channel.js
768 Bytes
'use strict';
const api = global.yoho.ServiceAPI;
const resourcesProcess = require('../../../utils/resources-process');
let channel = {
getResourcesData(params) {
if (!params.contentCode) {
return Promise.resolve([]);
}
return api.get('operations/api/v5/resource/get', {
content_code: params.contentCode
}, {
cache: true,
code: 200
}).then(result => {
return resourcesProcess(result.data);
});
},
getSidebarData() {
return api.get('operations/api/v6/category/getCategory', {
parent_id: 1155
}, {
cache: true,
code: 200
}).then(global.yoho.camelCase);
}
};
module.exports = channel;