import { get, post } from '@/api/request';

const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_DATA;

/**
 * 查询用户配额
 * @param params
 * @returns
 */
export const listUserQuotaApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/listUserQuota`, params);
};

/**
 * 新增用户配额
 * @param params
 * @returns
 */
export const addUserQuotaApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/addUserQuota`, params);
};

/**
 * 批量修改用户配额
 * @param params
 * @returns
 */
export const batchUpdateUserQuotaApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/batchUpdateUserQuota`, params);
};

/**
 * 存储系统大文件筛选
 * @param params
 * @returns
 */
export const listBigFileApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/listBigFile`, params);
};

/**
 * 批量删除大文件
 * @param params
 * @returns
 */
export const batchDeleteBigFileApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/batchDeleteBigFile`, params);
};

/**
 * 根据nodeId(项目nideId)获取指定查询类型文件空间占用
 * @param params
 * @returns
 */
export const getNodeSizeByNodeTypeApi = (params: any) => {
  return get(`${PREFIX}dataStorageAnalysis/getNodeSizeByNodeType`, params);
};
export const getNodeSizeByDisciplineApi = (params: any) => {
  return post(`${PREFIX}dataStorageAnalysis/getNodeSizeByDiscipline`, params);
};

/**
 * 根据用户组和用户id获取用户的空间占用
 * @param params
 * @returns
 */
export const getDirectorySizeByUserIdApi = (params: any) => {
  return get(`${PREFIX}dataStorageAnalysis/getDirectorySizeByUserId`, params);
};
