import request from '@/utils/request'
import Qs from 'qs';

//获取通知列表
export function getNoticeList(params) {
	return request({
		url: '/mobile/messageNoticeApi/pageListShort',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//获取通知详情
export function getNoticeInfo(params) {
	return request({
		url: '/mobile/messageNoticeApi/detail',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//发送通知
export function sendMessage(params) {
	return request({
		url: '/mobile/messageNoticeApi/add',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//============================新接口========================
//预获取最新消息
export function prefetch() {
	return request({
		url: '/mobile/messageApi/prefetch',
		data: Qs.stringify({}),
		method: 'get',
	})
}

//获取最新消息列表
export function getTopList(params) {
	return request({
		url: '/mobile/messageApi/topList',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//消息分组
export function getGroupList(params) {
	return request({
		url: '/mobile/messageApi/groupList',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//消息分页列表
export function getMessageList(params) {
	return request({
		url: '/mobile/messageApi/pageList',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//查看消息
export function getMessageInfo(id) {
	return request({
		url: '/mobile/messageApi/view/' + id,
		method: 'get',
	})
}
