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

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

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

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