const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class ImginfoService extends ServiceBase {
  constructor() {
    super("configmag", ServiceBase.getDaoName(ImginfoService));
  }
  async getImgList (pobj) {
    let res = await this.dao.findAndCountAll(pobj);
    return system.getResultSuccess(res);
  }
  async createImginfo (pobj) {
    let code = await this.getBusUid("img");
    pobj.imginfo.code = code;
    if (pobj.imginfo.company_id === undefined) {
      pobj.imginfo.company_id = 10;
    } 
    let res = await this.dao.create(pobj.imginfo);
    return system.getResultSuccess(res);
  }
  async create(pobj){
    var code = await this.getBusUid("img");
    pobj.code = code;
    return this.dao.create(pobj);
  }
}
module.exports = ImginfoService;