add: 添加更新博文接口

This commit is contained in:
SunnyQjm committed 2019-10-31 16:32:28 +08:00
1 parent d642794be4
commit 7e521ae29c
2 files changed
+6

No files matched your search

+3
View File
@@ -72,6 +72,9 @@ export class AdminController {
if (updatePostDto.content) {
post.content = updatePostDto.content;
}
if (updatePostDto.title) {
post.title = updatePostDto.title;
}
await this.postService.savePost(post);
return ResponseUtil.success();
}
+3
View File
@@ -4,6 +4,9 @@ export class UpdatePostDto {
@IsNumber()
id: number;
@IsString()
title: string;
@IsString()
content?: string;