diff --git a/src/main/java/com/example/demo/app/presentation/controller/GoalController.java b/src/main/java/com/example/demo/app/presentation/controller/GoalController.java index a29e1a1..b83f5a7 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/GoalController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/GoalController.java @@ -49,11 +49,13 @@ public class GoalController { Model model, HttpSession session, Long goalId) { - + LoginModel loginUser = (LoginModel) session.getAttribute("loginUser"); Long userId = loginUser.getUserId(); + goalService.updateGoalComplete(userId); + List goalModelList = goalService.getGoalByUserId(userId); List goalFormList1 = GoalForm.convertFrom(goalModelList); @@ -66,6 +68,10 @@ public class GoalController { "goalFormList", goalFormList); + model.addAttribute( + "achievementList", + new ArrayList()); + if (goalFormList.isEmpty()) { return "goal_view"; } @@ -188,7 +194,8 @@ public class GoalController { month = month.minusMonths(1); } - Collections.reverse(monthlySavingList); + Collections.reverse( + monthlySavingList); List achievementList = new ArrayList<>(); @@ -280,11 +287,11 @@ public class GoalController { goalService.delete(goalId); if (record == null) { - return "redirect:/goal"; + return "redirect:/goal"; } else { return "redirect:/goal/record"; } - + } @SessionCheck diff --git a/src/main/resources/templates/goal_view.html b/src/main/resources/templates/goal_view.html index a7b89ea..26ecdd4 100644 --- a/src/main/resources/templates/goal_view.html +++ b/src/main/resources/templates/goal_view.html @@ -3,6 +3,7 @@ + 目標詳細 @@ -11,14 +12,13 @@ -
+

目標詳細

-

@@ -30,30 +30,28 @@
-
+
-
+
- -
    @@ -114,6 +119,7 @@
    +
    +
    @@ -155,26 +162,29 @@
    + +
    + +
    -
@@ -186,6 +196,7 @@ +
- +