diff --git a/src/main/java/com/example/demo/app/presentation/controller/CourseController.java b/src/main/java/com/example/demo/app/presentation/controller/CourseController.java index 6166a96..a9b92e4 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/CourseController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/CourseController.java @@ -125,15 +125,6 @@ public class CourseController { List allocationModelList = new ArrayList<>(); - allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId1(), - (Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID), - allocationFormList.getAllocationRatio1())); - allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId2(), - (Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID), - allocationFormList.getAllocationRatio2())); - allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId3(), - (Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID), - allocationFormList.getAllocationRatio3())); allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId4(), (Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID), allocationFormList.getAllocationRatio4())); diff --git a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java index b81c0ff..7a0f253 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java @@ -238,8 +238,8 @@ public class TransactionController { model.addAttribute(PageReturnAttributeKeyword.TRANSACTION_FORM, transactionForm); - session.setAttribute("tType", String.valueOf(transactionForm.getTransactionType())); - + session.setAttribute(SessionKeyword.T_TYPE, String.valueOf(transactionForm.getTransactionType())); + model.addAttribute(PageReturnAttributeKeyword.CATEGORY_FORM_LIST, categoryFormList); model.addAttribute(PageReturnAttributeKeyword.TODAY, today.format(DateTimeFormatter.ISO_LOCAL_DATE)); diff --git a/src/main/java/com/example/demo/app/presentation/controller/UserController.java b/src/main/java/com/example/demo/app/presentation/controller/UserController.java index 2c3eb8e..d09f9ae 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/UserController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/UserController.java @@ -16,6 +16,7 @@ import com.example.demo.app.domain.service.QuestionService; import com.example.demo.app.domain.service.UserService; import com.example.demo.app.infra.entity.QuestionEntity; import com.example.demo.app.presentation.controller.pageproperty.PageReturnAttributeKeyword; +import com.example.demo.app.presentation.controller.pageproperty.SessionKeyword; import com.example.demo.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword; import com.example.demo.app.presentation.form.UserForm; @@ -58,7 +59,7 @@ public class UserController { model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName()); } - session.setAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName()); + session.setAttribute(SessionKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName()); model.addAttribute(PageReturnAttributeKeyword.COURSE_ID, courseId); model.addAttribute(PageReturnAttributeKeyword.USER_FORM, userForm); @@ -70,11 +71,9 @@ public class UserController { String selectedCourseName, Model model, HttpSession session) { - model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, (String) session.getAttribute("selectedCourseName")); + model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, (String) session.getAttribute(SessionKeyword.SELECTED_COURSE_NAME)); - session.setAttribute("questionId", userForm.getSecretQuestionId()); - - System.out.println("return questionId: ****************************:" + userForm.getSecretQuestionId()); + session.setAttribute(SessionKeyword.QUESTION_ID, userForm.getSecretQuestionId()); return TransitionTargetPageNameKeyword.USER_RESISTER_CONFIRM_HTML; @@ -86,11 +85,9 @@ public class UserController { Model model, HttpSession session) { - Long courseId = courseService.findByName((String) session.getAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME)); + Long courseId = courseService.findByName((String) session.getAttribute(SessionKeyword.SELECTED_COURSE_NAME)); - Long questionId = (Long) session.getAttribute("questionId"); - - System.out.println("confirm questionId: ****************************:" + questionId); + Long questionId = (Long) session.getAttribute(SessionKeyword.QUESTION_ID); userForm.setSecretQuestionId(questionId); diff --git a/src/main/java/com/example/demo/app/presentation/controller/pageproperty/SessionKeyword.java b/src/main/java/com/example/demo/app/presentation/controller/pageproperty/SessionKeyword.java index b9ee3cc..ca9f1dd 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/pageproperty/SessionKeyword.java +++ b/src/main/java/com/example/demo/app/presentation/controller/pageproperty/SessionKeyword.java @@ -3,4 +3,10 @@ package com.example.demo.app.presentation.controller.pageproperty; public class SessionKeyword { // SESSION情報として格納したいログイン者の情報 public static final String LOGIN_USER = "loginUser"; + + public static final String SELECTED_COURSE_NAME = "selectedCourseName"; + + public static final String QUESTION_ID = "questionId"; + + public static final String T_TYPE = "tType"; } diff --git a/src/main/resources/templates/category_create.html b/src/main/resources/templates/category_create.html index 3a42e92..e91ecd6 100644 --- a/src/main/resources/templates/category_create.html +++ b/src/main/resources/templates/category_create.html @@ -25,7 +25,7 @@
- +

@@ -33,7 +33,7 @@
- diff --git a/src/main/resources/templates/category_update.html b/src/main/resources/templates/category_update.html index f69ad72..71497e2 100644 --- a/src/main/resources/templates/category_update.html +++ b/src/main/resources/templates/category_update.html @@ -25,7 +25,7 @@
- +

@@ -33,7 +33,7 @@
- diff --git a/src/main/resources/templates/course_create.html b/src/main/resources/templates/course_create.html index dd2f12a..6a1257d 100644 --- a/src/main/resources/templates/course_create.html +++ b/src/main/resources/templates/course_create.html @@ -23,7 +23,7 @@
- +

diff --git a/src/main/resources/templates/course_create_ratio.html b/src/main/resources/templates/course_create_ratio.html index 0ec7ccb..ad7df48 100644 --- a/src/main/resources/templates/course_create_ratio.html +++ b/src/main/resources/templates/course_create_ratio.html @@ -22,86 +22,70 @@
-
- - -
- -
- -
- - -
- -
- -
- - -
- -
-
- +

- +

- +

- +

- +

- +

- +

- + +
+ +
+ +

- +
@@ -110,7 +94,27 @@
- + + diff --git a/src/main/resources/templates/fixed_cost_create.html b/src/main/resources/templates/fixed_cost_create.html index c6397e9..0c478d1 100644 --- a/src/main/resources/templates/fixed_cost_create.html +++ b/src/main/resources/templates/fixed_cost_create.html @@ -40,8 +40,8 @@
@@ -70,7 +70,7 @@
-
@@ -94,7 +94,7 @@ transactionType.addEventListener("change", function () { - if (this.value === "1") { + if (this.value === "0") { for (let i = 0; i < expenseList.length; i++) { expenseList[i].style.display = ""; @@ -104,7 +104,7 @@ incomeList[i].style.display = "none"; } - } else if (this.value === "2") { + } else if (this.value === "1") { for (let i = 0; i < expenseList.length; i++) { expenseList[i].style.display = "none"; diff --git a/src/main/resources/templates/goal_create.html b/src/main/resources/templates/goal_create.html index 2057470..d3d8de2 100644 --- a/src/main/resources/templates/goal_create.html +++ b/src/main/resources/templates/goal_create.html @@ -26,12 +26,12 @@
- +
- +
diff --git a/src/main/resources/templates/transaction_create.html b/src/main/resources/templates/transaction_create.html index 760047b..8f06bd9 100644 --- a/src/main/resources/templates/transaction_create.html +++ b/src/main/resources/templates/transaction_create.html @@ -45,11 +45,11 @@ 選択してください - - @@ -124,15 +124,15 @@ const tType = '[[${session.tType}]]'; if (tType == "0") { - transactionType.value = 1; + transactionType.value = 0; } else { - transactionType.value = 2; + transactionType.value = 1; } transactionType.addEventListener("change", function () { - if (this.value === "1") { + if (this.value === "0") { for (let i = 0; i < expenseList.length; i++) { expenseList[i].style.display = ""; @@ -142,7 +142,7 @@ incomeList[i].style.display = "none"; } - } else if (this.value === "2") { + } else if (this.value === "1") { for (let i = 0; i < expenseList.length; i++) { expenseList[i].style.display = "none";