Skip to content

Commit

Permalink
[Refactor] response 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyunio committed May 22, 2024
1 parent 8af0066 commit 74f48ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.jiyunio.todolist.category;

import com.jiyunio.todolist.responseDTO.ResponseDTO;
import com.jiyunio.todolist.responseDTO.ResponseCategoryDTO;
import com.jiyunio.todolist.responseDTO.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -43,9 +43,8 @@ public ResponseEntity<ResponseCategoryDTO> updateCategory(@Parameter(description
@Operation(summary = "카테고리 삭제")
public ResponseEntity<ResponseDTO> deleteCategory(@Parameter(description = "카테고리의 id") @PathVariable Long categoryId) {
categoryService.deleteCategory(categoryId);
ResponseDTO responseDTO = ResponseDTO.builder()
return ResponseEntity.ok(ResponseDTO.builder()
.msg("카테고리 삭제 성공")
.build();
return new ResponseEntity<>(responseDTO, HttpStatus.NO_CONTENT);
.build());
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.jiyunio.todolist.member;

import com.jiyunio.todolist.responseDTO.ResponseDTO;
import com.jiyunio.todolist.member.dto.ChangeUserPwDTO;
import com.jiyunio.todolist.member.dto.SignInDTO;
import com.jiyunio.todolist.member.dto.SignUpDTO;
import com.jiyunio.todolist.responseDTO.ResponseDTO;
import com.jiyunio.todolist.responseDTO.ResponseMemberDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down Expand Up @@ -43,10 +43,9 @@ public ResponseEntity<ResponseMemberDTO> updateUserPw(@Parameter(description = "
@Operation(summary = "회원 탈퇴", description = "비밀번호 이용")
public ResponseEntity<ResponseDTO> deleteMember(@Parameter(description = "member의 id") @PathVariable Long memberId, @RequestParam String userPw) {
memberService.deleteMember(memberId, userPw);
ResponseDTO responseDTO = ResponseDTO.builder()
return ResponseEntity.ok(ResponseDTO.builder()
.msg("회원 탈퇴 성공")
.build();
return new ResponseEntity<>(responseDTO, HttpStatus.NO_CONTENT);
.build());
}
}

7 changes: 3 additions & 4 deletions src/main/java/com/jiyunio/todolist/todo/TodoController.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ public ResponseEntity<?> updateTodo(@Parameter(description = "todo의 id") @Path
@Operation(summary = "todo 삭제")
public ResponseEntity<ResponseDTO> deleteTodo(@Parameter(description = "todo의 id") @PathVariable Long todoId) {
todoService.deleteTodo(todoId);
ResponseDTO responseDTO = ResponseDTO.builder()
.msg("Todo 삭제 완료")
.build();
return new ResponseEntity<>(responseDTO, HttpStatus.NO_CONTENT);
return ResponseEntity.ok(ResponseDTO.builder()
.msg("todo 삭제 성공")
.build());
}
}

0 comments on commit 74f48ea

Please sign in to comment.