comments.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /**
  2. * 文章评论管理
  3. * @see https://api.halo.run/admin-api.html#tag/journal-controller
  4. */
  5. import HttpHandler from '@/common/http/request.js'
  6. export default {
  7. /**
  8. * 查询文章评论
  9. * {
  10. * "keyword":"", // 关键字
  11. * "page": 0, // 分页索引
  12. * "size": 10, // 分页大小
  13. * "sort": ["",""], // 排序
  14. * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE"
  15. * }
  16. */
  17. getPostsComments: (params) => {
  18. return HttpHandler.Get('/api/admin/posts/comments', params)
  19. },
  20. /**
  21. * 回复文章评论
  22. * {
  23. * "allowNotification": true,
  24. * "author": "string",
  25. * "authorUrl": "string",
  26. * "content": "string",
  27. * "email": "string",
  28. * "parentId": 0,
  29. * "postId": 0
  30. * }
  31. */
  32. postPostsComments: (data) => {
  33. return HttpHandler.Post('/api/admin/posts/comments', data)
  34. },
  35. /**
  36. * 更新文章评论状态
  37. * @param {Number} commentId id
  38. * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE"
  39. */
  40. updatePostsCommentsStatus: (commentId, status) => {
  41. return HttpHandler.Put(`/api/admin/posts/comments/${commentId}/status/${status}`)
  42. },
  43. /**
  44. * 删除文章评论
  45. * @param {Number} commentId id
  46. */
  47. deletePostsCommentsById: (commentId) => {
  48. return HttpHandler.Delete(`/api/admin/posts/comments/${commentId}`)
  49. },
  50. /**
  51. * 查询页面评论
  52. * {
  53. * "keyword":"", // 关键字
  54. * "page": 0, // 分页索引
  55. * "size": 10, // 分页大小
  56. * "sort": ["",""], // 排序
  57. * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE"
  58. * }
  59. */
  60. getSheetsComments: (params) => {
  61. return HttpHandler.Get('/api/admin/sheets/comments', params)
  62. },
  63. /**
  64. * 回复页面评论
  65. * {
  66. * "allowNotification": true,
  67. * "author": "string",
  68. * "authorUrl": "string",
  69. * "content": "string",
  70. * "email": "string",
  71. * "parentId": 0,
  72. * "postId": 0
  73. * }
  74. */
  75. postSheetsComments: (data) => {
  76. return HttpHandler.Post('/api/admin/sheets/comments', data)
  77. },
  78. /**
  79. * 更新页面评论状态
  80. * @param {Number} commentId id
  81. * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE"
  82. */
  83. updateSheetsCommentsStatus: (commentId, status) => {
  84. return HttpHandler.Put(`/api/admin/sheets/comments/${commentId}/status/${status}`)
  85. },
  86. /**
  87. * 删除页面评论
  88. * @param {Number} commentId id
  89. */
  90. deleteSheetsCommentsById: (commentId) => {
  91. return HttpHandler.Delete(`/api/admin/sheets/comments/${commentId}`)
  92. },
  93. /**
  94. * 查询日记评论
  95. * {
  96. * "keyword":"", // 关键字
  97. * "page": 0, // 分页索引
  98. * "size": 10, // 分页大小
  99. * "sort": ["",""], // 排序
  100. * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE"
  101. * }
  102. */
  103. getJournalsComments: (params) => {
  104. return HttpHandler.Get('/api/admin/journals/comments', params)
  105. },
  106. /**
  107. * 回复日记评论
  108. * {
  109. * "allowNotification": true,
  110. * "author": "string",
  111. * "authorUrl": "string",
  112. * "content": "string",
  113. * "email": "string",
  114. * "parentId": 0,
  115. * "postId": 0
  116. * }
  117. */
  118. postJournalsComments: (data) => {
  119. return HttpHandler.Post('/api/admin/journals/comments', data)
  120. },
  121. /**
  122. * 更新日记评论状态
  123. * @param {Number} commentId id
  124. * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE"
  125. */
  126. updateJournalsCommentsStatus: (commentId, status) => {
  127. return HttpHandler.Put(`/api/admin/journals/comments/${commentId}/status/${status}`)
  128. },
  129. /**
  130. * 删除日记评论
  131. * @param {Number} commentId id
  132. */
  133. deleteJournalsCommentsById: (commentId) => {
  134. return HttpHandler.Delete(`/api/admin/journals/comments/${commentId}`)
  135. },
  136. }