import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/jobslink-api/desk/notice/manage/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/jobslink-api/desk/notice/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/jobslink-api/desk/notice/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/jobslink-api/desk/notice/submit',
    method: 'post',
    data: row
  })
}

export const getNotice = (id) => {
  return request({
    url: '/api/jobslink-api/desk/notice/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const noticePublish = (id) => {
  return request({
    url: '/api/jobslink-api/desk/notice/action',
    method: 'post',
    params: {
      id
    }
  })
}

export const getUnreadCount = () => {
  return request({
    url: '/api/jobslink-api/desk/notice/tenant/read',
    method: 'get'
  })
}

export const workGetUnreadCount = () => {
  return request({
    url: '/api/jobslink-api/desk/notice/station/read',
    method: 'get'
  })
}

//获取消息类型
export const getNewsType = () => {
  return request({
    url: '/api/jobslink-api/system/dict/dictionary?code=notice',
    method: 'get'
  })
}

//获取某省各市区的数据
export const getMapData = () => {
  return request({
    url: '/api/jobslink-api/jkworksreport/getMapData1',
    method: 'get'
  })
}
