notice.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 listUnNotice(query) {
  12. return request({
  13. url: '/system/notice/unList',
  14. method: 'get',
  15. params: query
  16. })
  17. }
  18. // 查询公告详细
  19. export function getNotice(noticeId) {
  20. return request({
  21. url: '/system/notice/' + noticeId,
  22. method: 'get'
  23. })
  24. }
  25. // 新增已读记录
  26. export function insertReadHis(noticeId) {
  27. return request({
  28. url: '/system/userNotice/insertReadHis/'+ noticeId,
  29. method: 'get',
  30. })
  31. }
  32. // 查询用户公告关联记录
  33. export function listReadHis(noticeId) {
  34. return request({
  35. url: '/system/userNotice/listReadHis/'+noticeId ,
  36. method: 'post',
  37. data: data
  38. })
  39. }
  40. // 根据用户id查询用户公告关联记录
  41. export function listByUserId() {
  42. return request({
  43. url: '/system/userNotice/listByUserId/' ,
  44. method: 'get'
  45. })
  46. }
  47. // 新增公告
  48. export function addNotice(data) {
  49. return request({
  50. url: '/system/notice',
  51. method: 'post',
  52. data: data
  53. })
  54. }
  55. // 修改公告
  56. export function updateNotice(data) {
  57. return request({
  58. url: '/system/notice',
  59. method: 'put',
  60. data: data
  61. })
  62. }
  63. // 删除公告
  64. export function delNotice(noticeId) {
  65. return request({
  66. url: '/system/notice/' + noticeId,
  67. method: 'delete'
  68. })
  69. }