import request from '@/config/axios'

export interface H5PagesVO {
  id: number
  country: string
  language: string
  name: string
  logo: string
  favicon: string
  title: string
  description: string
  keywords: string
  themeColor: string
  font: string
  cssUrl: string
  jsUrl: string
}

// 查询H5配置列表
export const getH5PagesPage = async (params) => {
  return await request.get({ url: `/member/H5-pages/page`, params })
}

// 查询H5配置详情
export const getH5Pages = async (id: number) => {
  return await request.get({ url: `/member/H5-pages/get` })
}

// 新增H5配置
export const createH5Pages = async (data: H5PagesVO) => {
  return await request.post({ url: `/member/H5-pages/create`, data })
}

// 修改H5配置
export const updateH5Pages = async (data: H5PagesVO) => {
  return await request.put({ url: `/member/H5-pages/update`, data })
}

// 删除H5配置
export const deleteH5Pages = async (id: number) => {
  return await request.delete({ url: `/member/H5-pages/delete?id=` + id })
}

// 导出H5配置 Excel
export const exportH5Pages = async (params) => {
  return await request.download({ url: `/member/H5-pages/export-excel`, params })
}
