From f5c410b352cdd559f99f30359d36f6fbd368cc44 Mon Sep 17 00:00:00 2001 From: s-choi Date: Tue, 29 Sep 2026 11:31:25 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[FIX]=20=E8=84=B1=E9=80=80=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=82=89=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=97=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 --- .../example/demo/app/domain/service/impl/LoginServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/example/demo/app/domain/service/impl/LoginServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/LoginServiceImpl.java index 26ef947..d11347e 100644 --- a/src/main/java/com/example/demo/app/domain/service/impl/LoginServiceImpl.java +++ b/src/main/java/com/example/demo/app/domain/service/impl/LoginServiceImpl.java @@ -25,6 +25,8 @@ public class LoginServiceImpl implements LoginService { if (userEntity == null) { return null; + } else if (userEntity.getDeleteFlag() == 1) { + return null; } boolean isValidPassword = false; From 0b9eff82c54b800c247d0c2ca3405af4b742256b Mon Sep 17 00:00:00 2001 From: kkazuya Date: Tue, 29 Sep 2026 13:06:31 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[EDIT]=20=E4=BA=8C=E6=AC=A1=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=81=AB=E4=BC=B4=E3=81=86=E5=AE=9A=E6=95=B0=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=A8=E3=80=81AOP=E3=81=AE=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E3=82=82=E5=AE=9A=E6=95=B0=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=82=92=E5=8F=82=E7=85=A7=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E7=B7=A8=E9=9B=86=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 --- .../demo/aop/aspect/SessionCheckAspect.java | 3 ++- .../demo/aop/handler/GlobalExceptionHandler.java | 14 ++++++++------ .../presentation/controller/GoalController.java | 2 +- .../pageproperty/PageReturnAttributeKeyword.java | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/example/demo/aop/aspect/SessionCheckAspect.java b/src/main/java/com/example/demo/aop/aspect/SessionCheckAspect.java index 3043c98..37faa6d 100644 --- a/src/main/java/com/example/demo/aop/aspect/SessionCheckAspect.java +++ b/src/main/java/com/example/demo/aop/aspect/SessionCheckAspect.java @@ -10,6 +10,7 @@ import org.aspectj.lang.annotation.Pointcut; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.example.demo.app.presentation.controller.pageproperty.SessionKeyword; import com.example.demo.exception.NoSessionException; @@ -32,7 +33,7 @@ public class SessionCheckAspect { public void checkSession() { HttpSession session = request.getSession(false); - if (session == null || session.getAttribute("loginUser") == null) { + if (session == null || session.getAttribute(SessionKeyword.LOGIN_USER) == null) { throw new NoSessionException("不正なログインです"); } diff --git a/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java b/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java index 2814100..83554ed 100644 --- a/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java +++ b/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java @@ -12,6 +12,8 @@ import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; +import com.example.demo.app.presentation.controller.pageproperty.PageReturnAttributeKeyword; +import com.example.demo.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword; import com.example.demo.exception.NoSessionException; @ControllerAdvice @@ -30,18 +32,18 @@ public class GlobalExceptionHandler { LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e); model.addAttribute( - "errorMessage", + PageReturnAttributeKeyword.ERROR_MESSAGE, "システムエラーが発生しました。" + "初めからやり直してください。"); - return "redirect:/login"; + return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.LOGIN; } @ExceptionHandler(HttpRequestMethodNotSupportedException.class) public String handleBadRequestException(Model model, Exception e, HttpSession session) { - model.addAttribute("error", SEVERE_ERROR_MESSAGE_BAD_REQUEST); - model.addAttribute("status", HttpStatus.BAD_REQUEST.value()); + model.addAttribute(PageReturnAttributeKeyword.ERROR, SEVERE_ERROR_MESSAGE_BAD_REQUEST); + model.addAttribute(PageReturnAttributeKeyword.STATUS, HttpStatus.BAD_REQUEST.value()); e.printStackTrace(); @@ -50,7 +52,7 @@ public class GlobalExceptionHandler { System.out.println("session invalidated"); session.invalidate(); - return "error"; + return TransitionTargetPageNameKeyword.ERROR_HTML; } @ExceptionHandler(Exception.class) @@ -60,6 +62,6 @@ public class GlobalExceptionHandler { System.out.println("session invalidated exception"); session.invalidate(); - return "error"; + return TransitionTargetPageNameKeyword.ERROR_HTML; } } 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 cb7ee49..2ced072 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 @@ -275,7 +275,7 @@ public class GoalController { int currentAmount = goalService.getCurrentAmount(userId); - model.addAttribute("currentAmount", currentAmount); + model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount); return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML; } diff --git a/src/main/java/com/example/demo/app/presentation/controller/pageproperty/PageReturnAttributeKeyword.java b/src/main/java/com/example/demo/app/presentation/controller/pageproperty/PageReturnAttributeKeyword.java index 3b0a32a..1b89364 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/pageproperty/PageReturnAttributeKeyword.java +++ b/src/main/java/com/example/demo/app/presentation/controller/pageproperty/PageReturnAttributeKeyword.java @@ -4,7 +4,8 @@ public class PageReturnAttributeKeyword { public static final String ERROR_MESSAGE = "errorMessage"; public static final String MESSAGE = "message"; - + public static final String ERROR = "error"; + public static final String STATUS = "status"; public static final String QUESTION_LIST = "questionList"; public static final String USER_FORM = "userForm"; From fd1b098e3c61de0182fac65020a903a21fe2a3ba Mon Sep 17 00:00:00 2001 From: kkazuya Date: Tue, 29 Sep 2026 13:15:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[FIX]=20=E5=8F=96=E5=BC=95=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=81=AE=E5=8F=8E=E6=94=AF=E5=8C=BA=E5=88=86=E3=81=AE?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=80=A4=E3=82=92=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/transaction_create.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/transaction_create.html b/src/main/resources/templates/transaction_create.html index 8f06bd9..ac9d084 100644 --- a/src/main/resources/templates/transaction_create.html +++ b/src/main/resources/templates/transaction_create.html @@ -125,7 +125,7 @@ if (tType == "0") { transactionType.value = 0; - } else { + } else if (tType == "1") { transactionType.value = 1; }