import request from '@/utils/request';

/**
 * 咨询机构合作台账 查询项目列表 以及 查询参数
 * @param {object} params 
 * @returns 
 */
export const getConsultingOrgProjectListWithSearchApi = (params) => request({
  url: "/advisory/body/getProjectList",
  method: "get",
  params
});

/**
 * 咨询机构合作台账 查询企业列表 以及 查询参数
 * @param {object} params 
 * @returns 
 */
export const getConsultingOrgEenterpriseListWithSearchApi = (params) => request({
  url: "/advisory/body/getAdvisoryBodyList",
  method: "get",
  params
});

/**
 * 咨询机构合作台账 查询企业列表 以及 查询参数
 * @param {object} params 
 * @returns 
 */
export const getConsultingOrgEenterpriseDetailWithSearchApi = (params) => request({
  url: "/advisory/body/getCooperateProjectDetailList",
  method: "get",
  params
});

/**
 * 咨询机构项目列表 项目跳转详情获取
 * @param {*} params 
 * @returns 
 */
export const getConsultingOrgProjectDetailApi = (params) => request({
  url: "/advisory/body/getProjectDetail",
  method: "get",
  params
});

/**
 * 查询咨询机构 
 * @param {*} advisoryBodyName 
 * @returns 
 */
export const searchConsultingApi = (advisoryBodyName) => request({
  url: "/advisory/body/checkAdvisoryBodyExist",
  method: "get",
  params: {
    advisoryBodyName
  }
});

/**
 * 更新咨询机构结算信息
 * @param {*} data 
 * @returns 
 */
export const updateConsultingDetailApi = (data) => request({
  url: "/advisory/body/editAdvisoryBody",
  method: "post",
  data
});

/**
 * 获取自定义表单
 * @returns 
 */
export const getCustomFormDetailApi = () => request({
  url: "/advisory/body/getCustomFormTemplate",
  method: "get",
  params: {}
});

/**
 * 新增自定义表单
 * @param {*} data 
 * @returns 
 */
export const addCustomFormDataApi = (data) => request({
  url: "/advisory/body/editCustomFormTemplate",
  method: "post",
  data
});

/**
 * 获取自定义表单数据
 * @param {*} projectKey 
 * @returns 
 */
export const getCustomFormDataByProjectKeyApi = (projectKey) => request({
  url: `/advisory/body/getCustomFormDataByProjectKey/${projectKey}`,
  method: "get",
  params: {}
});

/**
 * 新增 更新 自定义表单数据
 * @param {*} data 
 * @returns 
 */
export const updateCustomFormData = (data) => request({
  url: "/advisory/body/editCustomFormData",
  method: "post",
  data
});

/**
 *  oss文件上传地址
 * @param {*} data 
 * @returns 
 */
export const uploadFileToOssApi = (data) => request({
  url: "/system/oss/upload",
  method: "post",
  data
});

/**
 * 根据ossId 删除资源
 * @param {*} ossId 
 * @returns 
 */
export const removeFileFromOssApi = (ossId) => request({
  url: `/system/oss/${ossId}`,
  method: "delete",
  params: {}
});

/**
 * 获取项目承接类型下拉框
 * @returns 
 */
export const getProjectUndertakingTypesApi = () => request({
  url: "/advisory/body/getIsInvestProject",
  method: "get",
  params: {}
});
