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