import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { McpVO, McpForm, McpQuery } from '@/api/system/mcp/types';

/**
 * 查询模型上下文协议列表
 * @param query
 * @returns {*}
 */

export const listMcp = (query?: McpQuery): AxiosPromise<McpVO[]> => {
  return request({
    url: '/system/mcp/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询模型上下文协议详细
 * @param id
 */
export const getMcp = (id: string | number): AxiosPromise<McpVO> => {
  return request({
    url: '/system/mcp/' + id,
    method: 'get'
  });
};

/**
 * 新增模型上下文协议
 * @param data
 */
export const addMcp = (data: McpForm) => {
  return request({
    url: '/system/mcp',
    method: 'post',
    data: data
  });
};

/**
 * 修改模型上下文协议
 * @param data
 */
export const updateMcp = (data: McpForm) => {
  return request({
    url: '/system/mcp',
    method: 'put',
    data: data
  });
};

/**
 * 删除模型上下文协议
 * @param id
 */
export const delMcp = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/mcp/' + id,
    method: 'delete'
  });
};
