comments.ts 782 B

12345678910111213141516171819202122232425262728293031
  1. import { http } from '@/utils/http/axios';
  2. import { COMMENT_STATUS } from '@/types/comments/constant';
  3. import { CommentsQuery, ListType } from '@/types/comments/type';
  4. //查询留言列表
  5. export const getCommentsList = (data: CommentsQuery) => {
  6. return http.request<ListType>({
  7. url: `/admin/comment/queryCommentPageByFilters`,
  8. method: 'post',
  9. data,
  10. });
  11. };
  12. //更新评论状态
  13. export const undateCommentStatus = (data: { id: number; status: COMMENT_STATUS }) => {
  14. return http.request({
  15. url: `/admin/comment/updateCommentStatus`,
  16. method: 'PUT',
  17. data,
  18. });
  19. };
  20. //回复评论
  21. export const replyComment = (data: { id: number; reply: string }) => {
  22. return http.request({
  23. url: `/admin/comment/replyComment`,
  24. method: 'post',
  25. data,
  26. });
  27. };