notice.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import request from '@/utils/request'
  2. // 查询公告列表
  3. export function listNotice(query) {
  4. return request({
  5. url: '/system/notice/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询公告详细
  11. export function getNotice(noticeId) {
  12. return request({
  13. url: '/system/notice/' + noticeId,
  14. method: 'get'
  15. })
  16. }
  17. // 新增已读记录
  18. export function insertReadHis(noticeId) {
  19. return request({
  20. url: '/system/userNotice/' +noticeId,
  21. method: 'get',
  22. })
  23. }
  24. // 查询用户公告关联记录
  25. export function listReadHis(noticeId) {
  26. return request({
  27. url: '/system/userNotice/listReadHis/'+noticeId ,
  28. method: 'post',
  29. data: data
  30. })
  31. }
  32. // 根据用户id查询用户公告关联记录
  33. export function listByUserId() {
  34. return request({
  35. url: '/system/userNotice/listByUserId/' ,
  36. method: 'get'
  37. })
  38. }
  39. // 新增公告
  40. export function addNotice(data) {
  41. return request({
  42. url: '/system/notice',
  43. method: 'post',
  44. data: data
  45. })
  46. }
  47. // 修改公告
  48. export function updateNotice(data) {
  49. return request({
  50. url: '/system/notice',
  51. method: 'put',
  52. data: data
  53. })
  54. }
  55. // 删除公告
  56. export function delNotice(noticeId) {
  57. return request({
  58. url: '/system/notice/' + noticeId,
  59. method: 'delete'
  60. })
  61. }