index.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import request from '@/config/axios'
  2. import qs from 'qs'
  3. export interface NotifyMessageVO {
  4. id: number
  5. userId: number
  6. userType: number
  7. templateId: number
  8. templateCode: string
  9. templateNickname: string
  10. templateContent: string
  11. templateType: number
  12. templateParams: string
  13. readStatus: boolean
  14. readTime: Date
  15. }
  16. // 查询站内信消息列表
  17. export const getNotifyMessagePage = async (params: PageParam) => {
  18. return await request.get({ url: '/system/notify-message/page', params })
  19. }
  20. // 获得我的站内信分页
  21. export const getMyNotifyMessagePage = async (params: PageParam) => {
  22. return await request.get({ url: '/system/notify-message/my-page', params })
  23. }
  24. // 批量标记已读
  25. export const updateNotifyMessageRead = async (ids) => {
  26. return await request.put({
  27. url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false })
  28. })
  29. }
  30. // 标记所有站内信为已读
  31. export const updateAllNotifyMessageRead = async () => {
  32. return await request.put({ url: '/system/notify-message/update-all-read' })
  33. }
  34. // 获取当前用户的最新站内信列表
  35. export const getUnreadNotifyMessageListApi = async () => {
  36. return await request.get({ url: '/system/notify-message/get-unread-list' })
  37. }
  38. // 获得当前用户的未读站内信数量
  39. export const getUnreadNotifyMessageCountApi = async () => {
  40. return await request.get({ url: '/system/notify-message/get-unread-count' })
  41. }