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

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

/**
 *
 * @param params type true 个人  false 公共
 * @returns
 */
export const queryReportTemplateApi = (params: any) => {
  return post(`${PREFIX}report/queryReportTemplate`, params);
};

export const deleteReportTemplateApi = (params: any) => {
  return post(`${PREFIX}report/deleteReportTemplate`, params);
};

export const updateReportTemplateApi = (params: any) => {
  return upload(`${PREFIX}report/updateReportTemplate`, params);
};

export const queryReportTemplateVersionApi = (params: any) => {
  return get(`${PREFIX}report/queryReportTemplateVersion`, params);
};

/**
 * 根据uuid获取报告模版详情
 * @param params
 * @returns
 */
export const queryReportTemplateInfoApi = (params: any) => {
  return get(`${PREFIX}report/queryReportTemplateInfo`, params);
};

export const createReportTemplateApi = (params: any) => {
  return upload(`${PREFIX}report/createReportTemplate`, params);
};

/**
 * 发布报告模版
 * @param params
 * @returns
 */
export const releaseReportTemplateApi = (params: any) => {
  return post(`${PREFIX}report/releaseReportTemplate`, params);
};

/**
 * 先升版 再发布
 * @param params
 * @returns
 */
export const upgradeReportTemplateApi = (params: any) => {
  return upload(`${PREFIX}report/upgradeReportTemplate`, params);
};
