import { request } from '@/plugins/http-fetch';

/**
 * UDMVolteIMS用户重载数据
 * @param neId 网元ID
 * @returns object
 */
export function resetUDMVolteIMS(neId: string) {
  return request({
    url: `/neData/udm/volte-ims/resetData/${neId}`,
    method: 'PUT',
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户列表
 * @param query 查询参数
 * @returns object
 */
export function listUDMVolteIMS(query: Record<string, any>) {
  return request({
    url: '/neData/udm/volte-ims/list',
    method: 'GET',
    params: query,
    timeout: 30_000,
  });
}

/**
 * UDMVolteIMS用户信息
 * @param neId 网元ID
 * @param imsi IMSI
 * @returns object
 */
export function getUDMVolteIMS(neId: string, imsi: string) {
  return request({
    url: `/neData/udm/volte-ims/${neId}/${imsi}`,
    method: 'GET',
  });
}

/**
 * UDMVolteIMS用户新增
 * @param data 签约对象
 * @returns object
 */
export function addUDMVolteIMS(data: Record<string, any>) {
  return request({
    url: `/neData/udm/volte-ims/${data.neId}`,
    method: 'POST',
    data: data,
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户批量新增
 * @param data 签约对象
 * @param num 数量
 * @returns object
 */
export function batchAddUDMVolteIMS(data: Record<string, any>, num: number) {
  return request({
    url: `/neData/udm/volte-ims/${data.neId}/${num}`,
    method: 'POST',
    data: data,
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户删除
 * @param data 签约对象
 * @returns object
 */
export function delUDMVolteIMS(neId: string, imsi: string) {
  return request({
    url: `/neData/udm/volte-ims/${neId}/${imsi}`,
    method: 'DELETE',
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户批量删除
 * @param neId 网元ID
 * @param imsi IMSI
 * @param num 数量
 * @returns object
 */
export function batchDelUDMVolteIMS(neId: string, imsi: string, num: number) {
  return request({
    url: `/neData/udm/volte-ims/${neId}/${imsi}/${num}`,
    method: 'DELETE',
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户导出
 * @param data 数据参数
 * @returns bolb
 */
export function exportUDMVolteIMS(data: Record<string, any>) {
  return request({
    url: '/neData/udm/volte-ims/export',
    method: 'GET',
    params: data,
    responseType: 'blob',
    timeout: 180_000,
  });
}

/**
 * UDMVolteIMS用户导入
 * @param data 表单数据对象
 * @returns object
 */
export function importUDMVolteIMS(data: Record<string, any>) {
  return request({
    url: `/neData/udm/volte-ims/import`,
    method: 'POST',
    data,
    timeout: 180_000,
  });
}
