import service from '@/utils/request'

// @Summary 获取列表
// @Produce  application/json
// @Router /cms/page/getList [post]
export const getPageList = (data) => {
  return service({
    url: '/cms/page/getList',
    method: 'get',
    data
  })
}

// @Summary 新增
// @Produce  application/json
// @Param menu Object
// @Router /cms/page/add [post]
export const addPage = (data) => {
  return service({
    url: '/cms/page/add',
    method: 'post',
    data
  })
}

// @Summary 删除
// @Produce  application/json
// @Param id int
// @Router /cms/page/delete [delete]
export const deletePage = (data) => {
  return service({
    url: '/cms/page/delete',
    method: 'delete',
    data
  })
}

// @Summary 批量删除
// @Param data body request.IdsReq true "批量删除"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /cms/page/deleteByIds [delete]
export const deletePageByIds = (params) => {
  return service({
    url: '/cms/page/deleteByIds',
    method: 'delete',
    params
  })
}

// @Summary 修改
// @Produce  application/json
// @Param menu Object
// @Router /cms/page/update [put]
export const updatePage = (data) => {
  return service({
    url: '/cms/page/update',
    method: 'put',
    data
  })
}

// @Summary 根据id获取
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.GetById true "根据id获取"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /cms/page/get [get]
export const getPageById = (params) => {
  return service({
    url: '/cms/page/find',
    method: 'get',
    params
  })
}
