diff --git a/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java b/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java index cd40e22..4595917 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/TodoManager.java @@ -338,6 +338,33 @@ return 1; } + public int setTodo(String accountId, int bookId, int year, int month, int day, int todoId, String title){ + if(!todos.containsKey(accountId)){ + return -1; + } + if(!todos.get(accountId).containsKey(bookId)){ + return -1; + } + if(!todos.get(accountId).get(bookId).containsKey(year)){ + return -1; + } + if(!todos.get(accountId).get(bookId).get(year).containsKey(month)){ + return -1; + } + if(!todos.get(accountId).get(bookId).get(year).get(month).containsKey(day)){ + return -1; + } + if(!todos.get(accountId).get(bookId).get(year).get(month).get(day).containsKey(todoId)){ + return -1; + } + todos.get(accountId).get(bookId).get(year).get(month).get(day).get(todoId).setTitle(title); + todos.get(accountId).get(bookId).get(year).get(month).get(day).get(todoId).setBookId(bookId); + todos.get(accountId).get(bookId).get(year).get(month).get(day).get(todoId).setYear(year); + todos.get(accountId).get(bookId).get(year).get(month).get(day).get(todoId).setMonth(month); + todos.get(accountId).get(bookId).get(year).get(month).get(day).get(todoId).setDay(day); + return 1; + } + /** *todo_idを指定してtodoの達成状態を変更 *