From 41aa5a5b7be402da95f3216118b3cf2446185f1d Mon Sep 17 00:00:00 2001 From: s-morimoto Date: Thu, 24 Sep 2026 10:45:00 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[EDIT]Bootstrap=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/authentication.html | 2 ++ src/main/resources/templates/login.html | 2 ++ src/main/resources/templates/password_reset.html | 2 ++ src/main/resources/templates/profile.html | 2 ++ src/main/resources/templates/profile_edit.html | 2 ++ src/main/resources/templates/user_register.html | 2 ++ src/main/resources/templates/user_register_confirm.html | 2 ++ src/main/resources/templates/user_register_return.html | 2 ++ 8 files changed, 16 insertions(+) diff --git a/src/main/resources/templates/authentication.html b/src/main/resources/templates/authentication.html index d99335e..d9b2341 100644 --- a/src/main/resources/templates/authentication.html +++ b/src/main/resources/templates/authentication.html @@ -4,6 +4,8 @@ 認証 + + diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index b49f376..472e628 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -3,6 +3,8 @@ ログイン + +
diff --git a/src/main/resources/templates/password_reset.html b/src/main/resources/templates/password_reset.html index b2abc42..07d4ffb 100644 --- a/src/main/resources/templates/password_reset.html +++ b/src/main/resources/templates/password_reset.html @@ -3,6 +3,8 @@ パスワード再設定 + + diff --git a/src/main/resources/templates/profile.html b/src/main/resources/templates/profile.html index 0fe082b..8a9c72b 100644 --- a/src/main/resources/templates/profile.html +++ b/src/main/resources/templates/profile.html @@ -3,6 +3,8 @@ プロフィール + + diff --git a/src/main/resources/templates/profile_edit.html b/src/main/resources/templates/profile_edit.html index d82c709..ec7d81e 100644 --- a/src/main/resources/templates/profile_edit.html +++ b/src/main/resources/templates/profile_edit.html @@ -3,6 +3,8 @@ プロフィール編集 + + diff --git a/src/main/resources/templates/user_register.html b/src/main/resources/templates/user_register.html index c6ec36b..dee9c92 100644 --- a/src/main/resources/templates/user_register.html +++ b/src/main/resources/templates/user_register.html @@ -3,6 +3,8 @@ 新規会員登録 + +
diff --git a/src/main/resources/templates/user_register_confirm.html b/src/main/resources/templates/user_register_confirm.html index 5356eb7..581457e 100644 --- a/src/main/resources/templates/user_register_confirm.html +++ b/src/main/resources/templates/user_register_confirm.html @@ -4,6 +4,8 @@ 新規会員登録確認 + + diff --git a/src/main/resources/templates/user_register_return.html b/src/main/resources/templates/user_register_return.html index 4ecd680..04fb234 100644 --- a/src/main/resources/templates/user_register_return.html +++ b/src/main/resources/templates/user_register_return.html @@ -3,6 +3,8 @@ 新規会員登録 + +
From 428cb0fd640bac4b1571967255498a773fb80db1 Mon Sep 17 00:00:00 2001 From: kkazuya Date: Thu, 24 Sep 2026 10:50:39 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[EDIT]=20=E3=82=B3=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E3=81=AE=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=88=E3=82=92=E3=83=90=E3=83=A9=E3=83=B3=E3=82=B9=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=81=AB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3=E6=B8=88=E3=81=BF=E3=81=AE?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=8C=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CourseController.java | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) 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 5a5e2cd..b4e34f8 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 @@ -1,8 +1,5 @@ package com.example.demo.app.presentation.controller; -import java.util.logging.Level; -import java.util.logging.Logger; - import jakarta.servlet.http.HttpSession; import org.springframework.stereotype.Controller; @@ -25,74 +22,53 @@ import lombok.RequiredArgsConstructor; @Controller -//@RequestMapping("/course") @RequiredArgsConstructor public class CourseController { - - private final static Logger LOGGER = Logger.getLogger(CourseController.class.getName()); - // エラーメッセージ用の定数フィールド - private final static String SEVERE_ERROR_MESSAGE = "エラーが発生しました!"; - private final HttpSession httpSession; private final CourseService courseService; private final CourseInfoService courseInfoService; private final UserService userService; - @PostMapping("/course/select/register") + @PostMapping("/user/register/course") public String showSelectCourse(@ModelAttribute UserForm userForm, Model model, HttpSession session) { - try { + - session.setAttribute("userForm", userForm); - model.addAttribute("mode", "regist"); - model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll())); - model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll())); + session.setAttribute("userForm", userForm); + model.addAttribute("mode", "regist"); + model.addAttribute("currentCourseId", 4); + model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll())); + model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll())); + return "select_course"; - return "select_course"; - - } catch (Exception e) { - // ログイン情報の破棄 - httpSession.invalidate(); - - e.printStackTrace(); - - // エラーログ出力 - LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE, e); - // エラー画面遷移 - return null; - } + } @SessionCheck - @GetMapping("/select/change") - public String showChangeCourse(Model model) { + @GetMapping("/course") + public String showChangeCourse(Model model, HttpSession session) { - try { - - model.addAttribute("mode", "change"); - model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll())); - model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll())); - - return "select_course"; - - } catch (Exception e) { - // ログイン情報の破棄 - httpSession.invalidate(); + + LoginModel loginUser = (LoginModel) session.getAttribute("loginUser"); + Long userId = loginUser.getUserId(); + + Long currentCourseId = userService.findByUserId(userId).getCourseId(); + model.addAttribute("mode", "change"); + model.addAttribute("currentCourseId", currentCourseId); + model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll())); + model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll())); + - e.printStackTrace(); - - // エラーログ出力 - LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE, e); - // エラー画面遷移 - return null; - } + return "select_course"; + + } @SessionCheck @PostMapping("/change") - public String changeCourse(@RequestParam Long courseId) { + public String changeCourse(@RequestParam Long courseId, HttpSession httpSession) { LoginModel loginUser = (LoginModel) httpSession.getAttribute("loginUser"); From 6fb4ac0161fd1cd9f37c02dad83d67f284c0ce88 Mon Sep 17 00:00:00 2001 From: kkazuya Date: Thu, 24 Sep 2026 10:51:49 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[EDIT]=20=E3=82=B3=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E7=94=BB=E9=9D=A2=E3=81=B8=E3=81=AE=E3=83=98?= =?UTF-8?q?=E3=83=83=E3=83=80=E3=83=BC=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=81=A8?= =?UTF-8?q?=E3=80=81=E3=83=A9=E3=82=B8=E3=82=AA=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=AEchecked=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/select_course.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/templates/select_course.html b/src/main/resources/templates/select_course.html index 7fbda20..505f1dc 100644 --- a/src/main/resources/templates/select_course.html +++ b/src/main/resources/templates/select_course.html @@ -7,6 +7,7 @@ コース選択 +

コース選択

@@ -17,7 +18,7 @@

- + From f10f9f83de06b241887b2939041af403c4a7d54a Mon Sep 17 00:00:00 2001 From: kkazuya Date: Thu, 24 Sep 2026 10:52:52 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[EDIT]=20URL=E3=83=91=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=83=B3=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/user_register.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/user_register.html b/src/main/resources/templates/user_register.html index dee9c92..1bdb65c 100644 --- a/src/main/resources/templates/user_register.html +++ b/src/main/resources/templates/user_register.html @@ -13,7 +13,7 @@

新規会員登録

-
+
Date: Thu, 24 Sep 2026 10:55:03 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[EDIT]=E8=AA=8D=E8=A8=BC=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=83=83=E3=82=BF=E3=83=BC=E3=81=AE=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/authentication.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/templates/authentication.html b/src/main/resources/templates/authentication.html index d9b2341..4ea2f8e 100644 --- a/src/main/resources/templates/authentication.html +++ b/src/main/resources/templates/authentication.html @@ -54,8 +54,6 @@ alert(/*[[${errorMessage}]]*/); -
-
From 2139cad2b7c55d285c704c35f17b8dd74b6e4bc0 Mon Sep 17 00:00:00 2001 From: kkazuya Date: Thu, 24 Sep 2026 11:05:26 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[EDIT]=20=E3=82=B3=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E7=94=BB=E9=9D=A2=E3=81=AE=E3=81=BF=E3=83=95?= =?UTF-8?q?=E3=83=83=E3=82=BF=E3=83=BC=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/select_course.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/templates/select_course.html b/src/main/resources/templates/select_course.html index 505f1dc..6f3aa5c 100644 --- a/src/main/resources/templates/select_course.html +++ b/src/main/resources/templates/select_course.html @@ -41,6 +41,10 @@
+ +
+
+ \ No newline at end of file