新增文章阅读数功能,包括在控制器和服务中添加增加阅读数的方法,并更新相关路由以支持该功能。
This commit is contained in:
@@ -32,6 +32,14 @@ export class ArticlesController {
|
||||
async getOne(@Param('id') id: string): Promise<CreateArticleResponseDto> {
|
||||
return this.articlesService.getAndIncreaseReadCount(id);
|
||||
}
|
||||
|
||||
// 增加阅读数
|
||||
@Post(':id/read-count')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: '增加文章阅读数' })
|
||||
async increaseReadCount(@Param('id') id: string): Promise<CreateArticleResponseDto> {
|
||||
return this.articlesService.increaseReadCount(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user