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

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

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

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

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

/**
 * SMF-在线订阅用户列表信息
 * @param query 查询参数
 * @returns object
 */
export function listSMFSubList(query: Record<string, any>) {
  return request({
    url: '/neData/smf/sub/list',
    method: 'get',
    params: query,
  });
}
