将删除动态优化为批量删除动态

This commit is contained in:
KilLze
2025-12-24 21:13:44 +08:00
parent fd3a38efb5
commit 176e133a57
4 changed files with 28 additions and 11 deletions

View File

@@ -45,14 +45,14 @@ public class PostController {
}
/**
* 删除动态
* 批量删除动态
*
* @param postId 动态ID
* @param postIds 动态ID
* @return 删除结果
*/
@DeleteMapping("/{postId}")
public Result<String> deleteById(@PathVariable Long postId){
postService.deletePostById(postId);
@DeleteMapping
public Result<String> deleteById(@RequestParam List<Long> postIds){
postService.deletePostById(postIds);
return Result.success(ResultCode.SUCCESS_DELETE, "动态删除成功", null);
}