Files
device-voice-h5/api/modules/notification.js
luo 6a794d88af
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m2s
feat: 新增文档
2026-07-27 16:21:34 +08:00

37 lines
629 B
JavaScript

import request from '@/utils/request.js';
export const notificationApi = {
getList(page = 1, page_size = 20, is_read) {
return request({
url: '/api/c/v1/notifications',
method: 'GET',
data: {
page,
page_size,
...(is_read === undefined ? {} : { is_read })
}
});
},
getUnreadCount() {
return request({
url: '/api/c/v1/notifications/unread-count',
method: 'GET'
});
},
markRead(id) {
return request({
url: `/api/c/v1/notifications/${id}/read`,
method: 'PUT'
});
},
markAllRead() {
return request({
url: '/api/c/v1/notifications/read-all',
method: 'PUT'
});
}
};