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

/**
 * 查询网元主机命令列表
 * @param query 查询参数
 * @returns object
 */
export function listNeHostCmd(query: Record<string, any>) {
  return request({
    url: '/ne/hostCmd/list',
    method: 'get',
    params: query,
  });
}

/**
 * 查询网元主机命令详细
 * @param cmdId 网元主机命令ID
 * @returns object
 */
export function getNeHostCmd(cmdId: string | number) {
  return request({
    url: `/ne/hostCmd/${cmdId}`,
    method: 'get',
  });
}

/**
 * 新增网元主机命令
 * @param data 网元主机命令对象
 * @returns object
 */
export function addNeHostCmd(data: Record<string, any>) {
  return request({
    url: '/ne/hostCmd',
    method: 'post',
    data: data,
  });
}

/**
 * 修改网元主机命令
 * @param data 网元主机命令对象
 * @returns object
 */
export function updateNeHostCmd(data: Record<string, any>) {
  return request({
    url: '/ne/hostCmd',
    method: 'put',
    data: data,
  });
}

/**
 * 删除网元主机命令
 * @param cmdId 网元主机命令ID
 * @returns object
 */
export function delNeHostCmd(cmdId: string | number) {
  return request({
    url: `/ne/hostCmd/${cmdId}`,
    method: 'delete',
  });
}
