custom.js 633 Bytes
/**
 * 自定义频道页面 model
 * @author: Bi Kai<kai.bi@yoho.cn>
 * @date: 2016/05/09
 */

'use strict';
const utils = '../../../utils';
const resourcesProcess = require(`${utils}/resources-process`);
const service = global.yoho.ServiceAPI;

module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
    }

    getResourceData(code) {
        return service.get('operations/api/v5/resource/get', {
            content_code: code
        }, {
            cache: true,
            code: 200
        }).then(result => {
            return resourcesProcess(result.data);
        });
    }
};