10 Commits

11 changed files with 36 additions and 26 deletions

View File

@@ -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("不正なログインです");
}

View File

@@ -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;
}
}

View File

@@ -25,6 +25,8 @@ public class LoginServiceImpl implements LoginService {
if (userEntity == null) {
return null;
} else if (userEntity.getDeleteFlag() == 1) {
return null;
}
boolean isValidPassword = false;

View File

@@ -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;
}

View File

@@ -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";

View File

@@ -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;
}
/* =======================
金額表示
======================= */

View File

@@ -47,7 +47,7 @@
0
</td>
<td th:text="${analysisForm.totalDifferenceAmount >= 0}
? '+' + ${analysisForm.totalDifferenceAmount}
? '+' + ${analysisForm.totalDifferenceAmount}
: ${analysisForm.totalDifferenceAmount}"
th:class="${analysisForm.totalDifferenceAmount >= 0}
? 'text-danger'
@@ -73,16 +73,14 @@
<th scope="row"
th:text="${category.categoryName}">
食費
</th>
<td th:text="'¥' + ${category.currentMonthAmount}">
0
</td>
<td>
<span th:text="${category.monthDifferenceAmount >= 0}
? '+' + ${category.monthDifferenceAmount}
? '+' + ${category.monthDifferenceAmount}
: ${category.monthDifferenceAmount}"
th:class="${category.monthDifferenceAmount >= 0}
? 'text-danger'
@@ -90,7 +88,7 @@
</span>
<br>
<span th:text="${category.courseDifferenceAmount >= 0}
? '+' + ${category.courseDifferenceAmount}
? '+' + ${category.courseDifferenceAmount}
: ${category.courseDifferenceAmount}"
th:class="${category.courseDifferenceAmount >= 0}
? 'text-danger'

View File

@@ -15,22 +15,22 @@
<div class="row">
<div class="col border-end">
<button type="button" class="btn btn-link text-black text-decoration-none">
<a th:href="@{/transaction/create}">入力</a>
<a th:href="@{/transaction/create}" class="a-footer">入力</a>
</button>
</div>
<div class="col border-end">
<button type="button" class="btn btn-link text-black text-decoration-none">
<a th:href="@{/transaction/list}">一覧</a>
<a th:href="@{/transaction/list}" class="a-footer">一覧</a>
</button>
</div>
<div class="col border-end">
<button type="button" class="btn btn-link text-black text-decoration-none">
<a th:href="@{/analysis}">分析</a>
<a th:href="@{/analysis}" class="a-footer">分析</a>
</button>
</div>
<div class="col border-end">
<button type="button" class="btn btn-link text-black text-decoration-none">
<a th:href="@{/goal}">目標</a>
<a th:href="@{/goal}" class="a-footer">目標</a>
</button>
</div>
</div>

View File

@@ -8,10 +8,9 @@
<title>Calendar</title>
<link rel="stylesheet" th:href="@{/css/style.css}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" th:href="@{/css/style.css}">
</head>
<body>
@@ -64,7 +63,7 @@
<a th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1
and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}" th:href="@{/transaction/detail(
todayDates=${T(java.time.LocalDate).of(year, month, week * 7 + weekDay - firstDayOfWeek + 1)}
)}">
)}" class="a-footer">
<div

View File

@@ -9,7 +9,7 @@
<title>コース選択</title>
</head>
<body style="padding-bottom: 120px; padding-top: 60px;">
<body style="padding-bottom: 120px; padding-top: 80px;">
<div th:replace="~{header :: header}"></div>
<h1 class="page-title">コース選択</h1>

View File

@@ -3,10 +3,9 @@
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1" http-equiv="Content-Type">
<title>取引登録</title>
<link rel="stylesheet" th:href="@{/css/menu.css}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" th:href="@{/css/style.css}">
<title>取引登録</title>
</head>
<body style="padding-top:80px; padding-bottom:80px;">
@@ -125,7 +124,7 @@
if (tType == "0") {
transactionType.value = 0;
} else {
} else if (tType == "1") {
transactionType.value = 1;
}