Skip to content

Commit

Permalink
[Refactor] TodoRes 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyunio committed Nov 14, 2024
1 parent 775b1eb commit 469790a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/basic/study/dto/TodoRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class TodoRes {
private Long memberId;
private Long todoId;
private String content;
private LocalDate deadLine;
@Builder.Default
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/basic/study/service/TodoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public TodoRes createTodo(TodoReq todoReq) {

return TodoRes.builder()
.memberId(todo.getMember().getId())
.todoId(todo.getId())
.content(todo.getContent())
.deadLine(todo.getDeadLine())
.build();
Expand All @@ -41,6 +42,7 @@ public List<TodoRes> readTodoes(Long memberId) {
for (Todo todo : todoList) {
TodoRes todoRes = TodoRes.builder()
.memberId(todo.getMember().getId())
.todoId(todo.getId())
.content(todo.getContent())
.deadLine(todo.getDeadLine())
.isCompleted(todo.getIsCompleted())
Expand All @@ -56,6 +58,7 @@ public TodoRes updateTodo(Long todoId, TodoUpdateReq todoUpdateReq) {
todoRepository.save(todo);
return TodoRes.builder()
.memberId(todo.getMember().getId())
.todoId(todo.getId())
.content(todo.getContent())
.deadLine(todo.getDeadLine())
.isCompleted(todo.getIsCompleted())
Expand Down

0 comments on commit 469790a

Please sign in to comment.