import fetch from '@/utils/fetch'

/**
 * 获取列表
 * @Author   Sophy
 * @DateTime 2019-08-22T15:37:06+0800
 */
export const getList = ({
  nick_name,
  user_from,
  page
}) => fetch('/admin/user/list_information', {
  nick_name,
  user_from,
  page
}, 'GET')

/**
 * 获取详情
 * @Author   Sophy
 * @DateTime 2019-08-22T15:39:56+0800
 */
export const getArticleDetail = (order_no) => fetch('/admin/level/detail_order', {
  order_no
}, 'GET')

/**
 * 新增
 * @Author   Sophy
 * @DateTime 2019-08-22T15:42:13+0800
 */
export const createArticle = ({
  id,
  importance,
  remark,
  timestamp,
  title,
  type,
  status
}) => fetch('/admin/user/list_information', {
  id,
  importance,
  remark,
  timestamp,
  title,
  type,
  status
}, 'GET')

/**
 * 修改
 * @Author   Sophy
 * @DateTime 2019-08-22T15:42:55+0800
 */
export const updateArticle = ({
  id,
  remark,
  timestamp,
  title,
  type,
  status
}) => fetch('/admin/user/list_information', {
  id,
  remark,
  timestamp,
  title,
  type,
  status
}, 'GET')

/**
 * 删除
 * @Author   Sophy
 * @DateTime 2019-08-22T15:44:57+0800
 */
export const deleteArticle = (id) => fetch('/admin/user/list_information', {
  id
}, 'GET')

/**
 * 导出数据
 * @Author   Sophy
 * @DateTime 2019-08-26T17:56:20+0800
 */
export const exportExcel = ({nick_name, user_from}) => fetch('/admin/user/export_excel', {
  nick_name,
  user_from
}, 'GET', 'blob')
