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

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

    //首页轮播图
    async rotationChartList(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
            return system.getResultFail(-100, "参数错误");
        }
        
        var res =await mediaaggregationDao.rotationChartList(pobj);
        return system.getResultSuccess(res);
    }
    //留资表单产品
    async needProductList(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
            return system.getResultFail(-100, "参数错误");
        }
        
        var res =await mediaaggregationDao.needProductList(pobj);
        return system.getResultSuccess(res);
    }


    //热门推荐
    async popularRecommendationList(pobj) {
        if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
            return system.getResultFail(-100, "参数错误");
        }
        
        var res =await mediaaggregationDao.popularRecommendationList(pobj);
        return system.getResultSuccess(res);
    }



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

    //吸底菜单
    async bottomMenuConfig(pobj) {
        if (!pobj || !pobj.actionBody|| !pobj.actionBody.company_id) {
            return system.getResultFail(-100, "参数错误");
        }
        
        var res =await mediaaggregationDao.bottomMenuConfig(pobj);
        return system.getResultSuccess(res);
    }
    
     //周期产品
     async cycleProduct(pobj) {
        if (!pobj || !pobj.actionBody|| !pobj.actionBody.company_id) {
            return system.getResultFail(-100, "参数错误");
        }
        
        var res =await mediaaggregationDao.cycleProduct(pobj);
        return system.getResultSuccess(res);
    }
}


module.exports = MediaaggregationSve;