import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ProjectVO, ProjectForm, ProjectQuery } from '@/api/system/project/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listProject = (query?: ProjectQuery): AxiosPromise<ProjectVO[]> => {
  return request({
    url: '/system/project/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param projectId
 */
export const getProject = (projectId: string | number): AxiosPromise<ProjectVO> => {
  return request({
    url: '/system/project/' + projectId,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addProject = (data: ProjectForm) => {
  return request({
    url: '/system/project',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateProject = (data: ProjectForm) => {
  return request({
    url: '/system/project',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param projectId
 */
export const delProject = (projectId: string | number | Array<string | number>) => {
  return request({
    url: '/system/project/' + projectId,
    method: 'delete'
  });
};

// 应用列表
export function appList(userId) {
  return request({
    url: '/deepseek/api/role/list',
    method: 'get'
  })
}

