channel.js 543 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);
        });
    }
};

module.exports = channel;