import request from '../utils/request'

const api = {
  AppVersion: '/Public/GetAppVersion',
  GetNotice: '/Public/GetNotice',
  PopupUnread: '/Popup/Unread',
  PopupMarkRead: '/Popup/MarkRead',
  AdminPopupList: '/Admin/Popup/List',
  AdminPopup: '/Admin/Popup',
  AdminPopupReadList: '/Admin/Popup/ReadList',
  AdminNoticeList: '/Admin/Notice/List',
  AdminNotice: '/Admin/Notice'
}

export function getAppVersion() {
  return request({
    url: api.AppVersion,
    method: 'get'
  })
}

export function GetNotice(parameter) {
  return request({
    url: api.GetNotice,
    method: 'get',
    params: parameter
  })
}

export function getUnreadPopup(parameter) {
  return request({
    url: api.PopupUnread,
    method: 'get',
    params: parameter
  })
}

export function markPopupRead(parameter) {
  return request({
    url: api.PopupMarkRead,
    method: 'post',
    data: parameter
  })
}

export function getAdminPopupList(parameter) {
  return request({
    url: api.AdminPopupList,
    method: 'get',
    params: parameter
  })
}

export function createAdminPopup(parameter) {
  return request({
    url: api.AdminPopup,
    method: 'post',
    data: parameter
  })
}

export function updateAdminPopup(parameter) {
  return request({
    url: api.AdminPopup,
    method: 'put',
    data: parameter
  })
}

export function deleteAdminPopup(parameter) {
  return request({
    url: api.AdminPopup,
    method: 'delete',
    data: parameter
  })
}

export function getAdminPopupReadList(parameter) {
  return request({
    url: api.AdminPopupReadList,
    method: 'get',
    params: parameter
  })
}

export function getAdminNoticeList(parameter) {
  return request({
    url: api.AdminNoticeList,
    method: 'get',
    params: parameter
  })
}

export function saveAdminNotice(parameter) {
  return request({
    url: api.AdminNotice,
    method: 'post',
    data: parameter
  })
}

export function deleteAdminNotice(parameter) {
  return request({
    url: api.AdminNotice,
    method: 'delete',
    data: parameter
  })
}
