apiNotification.js 727 B

123456789101112131415161718192021222324252627282930
  1. import { del, get, post } from "./http";
  2. const prefix = 'devicesApi/notification/';
  3. export default {
  4. getUnreadTotal() {
  5. return get(prefix + "tobe-read-count")
  6. },
  7. /**
  8. * 查询通知列表
  9. * @param {String} notificationId 最后一个列表对象的Id(用于分页)
  10. * @returns Promise
  11. */
  12. getNotificationList(notificationId) {
  13. return get(prefix + "alerts", {notificationId})
  14. },
  15. readMessage(notificationId) {
  16. return get(prefix + "read-alert", {notificationId})
  17. },
  18. deleteMessage(notificationId) {
  19. return del(prefix + "alerts/" + notificationId)
  20. },
  21. /**
  22. * 获取各类通知的数量统计
  23. * @returns Promise
  24. */
  25. getTabDotCount() {
  26. return get(prefix + "tab-count")
  27. }
  28. }