forked from codesquad-members-2022/todo-list
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE-nathan] feat: todoList 화면 출력 기능 구현
- 아직 페이징 기능 미구현 - Section별 카드 정보, 전체 Log 정보를 응답 값으로 반환 Related to #16
- Loading branch information
1 parent
cb487b1
commit d8e3d65
Showing
10 changed files
with
148 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/com/team05/todolist/domain/dto/ClassifiedCardsDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.team05.todolist.domain.dto; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ClassifiedCardsDTO { | ||
|
||
private final Map<String, List<CardDTO>> classifiedCards; | ||
|
||
public ClassifiedCardsDTO() { | ||
this.classifiedCards = new ConcurrentHashMap<>(); | ||
classifiedCards.put("todo", new ArrayList<>()); | ||
classifiedCards.put("doing", new ArrayList<>()); | ||
classifiedCards.put("done", new ArrayList<>()); | ||
} | ||
|
||
public List<CardDTO> get(String section) { | ||
return classifiedCards.get(section); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/com/team05/todolist/domain/dto/ListResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.team05.todolist.domain.dto; | ||
|
||
import java.util.List; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ListResponseDTO { | ||
|
||
private ClassifiedCardsDTO classifiedCardsDTO; | ||
private List<LogDTO> logs; | ||
|
||
public ListResponseDTO(ClassifiedCardsDTO classifiedCardsDTO, List<LogDTO> logs) { | ||
this.classifiedCardsDTO = classifiedCardsDTO; | ||
this.logs = logs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
public interface LogRepository { | ||
|
||
int save(Log log); | ||
List<Log> findAll(); | ||
|
||
List<Log> findAll(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
drop table if exists card; | ||
drop table if exists log; | ||
|
||
CREATE TABLE card ( | ||
id int PRIMARY KEY AUTO_INCREMENT, | ||
order_index int NOT NULL, | ||
delete_yn tinyint(1) NOT NULL, | ||
title varchar(255) NOT NULL, | ||
content varchar(255) NOT NULL, | ||
section enum('todo', 'doing', 'done') NOT NULL | ||
); | ||
|
||
|
||
|
||
CREATE TABLE log ( | ||
id int PRIMARY KEY AUTO_INCREMENT, | ||
event enum('create', 'move', 'delete', 'update') NOT NULL, | ||
title varchar(255) NOT NULL, | ||
log_time dateTime NOT NULL, | ||
prev_section varchar(255), | ||
section varchar(255) NOT NULL | ||
); |