const system = require("../../../system");
const mediaaggregationDao = system.getObject("db.mediaaggregation.mediaaggregationDao");

class MediaaggregationSve {
    constructor() {

    }
    //服务列表
    async productList(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.product_type_code) {
            return system.getResultFail(-100, "参数错误");
        }
        var res = await mediaaggregationDao.productList(pobj);
        return system.getResultSuccess(res);
    }

    //首页轮播图
    async rotationChartList(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.rotationChartList(pobj);
        return system.getResultSuccess(res);
    }
    
    //列表头图
    async tablePicList(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.tablePicList(pobj);
        return system.getResultSuccess(res);
    }
    //留资表单产品
    async needProductList(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.needProductList(pobj);
        return system.getResultSuccess(res);
    }


    //热门推荐
    async popularRecommendationList(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.popularRecommendationList(pobj);
        return system.getResultSuccess(res);
    }



    //产品分类一类
    async productTypeFirst(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.productTypeFirst(pobj);
        return system.getResultSuccess(res);
    }

    //产品分类二类
    async productTypeSecend(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.p_product_type_code) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.productTypeSecend(pobj);
        return system.getResultSuccess(res);
    }
    //产品详情
    async productDetail(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.code) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.productDetail(pobj);
        return system.getResultSuccess(res);
    }

    //吸底菜单
    async bottomMenuConfig(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.bottomMenuConfig(pobj);
        return system.getResultSuccess(res);
    }

    //周期产品
    async cycleProduct(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.cycleProduct(pobj);
        return system.getResultSuccess(res);
    }


    //二级留资页
    async secondLevelNeedConfig(pobj) {
        if (!pobj || !pobj.actionBody.code) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.secondLevelNeedConfig(pobj);
        return system.getResultSuccess(res);
    }
    
    //二级产品资质选项
    async clueMaintenance(pobj) {
        if (!pobj) {
            return system.getResultFail(-100, "参数错误");
        }

        var res = await mediaaggregationDao.clueMaintenance(pobj);
        return system.getResultSuccess(res);
    }
    
}


module.exports = MediaaggregationSve;