import service from '@/utils/request'

// @Tags MediaFile
// @Summary 分页文件列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取文件户列表"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /cms/mediaFile/getList [post]
export const getFileList = (data) => {
  return service({
    url: '/cms/mediaFile/getList',
    method: 'post',
    data
  })
}

// @Tags MediaFile
// @Summary 删除文件
// @Security ApiKeyAuth
// @Produce  application/json
// @Param data body dbModel.MediaFile true "传入文件里面id即可"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /cms/mediaFile/delete [delete]
export const deleteFile = (data) => {
  return service({
    url: '/cms/mediaFile/delete',
    method: 'delete',
    data
  })
}

/**
 * 编辑文件名或者备注
 * @param data
 * @returns {*}
 */
export const editFileName = (data) => {
  return service({
    url: '/cms/mediaFile/editName',
    method: 'put',
    data
  })
}
