messagecenter.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * 消息中心接口文档
  3. */
  4. import httputils from "@/api/httputils";
  5. const baseUrl = "/message-center";
  6. /**
  7. * title: 统计数量
  8. * info: 查询总数量不传参数,查询 已读Read = true,未读 Read = false
  9. */
  10. export function messgeCount(postParams: any): Promise<any> {
  11. return httputils.postJson(`${baseUrl}/message/count`, postParams);
  12. }
  13. /**
  14. * title: 创建消息
  15. * info: 消息类型:提示(Info)、警告(Warning)、错误(Error)、成功(Success)
  16. */
  17. export function messgeCreate(postParams: any): Promise<any> {
  18. return httputils.postJson(`${baseUrl}/message/create`, postParams);
  19. }
  20. /**
  21. * title: 删除消息
  22. */
  23. export function messgeDelete(postParams: any): Promise<any> {
  24. return httputils.postJson(`${baseUrl}/message/delete`, postParams);
  25. }
  26. /**
  27. * title: 查询消息列表
  28. */
  29. export function messgeQuery(postParams: any): Promise<any> {
  30. return httputils.postJson(`${baseUrl}/message/page-query`, postParams);
  31. }
  32. /**
  33. * title: 更新消息状态
  34. * info: 是否读过:未读(f)、已读(t)
  35. */
  36. export function messgeUpdate(postParams: any): Promise<any> {
  37. return httputils.postJson(`${baseUrl}/message/update`, postParams);
  38. }
  39. /**
  40. * title: 根据接收人将消息置为已读
  41. * info: 已读Read = true,*UserId
  42. */
  43. export function messgeUpdateState(postParams: any): Promise<any> {
  44. return httputils.postJson(`${baseUrl}/message/update-state`, postParams);
  45. }