import request from "@/request/index";

export function GetWeather() {
  return request({
      url: '/weather/GetTodayWeather',
      method: "post",
  })
}

export function GetBoatInfo(mmsi, type=null) {
  let prefix = ''
  if(type==='HSX') {
    prefix = 'http://172.16.58.3:8080/ghjgWebServiceTest'
  }
  return request({
      url: prefix + '/DigitalTwain/boat/GetBoatPanelInfo',
      method: "post",
      data: {
        mmsi,
        type
      },
  })
}

export function GetBoatInfoByEventCode(eventCode) {
  return request({
      url: 'http://172.16.58.3:8080/ghjgWebServiceTest/DigitalTwain/boat/GetBoatPanelInfo2',
      method: "post",
      data: {
        eventCode,
        type: 'HSX'
      },
  })
}

export function GetWaterLevel(startTime, endTime, deviceId='100768') {
  return request({
      url: 'http://10.83.68.108:8091/ghjgWebServiceTest/ghjg/waterLevelData/getWaterLevel',
      method: "post",
      data: {
        startTime,
        endTime,
        deviceId
      },
  })
}

export function GetTideHeight(startTime, endTime) {
  return request({
      url: 'http://10.83.68.108:8091/ghjgWebServiceTest/ghjg/waterLevelData/getTide',
      method: "post",
      data: {
        startTime,
        endTime
      },
  })
}