const system=require("../../system");
const Dao=require("../dao.base");
class ContainerDao extends Dao{
  constructor(){
    super(Dao.getModelName(ContainerDao));
  }
  async findOne(paramappid,t){
    var app=  await this.model.findOne({where:{appid:paramappid}},{transaction:t});
    return app;
  }
  extraModelFilter(){
    return {"key":"include","value":[{model:this.db.models.mirrorinfo,attributes:["id","name"]},{model:this.db.models.machine,attributes:["id","name"]}]};
  }
  async update(obj){
    var obj2=await this.preUpdate(obj);
    await this.model.update(obj2,{where:{id:obj2.id}});
    var user=await this.model.findOne({where:{id:obj2.id}});
    return user;
  }
}
module.exports=ContainerDao;
