// 后端接口版本
import request from '@/utils/request'

// 获取消息列表
export function getMessage(pageNum) {
  return request({
    url: '/post/news/list?pageNum=' +pageNum ,
    method: 'get'
  })
}
//删除信息 
export function deleteMessage(id) {
  return request({
    url: '/post/news/' + id,
    method: 'delete'
  })
}
//查询信息  
export function searchMessage(id) {
  return request({
    url: '/post/news/' + id,
    method: 'get'
  })
}
//获取详情 
export function moreMessage(id) {
  return request({
    url: '/post/news/' + id,
    method: 'get'
  })
}

//search title
export function searchJMessage(title) {
  return request({
    url: '/post/news/list?newsTitle=' + title,
    method: 'get'
  })
}

//add title
export function addMessage() {
  return request({
    url: '/post/news/add',
    method: 'post'
  })
}

// 创建消息页面
// 提交消息
export function submitMessage(data) {
  return request({
    url: '/post/news/add',
    method: 'post',
    data
  })
}

