import request from "@/utils/request";

// 景点相关的请求地址
enum API {
  // 获取单个景点信息 接口地址
  INFO_URL = "/scenicSpotOverview/info/name/",
  // 获取单个景点人数相关信息 接口地址
  PEOPLENUM_URL = "tourqueryMaxTour.action",
  // 获取今日旅游人次数据 接口地址
  ALLNUMTODAY_URL = "/tourqueryTodayT.action",
  // 获取近8日旅游人次数据 接口地址
  ALLNUMBYDAY_URL = "/tourqueryEgihtTour.action",
  // 获取近8月旅游人次数据 接口地址
  ALLNUMBYMONTH_URL = "/tourqueryEgihtMonthTour.action",
  // 获取近8年旅游人次数据 接口地址
  ALLNUMBYYEAR_URL = "/tourqueryEgihtYearTour.action",

  // 获取游客来源地统计数据 接口地址
  SOURCERANK_URL = "/tourqueryTourProvinceT.action",
  // 获取游客人数昨日12小时趋势 接口地址
  NUMBYHOUROFYESTERDAY_URL = "/tourqueryYesHourHistory.action",
  // 获取游客人数今日12小时趋势 接口地址
  NUMBYHOUROFTODAY_URL = "/tourqueryTodayHourHistory.action",
  // 获取今日游客人流排行榜数据 接口地址
  TOURNUMBYDAY_URL = "/tourNumAndDay.action",
  // 获取 本月 今年 游客人流排行榜数据 接口地址
  TOURNUMBYMONTH_URL = "/tourYearAndMonth.action",
  // 获取游客年龄分布情况数据 接口地址
  AGE_URL = "/tourAgeT.action",
  // 获取游客性别分布情况数据 接口地址
  GENDER_URL = "/tourGenderT.action",

  // 获取所有景区实时人流数据 接口地址
  ALLPEOPLENUMBYREAL_URL = "/tourqueryTourDay.action",
  // 获取所有景区累计人流数据 接口地址
  ALLPEOPLENUMBYADD_URL = "/tourqueryTourT.action",
  // 获取各个景点实时人流数据 接口地址
  TOURREALNUMBYPLACE_URL = "/tourqueryPlaceT.action",
}

//获取单个景点信息
export const reqGetScenicInfo = (data: string) =>
  request({
    method: "get",
    url: API.INFO_URL + data,
  });

// 获取单个景点人数相关信息
export const reqGetScenicInfoByNum = (data: any) =>
  request<any, any>({
    method: "get",
    url: API.PEOPLENUM_URL,
    params: data,
    headers: {
      type: "bigData2",
    },
  });

// 获取今日旅游人次数据
export const reqGetAllNumToday = () =>
  request({
    method: "get",
    url: API.ALLNUMTODAY_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取近8日旅游人次数据
export const reqGetAllNumByDay = () =>
  request({
    method: "get",
    url: API.ALLNUMBYDAY_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取近8月旅游人次数据
export const reqGetAllNumByMonth = () =>
  request({
    method: "get",
    url: API.ALLNUMBYMONTH_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取近8年旅游人次数据
export const reqGetAllNumByYear = () =>
  request({
    method: "get",
    url: API.ALLNUMBYYEAR_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取游客来源地统计数据
export const reqGetSourceRankData = () =>
  request({
    method: "get",
    url: API.SOURCERANK_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取游客人数昨日12小时趋势
export const reqGetHourByYesterday = () =>
  request({
    method: "get",
    url: API.NUMBYHOUROFYESTERDAY_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取游客人数今日12小时趋势
export const reqGetHourByToday = () =>
  request({
    method: "get",
    url: API.NUMBYHOUROFTODAY_URL,
    headers: {
      type: "bigData",
    },
  });

//  获取今日游客人流排行榜数据
export const reqGetTourByDay = () =>
  request({
    method: "post",
    url: API.TOURNUMBYDAY_URL,
    headers: {
      type: "bigData",
    },
  });

//   获取 本月 今年 游客人流排行榜数据
export const reqGetTourByMonthOrYear = (data: any) =>
  request({
    method: "post",
    url: API.TOURNUMBYMONTH_URL,
    params: data,
    headers: {
      type: "bigData",
    },
  });

// 获取游客年龄分布情况数据
export const reqGetAgeData = () =>
  request({
    method: "post",
    url: API.AGE_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取游客性别分布情况数据
export const reqGetGenderData = () =>
  request({
    method: "post",
    url: API.GENDER_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取所有景区实时人流数据
export const reqGetAllNumByReal = () =>
  request({
    method: "post",
    url: API.ALLPEOPLENUMBYREAL_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取所有景区累计人流数据
export const reqGetAllNumByAdd = () =>
  request({
    method: "post",
    url: API.ALLPEOPLENUMBYADD_URL,
    headers: {
      type: "bigData",
    },
  });

// 获取各个景点实时人流数据
export const reqGetNumByPlace = () =>
  request({
    method: "post",
    url: API.TOURREALNUMBYPLACE_URL,
    headers: {
      type: "bigData",
    },
  });
