Compare commits
38 Commits
b49c9156a1
...
709f5e14da
| Author | SHA1 | Date | |
|---|---|---|---|
| 709f5e14da | |||
| 6197b12ac4 | |||
| 18faec044e | |||
| 6b4ae5bd96 | |||
| a2b1922548 | |||
| 1386f4b886 | |||
| 15bf2949bc | |||
| be9abffeaa | |||
| d696d8f376 | |||
| 066d76148b | |||
| 603d0d083a | |||
| cbd5aa6a7d | |||
| 43740691b5 | |||
| 7719c002ff | |||
| 8884a74625 | |||
|
|
61da5163b0 | ||
| 30a2ef3e21 | |||
| 938574654f | |||
| e43028c0ee | |||
| 7ddebf7a4a | |||
| cb7a3f542b | |||
| b48b3ae0bd | |||
| 57749b6354 | |||
| a8c46cc9db | |||
| 702dd24d2e | |||
| d71194659b | |||
| 44ceb0ca07 | |||
| 614533e2b0 | |||
| 2da75305fd | |||
| f55ece4dc7 | |||
| 0a63c81712 | |||
| 571fcc6d90 | |||
| 15185672c4 | |||
| 3833689759 | |||
| 0bec7b3b3b | |||
| 662e3433d2 | |||
| 60d4ebd74f | |||
| 49af15f939 |
@@ -2,6 +2,9 @@ package com.example.demo.app.domain.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import com.example.demo.app.infra.entity.GoalEntity;
|
||||
import com.example.demo.app.presentation.form.GoalForm;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -21,4 +24,35 @@ public class GoalModel {
|
||||
|
||||
private Integer goalComplete;
|
||||
|
||||
public static GoalModel convertFrom(GoalEntity goalEntity) {
|
||||
return new GoalModel(
|
||||
goalEntity.getGoalId(),
|
||||
goalEntity.getGoalTitle(),
|
||||
goalEntity.getGoalSubtitle(),
|
||||
goalEntity.getTargetAmount(),
|
||||
goalEntity.getDeadline(),
|
||||
goalEntity.getGoalComplete());
|
||||
}
|
||||
|
||||
public static GoalEntity convertTo(GoalModel goalModel) {
|
||||
return new GoalEntity(
|
||||
goalModel.getGoalId(),
|
||||
goalModel.getGoalTitle(),
|
||||
goalModel.getGoalSubtitle(),
|
||||
goalModel.getTargetAmount(),
|
||||
goalModel.getDeadline(),
|
||||
goalModel.getGoalComplete(),
|
||||
null);
|
||||
}
|
||||
|
||||
public static GoalModel convertFrom(GoalForm goalForm) {
|
||||
return new GoalModel(
|
||||
goalForm.getGoalId(),
|
||||
goalForm.getGoalTitle(),
|
||||
goalForm.getGoalSubtitle(),
|
||||
goalForm.getTargetAmount(),
|
||||
goalForm.getDeadline(),
|
||||
goalForm.getGoalComplete());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.example.demo.app.domain.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class ProfileModel {
|
||||
private Long userId;
|
||||
private String userName;
|
||||
private String emailAddress;
|
||||
private LocalDate brithDate;
|
||||
private Integer saving;
|
||||
private Integer annualIncome;
|
||||
private Integer monthlyBudget;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.demo.app.domain.service;
|
||||
|
||||
import com.example.demo.app.domain.model.GoalModel;
|
||||
|
||||
public interface GoalService {
|
||||
|
||||
GoalModel getGoalById(Long goalId);
|
||||
|
||||
GoalModel getGoalByUserId(Long userId);
|
||||
|
||||
GoalModel createGoal(GoalModel goalModel);
|
||||
|
||||
GoalModel updateGoal(GoalModel goalModel);
|
||||
|
||||
// void deleteGoal(Long goalId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.demo.app.domain.service;
|
||||
|
||||
import com.example.demo.app.presentation.form.PasswordResetForm;
|
||||
|
||||
public interface PasswordResetService {
|
||||
boolean resetPassword(Long userId, PasswordResetForm passwordResetForm);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.demo.app.domain.service;
|
||||
|
||||
import com.example.demo.app.domain.model.ProfileModel;
|
||||
|
||||
public interface ProfileService {
|
||||
ProfileModel findOne(Long userId);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.demo.app.domain.service;
|
||||
|
||||
import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
public interface UserService {
|
||||
void register(UserForm userForm);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.example.demo.app.domain.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.app.domain.model.GoalModel;
|
||||
import com.example.demo.app.domain.service.GoalService;
|
||||
import com.example.demo.app.infra.entity.GoalEntity;
|
||||
import com.example.demo.app.infra.entity.UserEntity;
|
||||
import com.example.demo.app.infra.repository.GoalRepository;
|
||||
import com.example.demo.app.infra.repository.UserRepository;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class GoalServiceImpl implements GoalService {
|
||||
|
||||
private final GoalRepository goalRepository;
|
||||
private final UserRepository userRepository;
|
||||
|
||||
@Override
|
||||
public GoalModel getGoalById(Long goalId) {
|
||||
GoalEntity goalEntity = goalRepository.findById(goalId).orElse(null);
|
||||
return GoalModel.convertFrom(goalEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoalModel getGoalByUserId(Long userId) {
|
||||
|
||||
UserEntity userEntity = userRepository.findById(userId).orElseThrow();
|
||||
GoalEntity goalEntity = userEntity.getGoalEntity();
|
||||
return GoalModel.convertFrom(goalEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoalModel createGoal(GoalModel goalModel) {
|
||||
|
||||
GoalEntity goalEntity = GoalModel.convertTo(goalModel);
|
||||
|
||||
GoalEntity savedGoalEntity = goalRepository.save(goalEntity);
|
||||
|
||||
return GoalModel.convertFrom(savedGoalEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoalModel updateGoal(GoalModel goalModel) {
|
||||
|
||||
GoalEntity goalEntity = GoalModel.convertTo(goalModel);
|
||||
|
||||
GoalEntity updatedGoalEntity = goalRepository.save(goalEntity);
|
||||
|
||||
return GoalModel.convertFrom(updatedGoalEntity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.example.demo.app.domain.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.app.domain.model.ProfileModel;
|
||||
import com.example.demo.app.domain.service.ProfileService;
|
||||
import com.example.demo.app.infra.entity.UserEntity;
|
||||
import com.example.demo.app.infra.repository.UserRepository;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProfileServiceImpl implements ProfileService{
|
||||
private final UserRepository userRepository;
|
||||
|
||||
@Override
|
||||
public ProfileModel findOne(Long userId) {
|
||||
UserEntity userEntity = userRepository.findById(userId).orElse(null);
|
||||
|
||||
if(userEntity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ProfileModel(
|
||||
userEntity.getUserId(),
|
||||
userEntity.getUserName(),
|
||||
userEntity.getMailAddress(),
|
||||
userEntity.getBirthDate(),
|
||||
userEntity.getSaving(),
|
||||
userEntity.getAnnualIncome(),
|
||||
userEntity.getMonthlyBudget());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.example.demo.app.domain.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.app.domain.service.UserService;
|
||||
import com.example.demo.app.infra.entity.CourseEntity;
|
||||
import com.example.demo.app.infra.entity.GoalEntity;
|
||||
import com.example.demo.app.infra.entity.QuestionEntity;
|
||||
import com.example.demo.app.infra.entity.UserEntity;
|
||||
import com.example.demo.app.infra.repository.CourseRepository;
|
||||
import com.example.demo.app.infra.repository.GoalRepository;
|
||||
import com.example.demo.app.infra.repository.QuestionRepository;
|
||||
import com.example.demo.app.infra.repository.UserRepository;
|
||||
import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserServiceImpl implements UserService {
|
||||
private final UserRepository userRepository;
|
||||
private final QuestionRepository questionRepository;
|
||||
private final GoalRepository goalRepository;
|
||||
private final CourseRepository courseRepository;
|
||||
|
||||
@Override
|
||||
public void register(UserForm userForm) {
|
||||
|
||||
UserEntity userEntity = new UserEntity();
|
||||
|
||||
userEntity.setUserName(userForm.getUserName());
|
||||
userEntity.setMailAddress(userForm.getMailAddress());
|
||||
userEntity.setPassword(userForm.getPassword());
|
||||
userEntity.setSecretQuestionAnswer(userForm.getSecretAnswer());
|
||||
userEntity.setBirthDate(userForm.getBirthDate());
|
||||
userEntity.setSaving(userForm.getSaving());
|
||||
userEntity.setBirthDate(userForm. getBirthDate());
|
||||
userEntity.setSaving(userForm.getSaving());
|
||||
userEntity.setAnnualIncome(userForm.getAnnualIncome());
|
||||
userEntity.setMonthlyBudget(userForm.getMonthlyBudget());
|
||||
|
||||
QuestionEntity questionEntity =
|
||||
questionRepository.findById(userForm.getSecretQuestionId()).orElse(null);
|
||||
|
||||
GoalEntity goalEntity =
|
||||
goalRepository.findById(userForm.getGoalId()).orElse(null);
|
||||
|
||||
CourseEntity courseEntity =
|
||||
courseRepository.findById(userForm.getCourseId()).orElse(null);
|
||||
|
||||
userEntity.setQuestionEntity(questionEntity);
|
||||
userEntity.setGoalEntity(goalEntity);
|
||||
userEntity.setCourseEntity(courseEntity);
|
||||
|
||||
userEntity.setDeleteFlag(0);
|
||||
|
||||
userRepository.save(userEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GoalEntity {
|
||||
@Column(name = "deadline", nullable = false)
|
||||
private LocalDate deadline;
|
||||
|
||||
@Column(name = "goal_complete", nullable = false)
|
||||
@Column(name = "goal_complete", nullable = true)
|
||||
private Integer goalComplete;
|
||||
|
||||
@OneToOne(mappedBy = "goalEntity")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.example.demo.app.presentation.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class ErrorController {
|
||||
@GetMapping("/error")
|
||||
public String showError() {
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.example.demo.app.presentation.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.example.demo.app.domain.model.GoalModel;
|
||||
import com.example.demo.app.domain.model.LoginModel;
|
||||
import com.example.demo.app.domain.service.GoalService;
|
||||
import com.example.demo.app.presentation.form.GoalForm;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/goal")
|
||||
public class GoalController {
|
||||
|
||||
private final GoalService goalService;
|
||||
|
||||
@GetMapping("")
|
||||
public String getGoal(Model model, HttpSession session) {
|
||||
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||
|
||||
Long userId = loginUser.getUserId();
|
||||
//テスト用
|
||||
// Long userId = 1L;
|
||||
|
||||
GoalModel goalModel = goalService.getGoalByUserId(userId);
|
||||
GoalForm goalForm = GoalForm.convertFrom(goalModel);
|
||||
|
||||
model.addAttribute("goalForm", goalForm);
|
||||
return "goal_view";
|
||||
}
|
||||
|
||||
@GetMapping("/edit")
|
||||
public String editGoal(Model model, HttpSession session) {
|
||||
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||
Long userId = loginUser.getUserId();
|
||||
|
||||
//テスト用
|
||||
// Long userId = 1L;
|
||||
|
||||
GoalModel goalModel = goalService.getGoalByUserId(userId);
|
||||
GoalForm goalForm = GoalForm.convertFrom(goalModel);
|
||||
|
||||
model.addAttribute("goalForm", goalForm);
|
||||
return "goal_edit";
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public String updateGoal(@ModelAttribute GoalForm goalForm, HttpSession session) {
|
||||
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||
|
||||
Long userId = loginUser.getUserId();
|
||||
//テスト用
|
||||
// Long userId = 1L;
|
||||
|
||||
|
||||
// 本人の目標かどうかを確認してから更新する
|
||||
GoalModel currentGoal = goalService.getGoalByUserId(userId);
|
||||
|
||||
if (!currentGoal.getGoalId().equals(goalForm.getGoalId())) {
|
||||
return "redirect:/goal"; // 他人のデータを更新しようとしたら弾く
|
||||
}
|
||||
|
||||
GoalModel goalModel = GoalModel.convertFrom(goalForm);
|
||||
goalService.updateGoal(goalModel);
|
||||
|
||||
return "redirect:/goal";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.example.demo.app.presentation.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import com.example.demo.app.domain.model.LoginModel;
|
||||
import com.example.demo.app.domain.model.ProfileModel;
|
||||
import com.example.demo.app.domain.service.ProfileService;
|
||||
import com.example.demo.app.presentation.form.ProfileForm;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class ProfileController {
|
||||
private final ProfileService profileService;
|
||||
|
||||
@GetMapping("/profile")
|
||||
public String profile(Model model, HttpSession session) {
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||
|
||||
ProfileModel profileModel = profileService.findOne(loginUser.getUserId());
|
||||
|
||||
ProfileForm profileForm = ProfileForm.convertForm(profileModel);
|
||||
|
||||
model.addAttribute("profileForm", profileForm);
|
||||
return "profile";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.example.demo.app.presentation.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class UserController {
|
||||
|
||||
@GetMapping("/user/register")
|
||||
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";
|
||||
}
|
||||
|
||||
@PostMapping("/user/register/confirm")
|
||||
public String confirmRegister(
|
||||
@ModelAttribute UserForm userForm,
|
||||
HttpSession session) {
|
||||
|
||||
session.setAttribute("userForm", userForm);
|
||||
|
||||
return "user_register_confirm";
|
||||
}
|
||||
|
||||
@PostMapping("/user/register/complete")
|
||||
public String completeRegister(HttpSession session) {
|
||||
|
||||
UserForm userForm =
|
||||
(UserForm) session.getAttribute("userForm");
|
||||
|
||||
// DBへの登録処理
|
||||
|
||||
session.removeAttribute("userForm");
|
||||
|
||||
return "redirect:/login";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.example.demo.app.presentation.form;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import com.example.demo.app.domain.model.GoalModel;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GoalForm {
|
||||
|
||||
private Long goalId;
|
||||
|
||||
private String goalTitle;
|
||||
|
||||
private String goalSubtitle;
|
||||
|
||||
private Integer targetAmount;
|
||||
|
||||
private LocalDate deadline;
|
||||
|
||||
private Integer goalComplete;
|
||||
|
||||
public static GoalForm convertFrom(GoalModel goalModel) {
|
||||
return new GoalForm(
|
||||
goalModel.getGoalId(),
|
||||
goalModel.getGoalTitle(),
|
||||
goalModel.getGoalSubtitle(),
|
||||
goalModel.getTargetAmount(),
|
||||
goalModel.getDeadline(),
|
||||
goalModel.getGoalComplete());
|
||||
}
|
||||
|
||||
// public static List<GoalForm> convertFrom(List<GoalModel> goalModelList) {
|
||||
// return goalModelList.stream().map(GoalForm::convertFrom).toList();
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.example.demo.app.presentation.form;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PasswordResetForm{
|
||||
private String password;
|
||||
private String passwordConfirm;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.demo.app.presentation.form;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import com.example.demo.app.domain.model.ProfileModel;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProfileForm {
|
||||
private Long userId;
|
||||
private String userName;
|
||||
private String emailAddress;
|
||||
private LocalDate brithDate;
|
||||
private Integer saving;
|
||||
private Integer annualIncome;
|
||||
private Integer monthlyBudget;
|
||||
|
||||
public static ProfileForm convertForm(ProfileModel profileModel) {
|
||||
return new ProfileForm(
|
||||
profileModel.getUserId(),
|
||||
profileModel.getUserName(),
|
||||
profileModel.getEmailAddress(),
|
||||
profileModel.getBrithDate(),
|
||||
profileModel.getSaving(),
|
||||
profileModel.getAnnualIncome(),
|
||||
profileModel.getMonthlyBudget());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.demo.app.presentation.form;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserForm {
|
||||
private String userName;
|
||||
private String mailAddress;
|
||||
private String password;
|
||||
private Long secretQuestionId;
|
||||
private String SecretAnswer;
|
||||
private LocalDate birthDate;
|
||||
private Integer saving;
|
||||
private Integer annualIncome;
|
||||
private Integer monthlyBudget;
|
||||
private Long goalId;
|
||||
private Long courseId;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.demo.exception;
|
||||
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public String handleException(
|
||||
Exception e,
|
||||
Model model) {
|
||||
|
||||
model.addAttribute(
|
||||
"errorMessage",
|
||||
"システムエラーが発生しました。"
|
||||
+ "初めからやり直してください。");
|
||||
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,12 @@
|
||||
<title>分析画面</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<body class="pb-5 pt-5">
|
||||
|
||||
<div th:replace="~{header :: header}">
|
||||
</div>
|
||||
|
||||
<div class="container mt-4">
|
||||
<h2 class="text-center">支出分析</h2>
|
||||
|
||||
<table class="table text-center">
|
||||
@@ -81,6 +82,11 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}">
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
32
src/main/resources/templates/error.html
Normal file
32
src/main/resources/templates/error.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8" 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">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div th:replace="~{header :: header}">
|
||||
</div>
|
||||
|
||||
<div class="container text-center mt-5">
|
||||
|
||||
<h2 class="text-danger">
|
||||
エラーが発生しました
|
||||
</h2>
|
||||
|
||||
<p th:text="${errorMessage}"></p>
|
||||
|
||||
<a class="btn btn-primary" th:href="@{/login}">
|
||||
ログイン画面へ
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
42
src/main/resources/templates/footer.html
Normal file
42
src/main/resources/templates/footer.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8" 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">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<footer th:fragment="footer" class="fixed-bottom border-top py-2" style="background-color:#E3F2FD;">
|
||||
|
||||
<nav data-bs-theme="light">
|
||||
<div class="card-footer text-center">
|
||||
<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>
|
||||
</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>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col border-end">
|
||||
<button type="button" class="btn btn-link text-black text-decoration-none">
|
||||
<a th:href="@{/analysis}">分析</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>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
38
src/main/resources/templates/goal_edit.html
Normal file
38
src/main/resources/templates/goal_edit.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>目標編集</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>目標編集</h1>
|
||||
|
||||
<form th:action="@{/goal/update}" th:object="${goalForm}" method="post">
|
||||
<input type="hidden" th:field="*{goalId}">
|
||||
|
||||
<div>
|
||||
<label>目標名</label>
|
||||
<input type="text" th:field="*{goalTitle}">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>目標説明</label>
|
||||
<textarea th:field="*{goalSubtitle}"></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>目標金額</label>
|
||||
<input type="number" th:field="*{targetAmount}">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>目標達成期限</label>
|
||||
<input type="date" th:field="*{deadline}">
|
||||
</div>
|
||||
<button type="submit">更新する</button>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
35
src/main/resources/templates/goal_view.html
Normal file
35
src/main/resources/templates/goal_view.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>目標詳細</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>目標詳細</h1>
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<th>目標名</th>
|
||||
<td th:text="${goalForm.goalTitle}"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>目標説明</th>
|
||||
<td th:text="${goalForm.goalSubtitle}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>目標金額</th>
|
||||
<td th:text="${goalForm.targetAmount}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>目標達成期限</th>
|
||||
<td th:text="${goalForm.deadline}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a th:href="@{/goal/edit}">編集する</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,7 +7,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header th:fragment="header">
|
||||
<header th:fragment="header" class="fixed-top">
|
||||
|
||||
<nav class="navbar" style="background-color: #e3f2fd;" data-bs-theme="light">
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
<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="mailAddress"
|
||||
th:field="*{mailAddress}"
|
||||
required>
|
||||
</div>
|
||||
@@ -24,6 +25,7 @@
|
||||
<label for="password">パスワード</label>
|
||||
|
||||
<input type="password"
|
||||
id="password"
|
||||
th:field="*{password}"
|
||||
required>
|
||||
</div>
|
||||
@@ -34,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="@{/authentication}">パスワードを忘れた方</a>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
42
src/main/resources/templates/password_reset.html
Normal file
42
src/main/resources/templates/password_reset.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja"xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>パスワード再設定</title>
|
||||
</head>
|
||||
<body>
|
||||
<header></header>
|
||||
|
||||
<main>
|
||||
<h1>パスワード再設定</h1>
|
||||
|
||||
<form th:action="@{/password_reset}" th:object="${passwordResetForm}" method="post">
|
||||
<div>
|
||||
<label for="password">新しいパスワード</label>
|
||||
<input type="password"
|
||||
id="password"
|
||||
th:field="*{password}"
|
||||
minlength="8"
|
||||
maxlength="255"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="passwordConfirm">パスワード確認</label>
|
||||
<input type="password"
|
||||
id="passwordConfirm"
|
||||
th:field="*{passwordConfirm}"
|
||||
minlength="8"
|
||||
maxlength="255"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<button type="submit">再設定</button>
|
||||
</form>
|
||||
|
||||
<div th:if="${errorMessage}">
|
||||
<p th:text="${errorMessage}"></p>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user