修bug,顺便修改接口名
This commit is contained in:
@@ -36,7 +36,7 @@ public class PostController {
|
||||
* @param postDTO 动态信息
|
||||
* @return 发布的动态对象
|
||||
*/
|
||||
@PostMapping( "/addPost")
|
||||
@PostMapping( "/createPost")
|
||||
public Result<Post> createPostJson(@RequestBody PostRequestDTO postDTO) {
|
||||
// 调用 Service 层处理发布动态业务逻辑
|
||||
Post result = postService.createPost(postDTO);
|
||||
@@ -50,7 +50,7 @@ public class PostController {
|
||||
* @return 删除结果
|
||||
*/
|
||||
@PostMapping("/deletePost")
|
||||
public Result<String> deleteById(@RequestParam List<Long> postIds){
|
||||
public Result<String> deleteById(@RequestBody List<Long> postIds){
|
||||
int deletedCount = postService.deletePostById(postIds);
|
||||
return Result.success(ResultCode.SUCCESS_DELETE, deletedCount > 0 ? "成功删除" : "删除失败,该动态不存在", null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user