comment.js 622 B

123456789101112131415161718192021
  1. import { get, post } from '@/utils/request'
  2. const commentApi = {
  3. videoCommentApi: '/api/comment/video',
  4. videoChildCommentApi: '/api/comment/video/child'
  5. }
  6. // 发布评论
  7. export function publishComment(data) {
  8. return post(commentApi.videoCommentApi, data)
  9. }
  10. // 获取评论
  11. export function getComment(videoId, pageNumber) {
  12. return get(commentApi.videoCommentApi + '?videoId=' + videoId + '&pageNumber=' + pageNumber)
  13. }
  14. // 获取评论的子评论
  15. export function getChildComment(commentId, pageNumber) {
  16. return get(commentApi.videoChildCommentApi + '?commentId=' + commentId + '&pageNumber=' + pageNumber)
  17. }