import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AiPlatformVO, AiPlatformForm, AiPlatformQuery } from '@/api/ai/base/aiPlatform/types';

/**
 * 查询AI平台列表
 * @param query
 * @returns {*}
 */

export const listAiPlatform = (query?: AiPlatformQuery): AxiosPromise<AiPlatformVO[]> => {
  return request({
    url: '/ai/base/aiPlatform/list',
    method: 'get',
    params: query
  });
};


/**
 * 查询AI基础模型列表
 * @param query
 * @returns {*}
 */

export const listAiBaseModels = (query?: AiPlatformQuery): AxiosPromise<AiPlatformVO[]> => {
  return request({
    url: '/ai/base/aiPlatform/getAiBaseModelList',
    method: 'get',
    params: query
  });
};






/**
 * 查询AI平台详细
 * @param platformId
 */
export const getAiPlatform = (platformId: string | number): AxiosPromise<AiPlatformVO> => {
  return request({
    url: '/ai/base/aiPlatform/' + platformId,
    method: 'get'
  });
};

/**
 * 新增AI平台
 * @param data
 */
export const addAiPlatform = (data: AiPlatformForm) => {
  return request({
    url: '/ai/base/aiPlatform',
    method: 'post',
    data: data
  });
};

/**
 * 修改AI平台
 * @param data
 */
export const updateAiPlatform = (data: AiPlatformForm) => {
  return request({
    url: '/ai/base/aiPlatform',
    method: 'put',
    data: data
  });
};

/**
 * 删除AI平台
 * @param platformId
 */
export const delAiPlatform = (platformId: string | number | Array<string | number>) => {
  return request({
    url: '/ai/base/aiPlatform/' + platformId,
    method: 'delete'
  });
};


/**
 * 下拉框查询AI平台列表
 * @param query
 * @returns {*}
 */
export function getAiPlatformList (query) {
    return request({
        url: '/ai/base/aiPlatform/getAiPlatformList',
        method: 'get',
        params: query
    });
};
