import axios from '@/libs/api.request'

export const getRouterReq = (access) => {
  return axios.request({
    url: 'get_router',
    param,
    method: 'get'
  })  
}

/* 套餐模块 */

// admin.php?s=Admin.Mall_Product.GetProductList 获取套餐列表
export const GetProductList = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.GetProductList',
    data
  })
}

export const GetPayProductListForMore = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.GetPayProductListForMore',
    data
  })
}

// admin.php?s=Admin.Mall_Product.DeleteProduct 删除套餐
export const DeleteProduct = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.DeleteProduct',
    data
  })
}

// admin.php?s=Admin.Mall_Product.CreateProduct 添加套餐
export const CreateProduct = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.CreateProduct',
    data
  })
}

// admin.php?s=Admin.Mall_Product.GetProduct 获取套餐详情
export const GetProduct = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.GetProduct',
    data
  })
}

// admin.php?s=Admin.Mall_Product.UpdateProduct 修改套餐
export const UpdateProduct = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.UpdateProduct',
    data
  })
}

// admin.php?s=Admin.Rights.ListAllRightsService 获取全部接口
export const ListAllRightsService = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Rights.ListAllRightsService',
    data
  })
}

// admin.php?s=Admin.Mall_Product.GetExpireTimeList 获取商品套餐的有效时间列表
export const GetExpireTimeList = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Product.GetExpireTimeList',
    data
  })
}

/* 订单管理 */

// admin.php?s=Admin.Mall_Order.GetOrderList 获取商品套餐的有效时间列表
export const GetOrderList = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Order.GetOrderList',
    data
  })
}

// admin.php?s=Admin.Mall_Order.GetOrder 获取商品套餐的有效时间列表
export const GetOrder = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Order.GetOrder',
    data
  })
}

// admin.php?s=Admin.Mall_Order.UpdateProduct 获取商品套餐的有效时间列表
export const UpdateOrder = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Order.UpdateOrder',
    data
  })
}

/* 套餐管理 */
// Admin.Mall_Flow.AddNewFlow  套餐发放
export const AddNewFlow = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Flow.AddNewFlow',
    data
  })
}

// Admin.Mall_Flow.AddNewFlow  删除套餐
export const DeleteFlow = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Flow.DeleteFlow',
    data
  })
}

// Admin.Mall_Flow.GetFlow  获取套餐详情
export const GetFlow = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Flow.GetFlow',
    data
  })
}

// Admin.Mall_Flow.AddNewFlow  获取套餐列表
export const GetFlowList = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Flow.GetFlowList',
    data
  })
}

// Admin.Mall_Flow.UpdateFlow  更新修改套餐
export const UpdateFlow = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Flow.UpdateFlow',
    data
  })
}

/* 配置管理 */
// Admin.Mall_Config.GetPayConfig  获取支付配置
export const GetPayConfig = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Config.GetPayConfig',
    data
  })
}
// Admin.Mall_Config.UpdatePayConfig  更新支付配置
export const UpdatePayConfig = (data) => {
  return axios.request({
    method: 'post',
    url: 'api/admin.php?s=Admin.Mall_Config.UpdatePayConfig',
    data
  })
}
