Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi
This commit is contained in:
@@ -71,6 +71,11 @@ public class UserController {
|
||||
HttpSession session) {
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, (String) session.getAttribute("selectedCourseName"));
|
||||
|
||||
session.setAttribute("questionId", userForm.getSecretQuestionId());
|
||||
|
||||
System.out.println("return questionId: ****************************:" + userForm.getSecretQuestionId());
|
||||
|
||||
return TransitionTargetPageNameKeyword.USER_RESISTER_CONFIRM_HTML;
|
||||
|
||||
}
|
||||
@@ -83,6 +88,12 @@ public class UserController {
|
||||
|
||||
Long courseId = courseService.findByName((String) session.getAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME));
|
||||
|
||||
Long questionId = (Long) session.getAttribute("questionId");
|
||||
|
||||
System.out.println("confirm questionId: ****************************:" + questionId);
|
||||
|
||||
userForm.setSecretQuestionId(questionId);
|
||||
|
||||
userService.register(userForm, courseId);
|
||||
|
||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.LOGIN;
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li th:each="goalForm : ${goalFormList}" class="transaction-item">
|
||||
<li th:each="goalForm : ${goalFormList}">
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
|
||||
@@ -3,16 +3,13 @@
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>新規会員登録</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet">
|
||||
<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}">
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||
</head>
|
||||
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
@@ -30,83 +27,55 @@
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<form th:action="@{/user/register/course}"
|
||||
th:object="${userForm}"
|
||||
method="post">
|
||||
<form th:action="@{/user/register/course}" th:object="${userForm}" method="post">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="userName"
|
||||
class="form-label">
|
||||
<label for="userName" class="form-label">
|
||||
氏名
|
||||
</label>
|
||||
|
||||
<input type="text"
|
||||
id="userName"
|
||||
class="form-control"
|
||||
th:field="*{userName}"
|
||||
maxlength="100"
|
||||
<input type="text" id="userName" class="form-control" th:field="*{userName}" maxlength="100"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mailAddress"
|
||||
class="form-label">
|
||||
<label for="mailAddress" class="form-label">
|
||||
メールアドレス
|
||||
</label>
|
||||
|
||||
<input type="email"
|
||||
id="mailAddress"
|
||||
class="form-control"
|
||||
th:field="*{mailAddress}"
|
||||
maxlength="255"
|
||||
required>
|
||||
<input type="email" id="mailAddress" class="form-control" th:field="*{mailAddress}"
|
||||
maxlength="255" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="birthDate"
|
||||
class="form-label">
|
||||
<label for="birthDate" class="form-label">
|
||||
生年月日
|
||||
</label>
|
||||
|
||||
<input type="date"
|
||||
id="birthDate"
|
||||
class="form-control"
|
||||
th:field="*{birthDate}"
|
||||
required>
|
||||
<input type="date" id="birthDate" class="form-control" th:field="*{birthDate}" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="password"
|
||||
class="form-label">
|
||||
<label for="password" class="form-label">
|
||||
パスワード
|
||||
</label>
|
||||
|
||||
<input type="password"
|
||||
id="password"
|
||||
class="form-control"
|
||||
th:field="*{password}"
|
||||
minlength="8"
|
||||
maxlength="24"
|
||||
required>
|
||||
<input type="password" id="password" class="form-control" th:field="*{password}" minlength="8"
|
||||
maxlength="24" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="secretQuestionId"
|
||||
class="form-label">
|
||||
<label for="secretQuestionId" class="form-label">
|
||||
秘密の質問
|
||||
</label>
|
||||
|
||||
<select id="secretQuestionId"
|
||||
class="form-select"
|
||||
th:field="*{secretQuestionId}"
|
||||
required>
|
||||
<select id="secretQuestionId" class="form-select" th:field="*{secretQuestionId}" required>
|
||||
|
||||
<option value="">
|
||||
選択してください
|
||||
</option>
|
||||
|
||||
<option th:each="question : ${session.questionList}"
|
||||
th:value="${question.secretQuestionId}"
|
||||
<option th:each="question : ${session.questionList}" th:value="${question.secretQuestionId}"
|
||||
th:text="${question.questionText}">
|
||||
</option>
|
||||
|
||||
@@ -114,91 +83,59 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="secretAnswer"
|
||||
class="form-label">
|
||||
<label for="secretAnswer" class="form-label">
|
||||
秘密の質問の回答
|
||||
</label>
|
||||
|
||||
<input type="text"
|
||||
id="secretAnswer"
|
||||
class="form-control"
|
||||
th:field="*{secretAnswer}"
|
||||
maxlength="100"
|
||||
required>
|
||||
<input type="text" id="secretAnswer" class="form-control" th:field="*{secretAnswer}"
|
||||
maxlength="100" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="saving"
|
||||
class="form-label">
|
||||
<label for="saving" class="form-label">
|
||||
貯蓄金
|
||||
</label>
|
||||
|
||||
<input type="number"
|
||||
id="saving"
|
||||
class="form-control"
|
||||
th:field="*{saving}"
|
||||
min="0"
|
||||
max="1000000000"
|
||||
required>
|
||||
<input type="number" id="saving" class="form-control" th:field="*{saving}" min="0"
|
||||
max="1000000000" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="annualIncome"
|
||||
class="form-label">
|
||||
<label for="annualIncome" class="form-label">
|
||||
年収
|
||||
</label>
|
||||
|
||||
<input type="number"
|
||||
id="annualIncome"
|
||||
class="form-control"
|
||||
th:field="*{annualIncome}"
|
||||
min="0"
|
||||
max="100000000"
|
||||
required>
|
||||
<input type="number" id="annualIncome" class="form-control" th:field="*{annualIncome}" min="0"
|
||||
max="100000000" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="monthlyBudget"
|
||||
class="form-label">
|
||||
<label for="monthlyBudget" class="form-label">
|
||||
月別使用可能金額
|
||||
</label>
|
||||
|
||||
<input type="number"
|
||||
id="monthlyBudget"
|
||||
class="form-control"
|
||||
th:field="*{monthlyBudget}"
|
||||
min="0"
|
||||
max="10000000"
|
||||
required>
|
||||
<input type="number" id="monthlyBudget" class="form-control" th:field="*{monthlyBudget}" min="0"
|
||||
max="10000000" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="goalId"
|
||||
class="form-label">
|
||||
<label for="goalId" class="form-label">
|
||||
目標貯金額
|
||||
</label>
|
||||
|
||||
<input type="number"
|
||||
id="goalId"
|
||||
class="form-control"
|
||||
th:field="*{goalId}"
|
||||
min="0"
|
||||
max="1000000000"
|
||||
required>
|
||||
<input type="number" id="goalId" class="form-control" th:field="*{goalId}" min="0"
|
||||
max="1000000000" required>
|
||||
</div>
|
||||
|
||||
<input type="hidden"
|
||||
th:field="*{courseId}">
|
||||
<input type="hidden" th:field="*{courseId}">
|
||||
|
||||
<div class="d-grid gap-2 mt-4">
|
||||
|
||||
<button type="submit"
|
||||
class="btn btn-outline-primary">
|
||||
<button type="submit" class="btn btn-outline-primary">
|
||||
コース選択
|
||||
</button>
|
||||
|
||||
<button type="submit"
|
||||
class="btn btn-primary">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
作成
|
||||
</button>
|
||||
|
||||
@@ -212,11 +149,9 @@
|
||||
|
||||
<div class="d-grid mt-3">
|
||||
|
||||
<form th:action="@{/login}"
|
||||
method="get">
|
||||
<form th:action="@{/login}" method="get">
|
||||
|
||||
<button type="submit"
|
||||
class="btn btn-outline-secondary">
|
||||
<button type="submit" class="btn btn-outline-secondary">
|
||||
戻る
|
||||
</button>
|
||||
|
||||
@@ -226,6 +161,34 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const date = new Date();
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
|
||||
const birthDate = document.getElementById("birthDate");
|
||||
|
||||
if (month < 10) {
|
||||
if (day < 10) {
|
||||
birthDate.setAttribute("max", year + "-0" + month + "-0" + day);
|
||||
} else {
|
||||
birthDate.setAttribute("max", year + "-0" + month + "-" + day);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (day < 10) {
|
||||
birthDate.setAttribute("max", year + "-" + month + "-0" + day);
|
||||
} else {
|
||||
birthDate.setAttribute("max", year + "-" + month + "-" + day);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -44,10 +44,10 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="secretQuestionId" class="form-label">秘密の質問</label>
|
||||
<select id="secretQuestionId" th:field="*{secretQuestionId}" required readonly>
|
||||
<option value="">選択してください</option>
|
||||
<select id="secretQuestionId" th:field="*{secretQuestionId}" required disabled>
|
||||
<option value="" readonly>選択してください</option>
|
||||
<option th:each="question : ${session.questionList}" th:value="${question.secretQuestionId}"
|
||||
th:text="${question.questionText}">
|
||||
th:text="${question.questionText}" readonly>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -82,7 +82,7 @@
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<input type="hidden" class="form-control" th:field="*{courseId}">
|
||||
<span th:text="${selectedCourseName}">未選択</span>
|
||||
<button type="submit" class="btn btn-outline-primary btn-sm">コース選択</button>
|
||||
<button type="submit" class="btn btn-outline-primary btn-sm" disabled>コース選択</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1" http-equiv="Content-Type">
|
||||
<title>新規会員登録</title>
|
||||
@@ -7,6 +8,7 @@
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div th:replace="~{header :: header}">
|
||||
</div>
|
||||
@@ -22,22 +24,14 @@
|
||||
<form th:action="@{/user/register/confirm}" th:object="${userForm}" method="get">
|
||||
<div class="mb-3">
|
||||
<label for="userName" class="form-label">氏名</label>
|
||||
<input type="text"
|
||||
id="userName"
|
||||
class="form-control"
|
||||
th:field="*{userName}"
|
||||
maxlength="100"
|
||||
<input type="text" id="userName" class="form-control" th:field="*{userName}" maxlength="100"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mailAddress" class="form-label">メールアドレス</label>
|
||||
<input type="email"
|
||||
id="mailAddress"
|
||||
class="form-control"
|
||||
th:field="*{mailAddress}"
|
||||
maxlength="255"
|
||||
required>
|
||||
<input type="email" id="mailAddress" class="form-control" th:field="*{mailAddress}"
|
||||
maxlength="255" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@@ -48,24 +42,15 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">パスワード</label>
|
||||
<input type="password"
|
||||
id="password"
|
||||
name="password"
|
||||
class="form-control"
|
||||
th:value="*{password}"
|
||||
minlength="8"
|
||||
maxlength="24"
|
||||
required>
|
||||
<input type="password" id="password" name="password" class="form-control" th:value="*{password}"
|
||||
minlength="8" maxlength="24" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="secretQuestionId" class="form-label">秘密の質問</label>
|
||||
<select id="secretQuestionId"
|
||||
th:field="*{secretQuestionId}"
|
||||
required>
|
||||
<select id="secretQuestionId" th:field="*{secretQuestionId}" required>
|
||||
<option value="">選択してください</option>
|
||||
<option th:each="question : ${session.questionList}"
|
||||
th:value="${question.secretQuestionId}"
|
||||
<option th:each="question : ${session.questionList}" th:value="${question.secretQuestionId}"
|
||||
th:text="${question.questionText}">
|
||||
</option>
|
||||
</select>
|
||||
@@ -73,52 +58,30 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="secretAnswer" class="form-label">秘密の質問の回答</label>
|
||||
<input type="text"
|
||||
id="secretAnswer"
|
||||
class="form-control"
|
||||
th:field="*{secretAnswer}"
|
||||
maxlength="100"
|
||||
required>
|
||||
<input type="text" id="secretAnswer" class="form-control" th:field="*{secretAnswer}"
|
||||
maxlength="100" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="saving" class="form-label">貯蓄金</label>
|
||||
<input type="number"
|
||||
id="saving"
|
||||
class="form-control"
|
||||
th:field="*{saving}"
|
||||
min="0"
|
||||
required>
|
||||
<input type="number" id="saving" class="form-control" th:field="*{saving}" min="0" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="annualIncome" class="form-label">年収</label>
|
||||
<input type="number"
|
||||
id="annualIncome"
|
||||
class="form-control"
|
||||
th:field="*{annualIncome}"
|
||||
min="0"
|
||||
<input type="number" id="annualIncome" class="form-control" th:field="*{annualIncome}" min="0"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="monthlyBudget" class="form-label">月別使用可能金額</label>
|
||||
<input type="number"
|
||||
id="monthlyBudget"
|
||||
class="form-control"
|
||||
th:field="*{monthlyBudget}"
|
||||
min="0"
|
||||
<input type="number" id="monthlyBudget" class="form-control" th:field="*{monthlyBudget}" min="0"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="goalId" class="form-label">目標</label>
|
||||
<input type="number"
|
||||
id="goalId"
|
||||
class="form-control"
|
||||
th:field="*{goalId}"
|
||||
min="0"
|
||||
required>
|
||||
<input type="number" id="goalId" class="form-control" th:field="*{goalId}" min="0" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
@@ -126,7 +89,7 @@
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<input type="hidden" th:field="*{courseId}">
|
||||
<span th:text="${selectedCourseName}">未選択</span>
|
||||
<button type="submit" class="btn btn-outline-primary btn-sm">
|
||||
<button class="btn btn-outline-primary btn-sm" disabled>
|
||||
コース選択
|
||||
</button>
|
||||
</div>
|
||||
@@ -149,5 +112,34 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const date = new Date();
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
|
||||
const birthDate = document.getElementById("birthDate");
|
||||
|
||||
if (month < 10) {
|
||||
if (day < 10) {
|
||||
birthDate.setAttribute("max", year + "-0" + month + "-0" + day);
|
||||
} else {
|
||||
birthDate.setAttribute("max", year + "-0" + month + "-" + day);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (day < 10) {
|
||||
birthDate.setAttribute("max", year + "-" + month + "-0" + day);
|
||||
} else {
|
||||
birthDate.setAttribute("max", year + "-" + month + "-" + day);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user