diff --git a/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java b/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java index 22ee382..38d8fa5 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java @@ -56,15 +56,8 @@ * @param month 月 * @return そのアカウントの本に所属するtodoのうち、指定した年月のtodoを返します */ - public HashMap getTodosByMonth(String accountId, int bookId, int year, int month, String token){ - HashMap result = new HashMap<>(); - var yearMonthMap = todos.get(accountId).get(bookId).get(year).get(month); - for(var dayValues : yearMonthMap.values()){ - for(int todoId : dayValues.keySet()){ - result.put(todoId, dayValues.get(todoId)); - } - } - return result; + public HashMap> getTodosByMonth(String accountId, int bookId, int year, int month, String token){ + return todos.get(accountId).get(bookId).get(year).get(month); } /** @@ -75,7 +68,7 @@ * @param yearMonth 年月を-で区切った文字列(yyyy-mm) * @return そのアカウントの本に所属するtodoのうち、指定した年月のtodoを返します */ - public HashMap getTodosByMonth(String accountId, int bookId, String yearMonth, String token){ + public HashMap> getTodosByMonth(String accountId, int bookId, String yearMonth, String token){ String[] yearMonths = yearMonth.split("-"); int year = Integer.parseInt(yearMonths[0]); int month = Integer.parseInt(yearMonths[1]);