import axiosApi from './AxiosApi.js'

const apiList = {
  page: {
    url: `/msgsCenterInfo/page`,
    method: 'POST'
  },
  mark: {
    url: `/msgsCenterInfo/mark`,
    method: 'GET'
  },
  save: {
    url: `/msgsCenterInfo`,
    method: 'POST'
  },
  delete: {
    url: `/msgsCenterInfo`,
    method: 'DELETE'
  },
  preview: {
    method: 'POST',
    url: `/msgsCenterInfo/preview`
  },
  export: {
    method: 'POST',
    url: `/msgsCenterInfo/export`
  },
  import: {
    method: 'POST',
    url: `/msgsCenterInfo/import`
  }
}

export default {
  page (data, custom = {}) {
    return axiosApi({
      ...apiList.page,
      data,
      custom
    })
  },
  save (data) {
    return axiosApi({
      ...apiList.save,
      data
    })
  },
  delete (data) {
    return axiosApi({
      ...apiList.delete,
      data
    })
  },
  mark (data) {
    return axiosApi({
      ...apiList.mark,
      data
    })
  },
  get (id) {
    return axiosApi({
      url: `/msgsCenterInfo/${id}`,
      method: 'GET'
    })
  },
  preview (data) {
    return axiosApi({
      ...apiList.preview,
      data
    })
  },
  export (data) {
    return axiosApi({
      ...apiList.export,
      responseType: "blob",
      data
    })
  },
  import (data) {
    return axiosApi({
      ...apiList.import,
      data
    })
  }
}
