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

/**
 * 查询IMS-CDR会话事件
 * @param query 查询参数
 * @returns object
 */
export function listIMSDataCDR(query: Record<string, any>) {
  return request({
    url: '/neData/ims/cdr/list',
    method: 'GET',
    params: query,
    timeout: 60_000,
  });
}

/**
 * IMS-CDR会话删除
 * @param id 信息ID
 * @returns object
 */
export function delIMSDataCDR(cdrIds: string | number) {
  return request({
    url: `/neData/ims/cdr/${cdrIds}`,
    method: 'DELETE',
    timeout: 60_000,
  });
}

/**
 * IMS-CDR会话列表导出
 * @param data 查询列表条件
 * @returns object
 */
export function exportIMSDataCDR(data: Record<string, any>) {
  return request({
    url: '/neData/ims/cdr/export',
    method: 'POST',
    data,
    responseType: 'blob',
    timeout: 60_000,
  });
}

/**
 * SMF-在线订阅用户数量
 * @param query 查询参数
 * @returns object
 */
export function listIMSSessionNum(neId: string) {
  return request({
    url: '/neData/ims/session/num',
    method: 'GET',
    params: { neId },
  });
}

/**
 * IMS-在线会话用户列表信息
 * @param query 查询参数 {neId, imsi, msisdn}
 * @returns objectv
 */
export function listIMSSessionList(query: Record<string, any>) {
  return request({
    url: '/neData/ims/session/list',
    method: 'GET',
    params: query,
  });
}
