const system = require("../../../system");
const ServiceBase = require("../../svems.base");
var settings = require("../../../../config/settings");

class BusinessscopeService extends ServiceBase {
  constructor() {
    super();
  }

  async page(params) {
    return await this.callms("common", "businessscopePage", params);
  }

  async info(params) {
    return await this.callms("common", "businessscopeInfo", params);
  }

  async save(params) {
    return await this.callms("common", "businessscopeSave", params);
  }

  async del(params) {
    return await this.callms("common", "businessscopeDelete", params);
  }

  async byDomicile(params) {
    return await this.callms("common", "businessscopeByDomicileId", params);
  }

  async setDefaultBusinessScope(params) {
    let saas_id = params.saas_id;
    if (!params.saas_id) {
      return system.getResult(null, `saas_id不存在`);
    }
    return await this.callms("common", "saveDefaultBusinessScope", {saas_id: saas_id});
  }
}
module.exports = BusinessscopeService;
