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

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

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

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

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

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