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

/**
 * 获取DBType列表
 * @param data
 * @returns
 */
export function getDBTypeByList(data: any) {
  return apiRequest({
    url: '/daas/db/type',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取DBType
 * @param dbTypeId
 * @returns
 */
export function getDBTypeById(dbTypeId: number) {
  return apiRequest({
    url: `/daas/db/type/${dbTypeId}`,
    method: 'GET',
  })
}

/**
 * 添加DBType
 * @param data
 * @returns
 */
export function createDBType(data: any) {
  return apiRequest({
    url: '/daas/db/type/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新DBType
 * @param data
 * @returns
 */
export function updateDBType(data: any) {
  return apiRequest({
    url: '/daas/db/type/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除DBType
 * @param dbTypeId
 * @returns
 */
export function deleteDBTypeById(dbTypeId: number) {
  return apiRequest({
    url: `/daas/db/type/${dbTypeId}`,
    method: 'DELETE',
  })
}
