This commit is contained in:
2026-09-18 11:08:05 +09:00
7 changed files with 24 additions and 33 deletions

View File

@@ -8,7 +8,6 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import com.example.demo.app.domain.model.CourseModel;
@@ -39,10 +38,6 @@ public class CourseEntity {
@OneToMany(mappedBy = "courseEntity")
private List<UserEntity> userEntity;
@OneToOne(mappedBy = "courseEntity")
private AllocationEntity allocationEntity;
public static List<CourseModel> createCourseModelList(List<CourseEntity> courseEntityList) {
return courseEntityList

View File

@@ -35,7 +35,7 @@ public class CourseController {
model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll()));
model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll()));
return "select-course";
return "select_course";
//} catch (Exception e) {
// // ログイン情報の破棄

View File

@@ -17,8 +17,14 @@ import lombok.RequiredArgsConstructor;
public class UserController {
@GetMapping("/user/register")
public String showRegister(Model model) {
model.addAttribute("userForm", new UserForm());
public String showRegister(Model model, HttpSession session) {
UserForm userForm = (UserForm) session.getAttribute("userForm");
if(userForm == null) {
userForm = new UserForm();
}
model.addAttribute("userForm", userForm);
return "user_register";
}

View File

@@ -1,6 +1,6 @@
spring.application.name=Monegement
spring.datasource.url=jdbc:mysql://localhost:3306/rezo_spring
spring.datasource.url=jdbc:mysql://localhost:3306/springdb
spring.datasource.username=rezouser
spring.datasource.password=Rezo_0000

View File

@@ -13,11 +13,11 @@
<div th:if="${errorMessage}" th:text="${errorMessage}"></div>
<form th:action="@{/login}" th:object="${loginForm}" method="post">
<div>
<label for="emailAddress">メールアドレス</label>
<label for="mailAddress">メールアドレス</label>
<input type="email"
id="emailAddress"
th:field="{emailAddress}"
id="mailAddress"
th:field="*{mailAddress}"
required>
</div>
@@ -26,7 +26,7 @@
<input type="password"
id="password"
th:field="{password}"
th:field="*{password}"
required>
</div>
@@ -36,11 +36,11 @@
</form>
<div>
<a href="@{user/register}">新規会員登録</a>
<a th:href="@{user/register}">新規会員登録</a>
</div>
<div>
<a href="@{password/authentication}">パスワードを忘れた方</a>
<a th:href="@{password/authentication}">パスワードを忘れた方</a>
</div>
</main>
</body>

View File

@@ -20,7 +20,7 @@
<tr>
<th>カテゴリ名</th><tr>配分(%)</tr>
</tr>
<tr th:each="courseInfo:${courseInfoList}" th:if="course.courseId=courseInfo.courseId">
<tr th:each="courseInfo:${courseInfoList}" th:if="course.courseId == courseInfo.courseId">
<td th:text="${courseInfo.categoryName}"></td>
<td th:text="${courseInfo.allocationRatio}"></td>
</tr>

View File

@@ -98,28 +98,18 @@
<div>
<label for="goalId">目標</label>
<select id="goalId"
<input type="number"
id="goalId"
th:field="*{goalId}"
min="0"
required>
<option value="">選択してください</option>
<option th:each="goal : ${goalList}"
th:value="${goal.goalId}"
th:text="${goal.goalTitle}">
</option>
</select>
</div>
<div>
<label for="courseId">コース</label>
<select id="courseId"
th:field="*{courseId}"
required>
<option value="">選択してください</option>
<option th:each="course : ${courseList}"
th:value="${course.courseId}"
th:text="${course.courseName}">
</option>
</select>
<label>コース</label>
<input type="hidden" th:field="*{courseId}">
<span th:text="${selectedCourseName}">未選択</span>
<button type="button"onclick="location.href='/select-course'">コース選択</button>
</div>
<div>