import { get } from '@/utils/request.js'

/**
 * 我的消息与待办
 * GET /api/v1/mp/notifications
 * @param {{
 *   notifyType?: string,
 *   category?: string,
 *   readFlag?: boolean,
 *   handledFlag?: boolean,
 *   page?: number,
 *   size?: number
 * }} [params]
 */
export function listMyNotifications(params = {}, options = {}) {
	const data = {}
	if (params.notifyType || params.notify_type) {
		data.notify_type = params.notifyType || params.notify_type
	}
	if (params.category) data.category = params.category
	if (params.readFlag != null || params.read_flag != null) {
		data.read_flag = params.readFlag != null ? params.readFlag : params.read_flag
	}
	if (params.handledFlag != null || params.handled_flag != null) {
		data.handled_flag = params.handledFlag != null ? params.handledFlag : params.handled_flag
	}
	if (params.page != null) data.page = params.page
	if (params.size != null) data.size = params.size
	return get('/notifications', data, options)
}
