import { ResPage, StoreUser } from "@/api/interface/index";
import { PORT_NONE } from "@/api/config/servicePort";
import http from "@/api";

// 获取营业执照
export const getBusinessLicense = params => {
  return http.get(PORT_NONE + `/license/querybusinessLicenseList`, params);
};

// 获取食品经营许可证
export const getFoodBusinessLicense = params => {
  return http.get(PORT_NONE + `/license/queryFoodLicenceList`, params);
};

// 获取合同图片列表
export const getContractImages = params => {
  return http.get(PORT_NONE + `/license/queryContractList`, params);
};

// 获取合同变更记录
export const queryContractByStatusList = params => {
  return http.get(PORT_NONE + `/license/queryContractByStatusList`, params);
};

// 获取食品经营许可证变更记录
export const getChangeRecords = params => {
  return http.get(PORT_NONE + `/license/queryLicenceByStatusList`, params);
};
// 获取合同审核状态
export const getStoreContractStatus = params => {
  return http.get(PORT_NONE + `/license/getStoreContractStatus`, params);
};

// 获取食品经营许可证审核状态
export const getStoreFoodLicenceStatus = params => {
  return http.get(PORT_NONE + `/license/getStoreFoodLicenceStatus`, params);
};

// 提交食品经营许可证审核
export const submitFoodLicenseReview = params => {
  return http.post(PORT_NONE + `/license/uploadfoodLicence`, params);
};

// 提交合同审核
export const submitContractReview = params => {
  return http.post(PORT_NONE + `/license/uploadRenewalContract`, params);
};

// 上传合同图片
export const uploadContractImage = (formData: FormData, onProgress?: (progress: number) => void) => {
  return http.upload("/file/uploadMore", formData, onProgress, import.meta.env.VITE_API_URL as string);
};
