const system=require("../../system");
const ServiceBase=require("../sve.base");
class LoopplayService extends ServiceBase{
  constructor(){
     super(ServiceBase.getDaoName(LoopplayService));
     //this.appDao=system.getObject("db.appDao");
  }
  async findByChannelcode(obj){
    return await this.dao .model.findAll({where:{channelCode:obj.channelcode}});
  }
  async findAndCountAll(obj){
     const apps=await super.findAndCountAll(obj);
    //  apps.forEach(a=>{
    //    if(a.content && a.content!=""){
    //       a.content=decodeURIComponent(a.content);
    //    }
    //  });
    // console.log("xxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxx");
    // for(var arch of apps.rows){
    //   var c=arch.content.toString("utf-8") ;
    //   console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    //   console.log(c);
    //   if(c && c!=""){
    //      arch.content=c;
    //   }
    // }
     return apps;
  }
}
module.exports=LoopplayService;
