import request from '@/axios';

export const getAllList = (params,page) => {
	let data = {}
	if(page){
		data={
		  ...params,
		  current:page.currentPage,
		  size:page.pageSize,
		}
	}else{
		data=params
	}
  return request({
    url: '/sf/platformAnnouncement/list',
    method: 'get',
		params: data
  })
}

export const getList = (page, params) => {
  return request({
    url: '/sf/platformAnnouncement/page',
    method: 'get',
    params: {
      ...params,
      current:page.currentPage,
      size:page.pageSize,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/sf/platformAnnouncement/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const add = (row) => {
  return request({
    url: '/sf/platformAnnouncement/save',
    method: 'post',
		headers:{
			"Content-Type": "application/x-www-form-urlencoded",
		},
    params: row,
  })
}

export const update = (row) => {
  return request({
    url: '/sf/platformAnnouncement/update',
    method: 'post',
		headers:{
			"Content-Type": "application/x-www-form-urlencoded",
		},
    params: row
  })
}

export const remove = (ids) => {
  return request({
    url: '/sf/platformAnnouncement/remove',
    method: 'post',
    params: {
      id:ids,
    }
  })
}
