var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctlms.base");

class BusinessscopeCtl extends CtlBase {
  constructor() {
    super();
    //this.appS=system.getObject("service.appSve");
    this.businessscopeSve = system.getObject("service.common.businessscopeSve");
  }

  async page(pobj, pobj2, req) {
    try {
      return await this.businessscopeSve.page(pobj);
    } catch (e) {
      console.log(e);
      return system.getResultFail(500, "接口错误");
    }
  }

  /**
   * fn:获取说有经营范围（没有分页）
   * @returns {Promise<*>}
   */
  async listbusinessscopeAll(pobj, pobj2, req){
    return await this.businessscopeSve.listbusinessscopeAll(pobj);
  }

  async info(pobj, pobj2, req) {
    try {
      return await this.businessscopeSve.info(pobj);
    } catch (e) {
      console.log(e);
      return system.getResultFail(500, "接口错误");
    }
  }

  async save(pobj, pobj2, req) {
    try {
      return await this.businessscopeSve.save(pobj);
    } catch (e) {
      console.log(e);
      return system.getResultFail(500, "接口错误");
    }
  }

  async del(pobj, pobj2, req) {
    try {
      return await this.businessscopeSve.del(pobj);
    } catch (e) {
      console.log(e);
      return system.getResultFail(500, "接口错误");
    }
  }

  async byDomicile(pobj, pobj2, req) {
    try {
      return await this.businessscopeSve.byDomicile(pobj);
    } catch (e) {
      console.log(e);
      return system.getResultFail(500, "接口错误");
    }
  }
}
module.exports = BusinessscopeCtl;