|
|
@@ -44,9 +44,7 @@ interface RequestWithUser extends Request {
|
|
|
@ApiTags('视频')
|
|
|
@Controller('video')
|
|
|
export class VideoController {
|
|
|
- constructor(private readonly videoService: VideoService
|
|
|
- ) {}
|
|
|
-
|
|
|
+ constructor(private readonly videoService: VideoService) {}
|
|
|
|
|
|
/**
|
|
|
* GET /api/v1/video/search
|
|
|
@@ -64,9 +62,7 @@ export class VideoController {
|
|
|
type: VideoItemDto,
|
|
|
isArray: true,
|
|
|
})
|
|
|
- async search(
|
|
|
- @Body() req: VideoListRequestDto,
|
|
|
- ): Promise<VideoItemDto[]> {
|
|
|
+ async search(@Body() req: VideoListRequestDto): Promise<VideoItemDto[]> {
|
|
|
return await this.videoService.getVideoList(req);
|
|
|
}
|
|
|
|
|
|
@@ -84,13 +80,11 @@ export class VideoController {
|
|
|
description: '标签+视频',
|
|
|
isArray: true,
|
|
|
})
|
|
|
- async homeVideo(
|
|
|
- @Query('channelId') channelId: string,
|
|
|
- ): Promise<any[]> {
|
|
|
+ async homeVideo(@Query('channelId') channelId: string): Promise<any[]> {
|
|
|
return await this.videoService.getHomeSectionVideos(channelId);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
-@Get('guess')
|
|
|
+ @Get('guess')
|
|
|
@ApiOperation({
|
|
|
summary: '猜你喜欢',
|
|
|
})
|
|
|
@@ -104,11 +98,9 @@ export class VideoController {
|
|
|
description: '视频',
|
|
|
isArray: true,
|
|
|
})
|
|
|
- async guess(
|
|
|
- @Query('tag') tag: string,
|
|
|
- ): Promise<any[]> {
|
|
|
+ async guess(@Query('tag') tag: string): Promise<any[]> {
|
|
|
return await this.videoService.getGuessLikeVideos(tag);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* GET /api/v1/video/latest
|