import request from '@/utils/request'

/**
 * 轮播图列表
 */
export function getBannerList(query) {
  return request({
    url: '/home/page/banner/list',
    method: 'get',
    params: query
  })
}
/**
 * 轮播图上下架
 */
export function getBannerStatus(id) {
  return request({
    url: '/home/page/check/banner/status/' + id,
    method: 'get'
  })
}
/**
 * 轮播图排序
 */
export function getBannerSort(id, sort) {
  return request({
    url: `/home/page/banner/${id}/${sort}`,
    method: 'get'
  })
}
/**
 * 轮播图保存
 */
export function savePageBanner(params) {
  return request({
    url: '/home/page/save/banner',
    method: 'post',
    data: params
  })
}
/**
 * 轮播图删除
 */
export function delPageBanner(id) {
  return request({
    url: '/home/page/del/banner/' + id,
    method: 'get'
  })
}
/**
 * 轮播图详情
 */
export function formPageBanner(id) {
  return request({
    url: '/home/page/banner/form/' + id,
    method: 'get'
  })
}

/**
 * 主菜单列表
 */
export function getMenuList(query) {
  return request({
    url: '/home/page/menu/list',
    method: 'get',
    params: query
  })
}
/**
 * 主菜单上下线
 */
export function getMenuStatus(id) {
  return request({
    url: '/home/page/check/menu/status/' + id,
    method: 'get'
  })
}
/**
 * 主菜单排序
 */
export function getMenuSort(id, sort) {
  return request({
    url: `/home/page/menu/${id}/${sort}`,
    method: 'get'
  })
}
/**
 * 主菜单保存
 */
export function saveMenu(params) {
  return request({
    url: '/home/page/save/menu',
    method: 'post',
    data: params
  })
}
/**
 * 主菜单删除
 */
export function delMenu(id) {
  return request({
    url: '/home/page/del/menu/' + id,
    method: 'get'
  })
}
/**
 * 主菜单详情
 */
export function formMenu(id) {
  return request({
    url: '/home/page/menu/form/' + id,
    method: 'get'
  })
}

/**
 * 专题列表
 */
export function getThemeList(query) {
  return request({
    url: '/home/page/theme/list',
    method: 'get',
    params: query
  })
}
/**
 * 专题上下线
 */
export function getThemeStatus(id) {
  return request({
    url: '/home/page/check/theme/status/' + id,
    method: 'get'
  })
}
/**
 * 专题存
 */
export function saveTheme(params) {
  return request({
    url: '/home/page/save/theme',
    method: 'post',
    data: params
  })
}
/**
 * 专题删除
 */
export function delTheme(id) {
  return request({
    url: '/home/page/del/theme/' + id,
    method: 'get'
  })
}
/**
 * 专题详情
 */
export function formTheme(id) {
  return request({
    url: '/home/page/theme/form/' + id,
    method: 'get'
  })
}

/**
 * 活动列表
 */
export function getActiveList(params) {
  return request({
    url: '/home/page/active/list',
    method: 'get',
    params: params
  })
}
/**
 * 活动上下线
 */
export function getActiveStatus(id) {
  return request({
    url: '/home/page/check/active/status/' + id,
    method: 'get'
  })
}
/**
 * 保存活动
 */
export function saveActive(params) {
  return request({
    url: '/home/page/save/active',
    method: 'post',
    data: params
  })
}
/**
 * 删除活动
 */
export function delActive(id) {
  return request({
    url: '/home/page/del/active/' + id,
    method: 'get'
  })
}
/**
 * 活动编辑详情
 */
export function formActive(id) {
  return request({
    url: '/home/page/active/form/' + id,
    method: 'get'
  })
}
