import { defHttp } from '@/utils/http/axios';

enum Api {
  // 招标信息
  LoadBiddingInfo = '/api/BiddingInfo/LoadBiddingInfo',
  AddBiddingInfo = '/api/BiddingInfo/AddBiddingInfo',
  EditBiddingInfo = '/api/BiddingInfo/EditBiddingInfo',
  DeleteBiddingInfo = '/api/BiddingInfo/DeleteBiddingInfo',
}
const getRequestBiddingListUrl = (userType) => {
  switch(userType){
    case 1:
      // 招标代理
      return '/api/BiddingInfo/LoadAgencyBiddingInfo'
    case 2:
      // 供应商
      return '/api/BiddingInfo/LoadCompanyBiddingInfo'
    case 3:
      // 甲方公司
      return '/api/BiddingInfo/LoadBiddingInfo'
  }
}
// 招标信息
export function LoadBiddingInfo(params, userType) {
  return defHttp.get({
    url: getRequestBiddingListUrl(userType),
    params,
  });
}
export function AddBiddingInfo(params) {
  return defHttp.post({
    url: Api.AddBiddingInfo,
    params,
  });
}
export function EditBiddingInfo(params) {
  return defHttp.post({
    url: Api.EditBiddingInfo,
    params,
  });
}
export function DeleteBiddingInfo(id) {
  return defHttp.post({
    url: `${Api.DeleteBiddingInfo}?id=${id}`,
  });
}