实现访问博客计数

This commit is contained in:
2025-05-18 16:01:12 +08:00
parent a561d729e2
commit 3f8e9c27be
2 changed files with 5 additions and 0 deletions

View File

@@ -39,4 +39,8 @@ export class BlogService {
async findById(id: string) {
return this.blogRepository.findOneBy({ id });
}
async incrementViewCount(id: string) {
await this.blogRepository.increment({ id }, 'viewCount', 1);
}
}