import request from '@/utils/request'

/**
 * 首页模板列表
 * https://www.showdoc.com.cn/1003739271891029?page_id=5845163076038930
 *
 * @export
 * @param {*} query
 * @return {*}
 */
export function fetchTemps(query) {
  return request({
    url: '/setModule/Index/index',
    method: 'get',
    params: query
  })
}

/**
 * /setModule/Index/index
 * https://www.showdoc.com.cn/1003739271891029?page_id=5845176352660570
 *
 * @export
 * @param {*} query
 * @return {*}
 */
export function addTemp(query) {
  return request({
    url: '/setModule/Index/index',
    method: 'post',
    data: query
  })
}

/**
 * 首页模板删除
 * https://www.showdoc.com.cn/1003739271891029?page_id=5845183839170036
 *
 * @export
 * @param {*} query
 * @return {*}
 */
export function deleteTemp(query) {
  return request({
    url: '/setModule/Index/delTemplate',
    method: 'post',
    data: query
  })
}

/**
 * 首页模板使用
 * https://www.showdoc.com.cn/1003739271891029?page_id=5845190544392658
 *
 * @export
 * @param {*} query
 * @return {*}
 */
export function useTemp(query) {
  return request({
    url: '/setModule/Index/tempUse',
    method: 'post',
    data: query
  })
}

/**
 * 首页模板复制
 * https://www.showdoc.com.cn/1003739271891029?page_id=5847739378702355
 *
 * @export
 * @param {*} query
 * @return {*}
 */
export function cloneTemp(query) {
  return request({
    url: '/setModule/Index/copySystemTemp',
    method: 'post',
    data: query
  })
}
