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/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; 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"; diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 399873b..8632b09 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -46,6 +46,10 @@ body { border-top: 1px solid #d0d7de; } +.a-footer { + text-decoration: none; +} + /* ======================= カード ======================= */ @@ -178,6 +182,10 @@ td:hover { text-align: right; } +.a-calender { + text-decoration: none; +} + /* ======================= 金額表示 ======================= */ diff --git a/src/main/resources/templates/analysis.html b/src/main/resources/templates/analysis.html index dd88457..dfbe44f 100644 --- a/src/main/resources/templates/analysis.html +++ b/src/main/resources/templates/analysis.html @@ -47,7 +47,7 @@ 0 - 食費 - 0 = 0} - ? '+' + ${category.courseDifferenceAmount} + ? '+' + ${category.courseDifferenceAmount} : ${category.courseDifferenceAmount}" th:class="${category.courseDifferenceAmount >= 0} ? 'text-danger' diff --git a/src/main/resources/templates/footer.html b/src/main/resources/templates/footer.html index 8e446ef..450bdfa 100644 --- a/src/main/resources/templates/footer.html +++ b/src/main/resources/templates/footer.html @@ -15,22 +15,22 @@
diff --git a/src/main/resources/templates/menu.html b/src/main/resources/templates/menu.html index 4b4b6b3..ba31ed3 100644 --- a/src/main/resources/templates/menu.html +++ b/src/main/resources/templates/menu.html @@ -8,10 +8,9 @@ Calendar - - + @@ -64,7 +63,7 @@ + )}" class="a-footer">
コース選択 - +

コース選択

diff --git a/src/main/resources/templates/transaction_create.html b/src/main/resources/templates/transaction_create.html index 8f06bd9..53e3bd3 100644 --- a/src/main/resources/templates/transaction_create.html +++ b/src/main/resources/templates/transaction_create.html @@ -3,10 +3,9 @@ - 取引登録 - - + + 取引登録 @@ -125,7 +124,7 @@ if (tType == "0") { transactionType.value = 0; - } else { + } else if (tType == "1") { transactionType.value = 1; }