完成动态删除功能

This commit is contained in:
KilLze
2025-12-18 21:11:45 +08:00
parent c01824513b
commit 84e8fe4ff6
7 changed files with 48 additions and 2 deletions

View File

@@ -41,4 +41,16 @@ public class PostController {
Post result = postService.createPost(postRequestDTO);
return Result.success(ResultCode.SUCCESS_REVIEW, "动态发布成功,等待审核。", result);
}
/**
* 删除动态
*
* @param postId 动态ID
* @return 删除结果
*/
@DeleteMapping("/{postId}")
public Result<String> deleteById(@PathVariable Integer postId){
postService.deletePostById(postId);
return Result.success(ResultCode.SUCCESS_DELETE, "动态删除成功", null);
}
}