|
|
@@ -1,46 +1,35 @@
|
|
|
import { get, post, delete0 } from '@/utils/request'
|
|
|
|
|
|
const videoApi = {
|
|
|
- videoCategoryApi: '/api/content/video/category',
|
|
|
- videoSubmitApi: '/api/content/video/submit',
|
|
|
- updateVideoScopeApi: '/api/content/video/update/scope',
|
|
|
- updateVideoInfoApi: '/api/content/video/update/info',
|
|
|
- updateVideoCoverApi: '/api/content/video/update/cover',
|
|
|
- updateVideoFileApi: '/api/content/video/update/file',
|
|
|
- videoErrorReportApi: '/api/content/video/report',
|
|
|
+ videoPostApi: '/api/content/post/video',
|
|
|
+ updateVideoScopeApi: '/api/content/post/video/update/scope',
|
|
|
+ updateVideoInfoApi: '/api/content/post/video/update/info',
|
|
|
+ updateVideoCoverApi: '/api/content/post/video/update/cover',
|
|
|
+ updateVideoFileApi: '/api/content/post/video/update/file',
|
|
|
+ videoResourceApi: '/api/content/post/video/resource',
|
|
|
+ convertVideoApi: '/api/content/post/video/convert',
|
|
|
+
|
|
|
+ videoCategoryApi: '/api/content/video/categories',
|
|
|
+ categoryVideoApi: '/api/content/video/category',
|
|
|
+ userVideoPostApi: '/api/content/video/user',
|
|
|
+ tagVideoPostApi: '/api/content/video/tag',
|
|
|
videoInfoApi: '/api/content/video/detail',
|
|
|
videoUrlApi: '/api/content/video/url',
|
|
|
+
|
|
|
+ videoErrorReportApi: '/api/content/video/report',
|
|
|
videoDownloadApi: '/api/content/video/download',
|
|
|
cacheBiliApi: '/api/content/video/cache',
|
|
|
- videoDeleteApi: '/api/content/video/delete',
|
|
|
- userVideoPostApi: '/api/content/video/user',
|
|
|
- userVideoCardApi: '/api/content/video/card/user',
|
|
|
- convertVideoApi: '/api/content/video/convert',
|
|
|
|
|
|
- videoPageApi: '/api/content/video/page',
|
|
|
videoRecommendApi: '/api/content/video/recommend',
|
|
|
similarVideoApi: '/api/content/video/similar',
|
|
|
- videoTagApi: '/api/content/video/tag',
|
|
|
hotVideoApi: '/api/content/video/hot',
|
|
|
userContentDataApi: '/api/content/userdata',
|
|
|
- playerRecordApi: '/api/media/video/play/record',
|
|
|
- userRecentlyVideoListApi: '/api/media/video/post/user/recently',
|
|
|
- testVideoApi: '/api/media/video/post/display',
|
|
|
}
|
|
|
|
|
|
-// 视频分类接口
|
|
|
-export function videoCategory() {
|
|
|
- return get(videoApi.videoCategoryApi)
|
|
|
-}
|
|
|
-
|
|
|
-// 发布新视频
|
|
|
-export function submitVideo(video) {
|
|
|
- return post(videoApi.videoSubmitApi, video)
|
|
|
-}
|
|
|
-
|
|
|
-// 视频转码
|
|
|
-export function convertVideo(videoId) {
|
|
|
- return post(videoApi.convertVideoApi + '/' + videoId)
|
|
|
+/*********************************************************************************************************************/
|
|
|
+// 添加视频贴
|
|
|
+export function addVideoPost(video) {
|
|
|
+ return post(videoApi.videoPostApi, video)
|
|
|
}
|
|
|
|
|
|
// 更新视频可见范围
|
|
|
@@ -63,87 +52,95 @@ export function updateVideoFile(data) {
|
|
|
return post(videoApi.updateVideoFileApi, data)
|
|
|
}
|
|
|
|
|
|
-export function videoErrorReport(data) {
|
|
|
- return post(videoApi.videoErrorReportApi, data)
|
|
|
+// 删除视频贴
|
|
|
+export function deleteVideoPost(videoId) {
|
|
|
+ return delete0(videoApi.videoPostApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-// 视频详情接口
|
|
|
-export function videoInfo(videoId) {
|
|
|
- return get(videoApi.videoInfoApi + '/' + videoId)
|
|
|
-}
|
|
|
-
|
|
|
-// 视频 URL 接口
|
|
|
-export function videoUrl(videoId) {
|
|
|
- return get(videoApi.videoUrlApi + '/' + videoId)
|
|
|
+// 获取视频贴列表
|
|
|
+export function getVideoPosts(page) {
|
|
|
+ return get(videoApi.videoPostApi + '?page=' + page)
|
|
|
}
|
|
|
|
|
|
-// 下载视频接口
|
|
|
-export function downloadVideo(videoId) {
|
|
|
- return get(videoApi.videoDownloadApi + '/' + videoId)
|
|
|
+// 获取视频贴详情
|
|
|
+export function getVideoPost(videoId) {
|
|
|
+ return get(videoApi.videoPostApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-// 缓存 bili 视频接口
|
|
|
-export function cacheBiliVideo(bvId) {
|
|
|
- return post(videoApi.cacheBiliApi + '/' + bvId)
|
|
|
+// 获取视频资源
|
|
|
+export function getVideoResource(videoId) {
|
|
|
+ return get(videoApi.videoResourceApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-// 视频 URL 接口
|
|
|
-export function deleteVideo(videoId) {
|
|
|
- return delete0(videoApi.videoDeleteApi + '/' + videoId)
|
|
|
+// 视频转码
|
|
|
+export function convertVideo(videoId) {
|
|
|
+ return post(videoApi.convertVideoApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-/***********************************************************************************************************************/
|
|
|
-// 视频推荐接口
|
|
|
-export function videoRecommend(page) {
|
|
|
- return get(videoApi.videoRecommendApi + '/' + page)
|
|
|
+/*********************************************************************************************************************/
|
|
|
+// 获取视频分类
|
|
|
+export function videoCategory() {
|
|
|
+ return get(videoApi.videoCategoryApi)
|
|
|
}
|
|
|
|
|
|
-// 视频标签接口
|
|
|
-export function videoTag(tag, page) {
|
|
|
- return get(videoApi.videoTagApi + '?tag=' + tag + '&page=' + page)
|
|
|
+// 获取分类视频
|
|
|
+export function categoryVideos(categoryId, page) {
|
|
|
+ return get(videoApi.categoryVideoApi + '?categoryId=' + categoryId + '&page=' + page)
|
|
|
}
|
|
|
|
|
|
-// 相似视频接口
|
|
|
-export function similarVideo(videoId) {
|
|
|
- return get(videoApi.similarVideoApi + '?videoId=' + videoId)
|
|
|
+// 获取用户视频
|
|
|
+export function getUserVideos(userId, page) {
|
|
|
+ return get(videoApi.userVideoPostApi + '?userId=' + userId + '&page=' + page)
|
|
|
}
|
|
|
|
|
|
-// 视频分类接口
|
|
|
-export function categoryVideos(categoryId, nextId) {
|
|
|
- return get(videoApi.videoPageApi + '?categoryId=' + categoryId + '&nextId=' + nextId)
|
|
|
+// 获取相同标签的视频
|
|
|
+export function getTagVideos(tag, page) {
|
|
|
+ return get(videoApi.tagVideoPostApi + '?tag=' + tag + '&page=' + page)
|
|
|
}
|
|
|
|
|
|
-// 播放记录
|
|
|
-export function submitPlayRecord(playerRecord) {
|
|
|
- return post(videoApi.playerRecordApi, playerRecord)
|
|
|
+// 获取视频详情
|
|
|
+export function videoInfo(videoId) {
|
|
|
+ return get(videoApi.videoInfoApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-export function userVideoPost(pageNumber) {
|
|
|
- return get(videoApi.userVideoPostApi + '?pageNumber=' + pageNumber)
|
|
|
+// 获取视频 URL
|
|
|
+export function videoUrl(videoId) {
|
|
|
+ return get(videoApi.videoUrlApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-export function getUserVideoPost(videoId) {
|
|
|
- return get(videoApi.userVideoPostApi + '/' + videoId)
|
|
|
+/*********************************************************************************************************************/
|
|
|
+// 报告视频错误
|
|
|
+export function videoErrorReport(data) {
|
|
|
+ return post(videoApi.videoErrorReportApi, data)
|
|
|
}
|
|
|
|
|
|
-// 用户视频列表
|
|
|
-export function userVideoCard(pageNumber, userId) {
|
|
|
- return get(videoApi.userVideoCardApi + '?pageNumber=' + pageNumber + '&userId=' + userId)
|
|
|
+// 下载视频
|
|
|
+export function downloadVideo(videoId) {
|
|
|
+ return get(videoApi.videoDownloadApi + '/' + videoId)
|
|
|
}
|
|
|
|
|
|
-// 用户最近投稿的视频
|
|
|
-export function userRecentlyVideoList(userId) {
|
|
|
- return get(videoApi.userRecentlyVideoListApi + '?userId=' + userId)
|
|
|
+// 缓存 bili 视频
|
|
|
+export function cacheBiliVideo(bvId) {
|
|
|
+ return post(videoApi.cacheBiliApi + '/' + bvId)
|
|
|
}
|
|
|
|
|
|
-export function getDisplayedVideoList() {
|
|
|
- return get(videoApi.testVideoApi)
|
|
|
+/***********************************************************************************************************************/
|
|
|
+// 获取推荐视频
|
|
|
+export function videoRecommend(page) {
|
|
|
+ return get(videoApi.videoRecommendApi + '/' + page)
|
|
|
}
|
|
|
|
|
|
-export function getUserContentData(userId) {
|
|
|
- return get(videoApi.userContentDataApi + '?userId=' + userId)
|
|
|
+// 获取相似视频
|
|
|
+export function similarVideo(videoId) {
|
|
|
+ return get(videoApi.similarVideoApi + '?videoId=' + videoId)
|
|
|
}
|
|
|
|
|
|
+// 获取热门视频
|
|
|
export function getHotVideo() {
|
|
|
return get(videoApi.hotVideoApi)
|
|
|
}
|
|
|
+
|
|
|
+// 获取用户内容统计
|
|
|
+export function getUserContentData(userId) {
|
|
|
+ return get(videoApi.userContentDataApi + '?userId=' + userId)
|
|
|
+}
|