import apiRequest from '@/network/http/apiRequest'

/**
 * 获取Biz列表
 * @param data
 * @returns
 */
export function getBizByList(data: any) {
  return apiRequest({
    url: '/biz',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取Biz
 * @param bizId
 * @returns
 */
export function getBizById(bizId: number) {
  return apiRequest({
    url: `/biz/${bizId}`,
    method: 'GET',
  })
}

/**
 * 获取模型树视图
 * @returns
 */
export function getBizData() {
  return apiRequest({
    url: '/biz/data',
    method: 'GET',
  })
}

/**
 * 添加Model
 * @param data
 * @returns
 */
export function createBiz(data: any) {
  return apiRequest({
    url: '/biz/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新Model
 * @param data
 * @returns
 */
export function updateBiz(data: any) {
  return apiRequest({
    url: '/biz/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除Biz
 * @para bizId
 * @returns
 */
export function deleteBizById(bizId: number) {
  return apiRequest({
    url: `/biz/${bizId}`,
    method: 'DELETE',
  })
}
