import Request from '@/utils/request/request-util';

/**
 * low_code 业务api
 *
 */
export class BusinessApi {
  /**
   * 分页
   * @param {*} params
   * @returns
   */
  static findPage(params) {
    return Request.get('/business/page/v2', params);
  }

  /**
   * 指定业务的数据统计
   * @param {*} params
   * @returns
   */
  static getBusinessStatCount(params) {
    return Request.getAndLoadData('/business/getBusinessStatCount', params);
  }

  /**
   * 添加
   * @param {*} params
   * @returns
   */
  static add(params) {
    return Request.post('/business/add', params);
  }
  /**
   * 编辑
   * @param {*} params
   * @returns
   */
  static edit(params) {
    return Request.post('/business/edit', params);
  }
  /**
   * 删除单个
   * @param {*} params
   * @returns
   */
  static delete(params) {
    return Request.post('/business/delete', params);
  }
  /**
   * 删除批量
   * @param {*} params
   * @returns
   */
  static batchDelete(params) {
    return Request.post('/business/batchDelete', params);
  }
  /**
   * 详情
   * @param {*} params
   * @returns
   */
  static detail(params) {
    return Request.getAndLoadData('/business/detail', params);
  }
  /**
   * 列表
   * @param {*} params
   * @returns
   */
  static list(params) {
    return Request.getAndLoadData('/business/list', params);
  }

  /**
   * 汇总导出业务的所有数据库表
   * @param {*} params
   * @returns
   */
  static summaryCreateTableSql(params) {
    return Request.getAndLoadData('/metaSqlExport/summaryCreateTableSql', params);
  }
}
