const CtlBase = require("../../ctl.base");
var system = require("../../../system");
class StatisticsCtl extends CtlBase {
    constructor() {
        super("qifutong", CtlBase.getServiceName(StatisticsCtl));
    }
    // 获取 渠道信息 
    async getAllChannels(pobj, qobj, req) {
        try {
            const rs = await this.service.getAllChannels(pobj);
            return system.getResult(rs);
        } catch (err) {
            return system.getResult(null, err.message)
        }
    }

    // 获取 产品信息 
    async getAllProducts(pobj, qobj, req) {
        try {
            const rs = await this.service.getAllProducts(pobj);
            return system.getResult(rs);
        } catch (err) {
            return system.getResult(null, err.message)
        }
    }

    // 需求渠道分析
    async getStatisticsByUappId(pobj, qobj, req) {
        try {
            const rs = await this.service.getStatisticsByUappId(pobj);
            return system.getResult(rs);
        } catch (err) {
            return system.getResult(null, err.message)
        }
    }

    // 需求漏斗图
    async getNeedFunnelStatistics(pobj, qobj, req) {
        try {
            const rs = await this.service.getNeedFunnelStatistics(pobj);
            return system.getResult(rs);
        } catch (err) {
            return system.getResult(null, err.message)
        }
    }

    // 需求产品分析
    async getStatisticsByProduct(pobj, qobj, req) {
        try {
            const rs = await this.service.getStatisticsByProduct(pobj);
            return system.getResult(rs);
        } catch (err) {
            return system.getResult(null, err.message)
        }
    }
}
module.exports = StatisticsCtl;
