import httpRequest from '@/module/request/http-request.js'
import ipConfig from '@/config/ip.config.js'

const api = {
	mailList: ipConfig.api_app + '/mail/list',
	mailDel: ipConfig.api_app + '/mail/del',
	mailRead: ipConfig.api_app + '/mail/read',
	mailReceive: ipConfig.api_app + '/mail/receive',
}

/**
 * 获取邮件列表
 */
export const requestMailList = (params) => {
	return httpRequest.post({
		url: api.mailList,
		data: params
	})
}

/**
 * 删除
 */
export const requestMailDel = (params) => {
	return httpRequest.post({
		url: api.mailDel,
		data: params
	})
}

/**
 * 已读
 */
export const requestMailRead = (params) => {
	return httpRequest.post({
		url: api.mailRead,
		data: params
	})
}

/**
 * 领取
 */
export const requestMailReceive = (params) => {
	return httpRequest.post({
		url: api.mailReceive,
		data: params
	})
}
