/*
 * @Description:
 * @Author: leizhe
 * @Date: 2022-01-13 17:26:14
 * @LastEditTime: 2023-03-01 09:29:38
 * @LastEditors: dengchao 754083046@qq.com
 */
import { get, post, PUBLISH_SERVICE, CITY_SERVICE, PandaCore } from '@/services/index';
// 生成站点编号
export const CreateSiteCode = param => get(`${PUBLISH_SERVICE}/HostManager/CreateSiteCode`, param);
// ETL配置
// 保存数据中台地址
export const SaveETLConfig = param => get(`${PUBLISH_SERVICE}/HostManager/SaveETLConfig`, param);
// 获取数据中台地址
export const GetETLConfig = param => get(`${PUBLISH_SERVICE}/HostManager/GetETLConfig`, param);
// 基础信息展示
export const GetDataBaseConfig = param =>
  get(`${PUBLISH_SERVICE}/DBManager/GetDataBaseConfig`, param);
export const GetBasicInfo = param => get(`${PUBLISH_SERVICE}/HostManager/GetBasicInfo`, param);
// 物联平台接口
export const GetIOTPlatformVersion = param =>
  get(`${PUBLISH_SERVICE}/HostManager/GetIOTPlatformVersion`, param);
export const GetTCPConfigInfo = param =>
  get(`${PUBLISH_SERVICE}/HostManager/GetTCPConfigInfo`, param);
export const PingIOTPlatform = param =>
  get(`${PUBLISH_SERVICE}/HostManager/PingIOTPlatform`, param);

// 判断是否需要升级物联网统一接入平台
export const IsIotUpgrade = param => get(`${PUBLISH_SERVICE}/HostManager/IsIotUpgrade`, param);
export const GetIotVersion = param => get(`${PUBLISH_SERVICE}/HostManager/GetIotVersion`, param);
// 判断数据库服务是否已添加
export const CheckIsServiceAdd = param =>
  get(`${PUBLISH_SERVICE}/HostManager/CheckIsServiceAdd`, param);
// 查询当前数据库服务状态信息
export const GetServiceInfo = param => get(`${PUBLISH_SERVICE}/HostManager/GetServiceInfo`, param);
// 添加数据库
export const AddDB = param => get(`${PUBLISH_SERVICE}/HostManager/AddDBV2`, param);
// 停止数据库服务
export const DepositServiceDisable = param =>
  get(`${PUBLISH_SERVICE}/HostManager/DepositServiceDisable`, param);
// 启用数据库服务
export const DepositServiceEnable = param =>
  get(`${PUBLISH_SERVICE}/HostManager/DepositServiceEnable`, param);

// 升级物联网统一接入平台
export const IotUpgrade = param => get(`${PUBLISH_SERVICE}/HostManager/IotUpgrade`, param);
export const SaveTcpAddress = param => get(`${PUBLISH_SERVICE}/HostManager/SaveTcpAddress`, param);
// 健康检查接口
export const HealthCheck = param => get(`/Iot/api/HealthCheck`, param);
// // 判断数据库服务是否已添加
// export const CheckIsServiceAdd = param => post(`/Iot/api/DB/CheckIsServiceAdd`, param);
// // 查询当前数据库服务状态信息
// export const GetServiceInfo = param => post(`/Iot/api/DB/GetServiceInfo`, param);
// // 添加数据库
// export const AddDB = param => post(`/Iot/api/DB/AddDBV2`, param);
// // 停止数据库服务
// export const DepositServiceDisable = param => post(`/Iot/api/DB/DepositServiceDisable`, param);
// // 启用数据库服务
// export const DepositServiceEnable = param => post(`/Iot/api/DB/DepositServiceEnable`, param);

// 消息平台接口
export const GetMessageConfigInfo = param =>
  get(`${PUBLISH_SERVICE}/HostManager/GetMessageConfigInfo`, param);
export const ConnectMessPlatform = param =>
  post(`${PUBLISH_SERVICE}/HostManager/ConnectMessagePlatform`, param);
export const SaveSystemInfo = param => get(`${PUBLISH_SERVICE}/HostManager/SaveSystemInfo`, param);

// 代理服务器接口
export const GetNginxConfigInfo = param =>
  get(`${PUBLISH_SERVICE}/HostManager/GetNginxConfigInfo`, param);
export const InsertNginxConfig = param =>
  get(`${PUBLISH_SERVICE}/HostManager/InsertNginxConfig`, param);
export const StartNginx = param => get(`${PUBLISH_SERVICE}/HostManager/StartNginx`, param);
export const StopNginx = param => get(`${PUBLISH_SERVICE}/HostManager/StopNginx`, param);
export const NginxLog = param => get(`${PUBLISH_SERVICE}/HostManager/NginxLog`, param);
export const NginxCache = param => get(`${PUBLISH_SERVICE}/HostManager/NginxCache`, param);
export const ReloadNginx = param => get(`${PUBLISH_SERVICE}/HostManager/ReloadNginx`, param);
// 获取网关配置
export const GetGateWay = param => get(`${PUBLISH_SERVICE}/HostManager/GetGateWay`, param);
export const UpdateGeteWay = param => get(`${PUBLISH_SERVICE}/HostManager/UpdateGeteWay`, param);
// 网关配置
// export const GetReRoutesFirst = param => get(`/OcelotSettings/GetReRoutes`, param);

export const GetWayHealthCheck = param =>
  get(`/PandaCore/GateWay/OcelotSettings/HealthCheck`, param);
export const GetReRoutes = param => get(`/PandaCore/GateWay/OcelotSettings/GetReRoutes`, param);
export const SaveRoutes = param => post(`/PandaCore/GateWay/OcelotSettings/SaveRoutes`, param);
export const DelRoutes = param => get(`/PandaCore/GateWay/OcelotSettings/DelRoutes`, param);
export const DelRouteByUpUrl = param =>
  get(`/PandaCore/GateWay/OcelotSettings/DelRouteByUpUrl`, param);

// 代理服务老接口
export const GetNginxConfigInfoOLD = param =>
  get(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/GetNginxConfigInfo`, param);
export const InsertNginxConfigOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/InsertNginxConfig`, param);
export const StartNginxOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/StartNginx`, param);
export const StopNginxOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/StopNginx`, param);
export const NginxLogOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/NginxLog`, param);
export const NginxCacheOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/NginxCache`, param);
export const ReloadNginxOLD = param =>
  post(`${CITY_SERVICE}/MessagePlatform.svc/MessageManage/ReloadNginx`, param);
