feat(frontend): Align admin and user API integration
This commit is contained in:
@@ -7,6 +7,8 @@ import type {
|
||||
AuthUser
|
||||
} from '@/types'
|
||||
|
||||
export type { LoginParams, LoginResult, RegisterParams, CaptchaResult, AuthUser }
|
||||
|
||||
/**
|
||||
* 认证相关 API
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import request from '@/utils/request.ts'
|
||||
import type { Category, Tag, PageResult, PageParams } from '@/types'
|
||||
|
||||
export type { Category, Tag }
|
||||
|
||||
/**
|
||||
* 分类相关 API
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import request from '@/utils/request.ts'
|
||||
import type { Danmaku, DanmakuSendParams } from '@/types'
|
||||
|
||||
export type { Danmaku }
|
||||
|
||||
/**
|
||||
* 弹幕相关 API
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request.ts'
|
||||
import type { Favorite, FavoriteCreateParams, FavoriteVideoParams, VideoInfo, PageResult, PageParams } from '@/types'
|
||||
import type { Favorite, FavoriteCreateParams, VideoInfo, PageResult, PageParams } from '@/types'
|
||||
|
||||
export type { Favorite }
|
||||
|
||||
/**
|
||||
* 收藏夹相关 API
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import request from '@/utils/request.ts'
|
||||
import type { VideoInfo, RecommendVideo } from '@/types'
|
||||
import type { VideoInfo } from '@/types'
|
||||
|
||||
/**
|
||||
* 推荐相关 API
|
||||
@@ -7,16 +7,20 @@ import type { VideoInfo, RecommendVideo } from '@/types'
|
||||
export const recommendApi = {
|
||||
/**
|
||||
* 获取首页推荐
|
||||
* @param page 页码
|
||||
* @param size 每页数量
|
||||
*/
|
||||
getHomeRecommend(limit?: number): Promise<VideoInfo[]> {
|
||||
return request.get('/recommend/home', { limit })
|
||||
getHomeRecommend(page: number = 1, size: number = 20): Promise<VideoInfo[]> {
|
||||
return request.get('/recommend/home', { page, size })
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取热门推荐
|
||||
* @param periodType 时间周期类型:1-日榜,2-周榜,3-月榜
|
||||
* @param size 数量
|
||||
*/
|
||||
getHotRecommend(params?: { page?: number; size?: number }): Promise<VideoInfo[]> {
|
||||
return request.get('/recommend/hot', params)
|
||||
getHotRecommend(periodType: number = 1, size: number = 20): Promise<VideoInfo[]> {
|
||||
return request.get('/recommend/hot', { periodType, size })
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,8 @@ import type {
|
||||
PageResult
|
||||
} from '@/types'
|
||||
|
||||
export type { UserFollow, Message, Notification }
|
||||
|
||||
/**
|
||||
* 用户相关 API
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user