/*
 * @Author: dengchao 754083046@qq.com
 * @Date: 2022-06-28 09:41:26
 * @LastEditors: dengchao 754083046@qq.com
 * @LastEditTime: 2022-08-18 16:40:24
 * @FilePath: \maintenance\src\services\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from '../utils/request';

const CITY_SERVICE = '/Cityinterface/rest/services';
// export const CITY_SERVICE = '/Publish/GateWay/CityServer';
const PUBLISH_SERVICE = '/PandaOMS/OMS';
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
const WebSERVICE = '/PandaConfiguration/Raw';
const CoreSERVICE = '/PandaCore/GCK';
const PANDA_GIS = '/PandaGIS/MapServer';
const PandaCore = '/PandaCore/GateWay';
const get = async (url, params, options = {}) =>
  request({
    url,
    method: 'get',
    params,
    ...options,
  });

const post = async (url, params, options = {}) =>
  request({
    url,
    params,
    method: 'post',
    ...options,
  });

const postForm = async (url, params = {}, options = {}) => {
  const formData = new FormData();
  Object.keys(params).forEach(k => formData.append(k.trim(), params[k]));
  return post(url, formData, options);
};

export {
  get,
  post,
  postForm,
  CITY_SERVICE,
  PUBLISH_SERVICE,
  WebSERVICE,
  CoreSERVICE,
  PANDA_GIS,
  PandaCore,
};
