Compare commits
7 Commits
79b1abeac6
...
1759c45fea
| Author | SHA1 | Date | |
|---|---|---|---|
| 1759c45fea | |||
| 44ac862bdb | |||
|
|
5939e75f86 | ||
| ed7a3a67b7 | |||
|
|
41c5f6e99e | ||
|
|
af3e171006 | ||
|
|
31a6ce44a4 |
@@ -25,6 +25,8 @@ public class GoalModel {
|
|||||||
private Integer goalComplete;
|
private Integer goalComplete;
|
||||||
|
|
||||||
private Integer achievementRate; // 達成率
|
private Integer achievementRate; // 達成率
|
||||||
|
|
||||||
|
private Integer currentAmount; // 現在の資産
|
||||||
|
|
||||||
public static GoalModel convertFrom(GoalEntity goalEntity) {
|
public static GoalModel convertFrom(GoalEntity goalEntity) {
|
||||||
return new GoalModel(
|
return new GoalModel(
|
||||||
@@ -34,7 +36,7 @@ public class GoalModel {
|
|||||||
goalEntity.getTargetAmount(),
|
goalEntity.getTargetAmount(),
|
||||||
goalEntity.getDeadline(),
|
goalEntity.getDeadline(),
|
||||||
goalEntity.getGoalComplete(),
|
goalEntity.getGoalComplete(),
|
||||||
null);
|
null,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GoalEntity convertTo(GoalModel goalModel) {
|
public static GoalEntity convertTo(GoalModel goalModel) {
|
||||||
@@ -56,7 +58,7 @@ public class GoalModel {
|
|||||||
goalForm.getTargetAmount(),
|
goalForm.getTargetAmount(),
|
||||||
goalForm.getDeadline(),
|
goalForm.getDeadline(),
|
||||||
goalForm.getGoalComplete()
|
goalForm.getGoalComplete()
|
||||||
,null);
|
,null,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,4 +8,6 @@ public interface CourseService {
|
|||||||
|
|
||||||
public List<CourseModel> findAll();
|
public List<CourseModel> findAll();
|
||||||
|
|
||||||
|
public CourseModel findById(Long courseId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,8 @@ public class CourseServiceImpl implements CourseService {
|
|||||||
|
|
||||||
return CourseEntity.createCourseModelList(courseRepository.findAll());
|
return CourseEntity.createCourseModelList(courseRepository.findAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CourseModel findById(Long courseId) {
|
||||||
|
return CourseModel.convertFrom(courseRepository.findByCourseId(courseId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ public class GoalServiceImpl implements GoalService {
|
|||||||
goalModel.getTargetAmount(),
|
goalModel.getTargetAmount(),
|
||||||
goalModel.getDeadline(),
|
goalModel.getDeadline(),
|
||||||
goalModel.getGoalComplete(),
|
goalModel.getGoalComplete(),
|
||||||
achievementRate);
|
achievementRate,
|
||||||
|
currentAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.example.demo.app.infra.repository;
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import com.example.demo.app.infra.entity.CourseEntity;
|
import com.example.demo.app.infra.entity.CourseEntity;
|
||||||
|
|
||||||
public interface CourseRepository extends JpaRepository<CourseEntity, Long> {
|
public interface CourseRepository extends JpaRepository<CourseEntity, Long> {
|
||||||
|
|
||||||
|
@Query("SELECT c FROM CourseEntity c WHERE c.courseId = :courseId ")
|
||||||
|
public CourseEntity findByCourseId(Long courseId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.AnalysisModel;
|
import com.example.demo.app.domain.model.AnalysisModel;
|
||||||
import com.example.demo.app.domain.model.LoginModel;
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
import com.example.demo.app.domain.service.AnalysisService;
|
import com.example.demo.app.domain.service.AnalysisService;
|
||||||
@@ -23,6 +24,7 @@ public class AnalysisController {
|
|||||||
|
|
||||||
private final AnalysisService analysisService;
|
private final AnalysisService analysisService;
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/analysis")
|
@GetMapping("/analysis")
|
||||||
public String showAnalysis(
|
public String showAnalysis(
|
||||||
@RequestParam(required = false) Integer year,
|
@RequestParam(required = false) Integer year,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.AuthenticationModel;
|
import com.example.demo.app.domain.model.AuthenticationModel;
|
||||||
import com.example.demo.app.domain.service.AuthenticationService;
|
import com.example.demo.app.domain.service.AuthenticationService;
|
||||||
import com.example.demo.app.infra.repository.QuestionRepository;
|
import com.example.demo.app.infra.repository.QuestionRepository;
|
||||||
@@ -21,6 +22,7 @@ public class AuthenticationController {
|
|||||||
private final AuthenticationService authenticationService;
|
private final AuthenticationService authenticationService;
|
||||||
private final QuestionRepository questionRepository;
|
private final QuestionRepository questionRepository;
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/authentication")
|
@GetMapping("/authentication")
|
||||||
public String showAuthentication(Model model) {
|
public String showAuthentication(Model model) {
|
||||||
|
|
||||||
@@ -29,7 +31,8 @@ public class AuthenticationController {
|
|||||||
|
|
||||||
return "authentication";
|
return "authentication";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/authentication")
|
@PostMapping("/authentication")
|
||||||
public String authenticate(
|
public String authenticate(
|
||||||
AuthenticationForm authenticationForm,
|
AuthenticationForm authenticationForm,
|
||||||
|
|||||||
@@ -7,24 +7,25 @@ import jakarta.servlet.http.HttpSession;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
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.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.LoginModel;
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
import com.example.demo.app.domain.model.UserModel;
|
|
||||||
import com.example.demo.app.domain.service.CourseInfoService;
|
import com.example.demo.app.domain.service.CourseInfoService;
|
||||||
import com.example.demo.app.domain.service.CourseService;
|
import com.example.demo.app.domain.service.CourseService;
|
||||||
import com.example.demo.app.domain.service.UserService;
|
import com.example.demo.app.domain.service.UserService;
|
||||||
import com.example.demo.app.presentation.form.CourseForm;
|
import com.example.demo.app.presentation.form.CourseForm;
|
||||||
import com.example.demo.app.presentation.form.CourseInfoForm;
|
import com.example.demo.app.presentation.form.CourseInfoForm;
|
||||||
|
import com.example.demo.app.presentation.form.UserForm;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/course")
|
//@RequestMapping("/course")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CourseController {
|
public class CourseController {
|
||||||
|
|
||||||
@@ -38,15 +39,18 @@ public class CourseController {
|
|||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/select/register")
|
@GetMapping("/course/select/register")
|
||||||
public String showSelectCourse(@ModelAttribute UserModel userModel, Model model) {
|
public String showSelectCourse(@ModelAttribute UserForm userForm, Model model, HttpSession session) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
System.out.println(userForm.getMailAddress());
|
||||||
|
|
||||||
model.addAttribute("mode", "select");
|
session.setAttribute("userForm", userForm);
|
||||||
|
model.addAttribute("mode", "regist");
|
||||||
model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll()));
|
model.addAttribute("courseList", CourseForm.convertFrom(courseService.findAll()));
|
||||||
model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll()));
|
model.addAttribute("courseInfoList", CourseInfoForm.convertFrom(courseInfoService.findAll()));
|
||||||
|
|
||||||
|
|
||||||
return "select_course";
|
return "select_course";
|
||||||
|
|
||||||
@@ -63,7 +67,8 @@ public class CourseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/select/change")
|
@SessionCheck
|
||||||
|
@GetMapping("/select/change")
|
||||||
public String showChangeCourse(Model model) {
|
public String showChangeCourse(Model model) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -87,6 +92,7 @@ public class CourseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/change")
|
@PostMapping("/change")
|
||||||
public String changeCourse(@RequestParam Long courseId) {
|
public String changeCourse(@RequestParam Long courseId) {
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.GoalModel;
|
import com.example.demo.app.domain.model.GoalModel;
|
||||||
import com.example.demo.app.domain.model.LoginModel;
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
import com.example.demo.app.domain.service.GoalService;
|
import com.example.demo.app.domain.service.GoalService;
|
||||||
@@ -23,6 +24,7 @@ public class GoalController {
|
|||||||
|
|
||||||
private final GoalService goalService;
|
private final GoalService goalService;
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("")
|
@GetMapping("")
|
||||||
public String getGoal(Model model, HttpSession session) {
|
public String getGoal(Model model, HttpSession session) {
|
||||||
|
|
||||||
@@ -37,6 +39,7 @@ public class GoalController {
|
|||||||
return "goal_view";
|
return "goal_view";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/edit")
|
@GetMapping("/edit")
|
||||||
public String editGoal(Model model, HttpSession session) {
|
public String editGoal(Model model, HttpSession session) {
|
||||||
|
|
||||||
@@ -50,6 +53,7 @@ public class GoalController {
|
|||||||
return "goal_edit";
|
return "goal_edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public String updateGoal(@ModelAttribute GoalForm goalForm, HttpSession session) {
|
public String updateGoal(@ModelAttribute GoalForm goalForm, HttpSession session) {
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.LoginModel;
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
import com.example.demo.app.domain.model.ProfileModel;
|
import com.example.demo.app.domain.model.ProfileModel;
|
||||||
import com.example.demo.app.domain.service.ProfileService;
|
import com.example.demo.app.domain.service.ProfileService;
|
||||||
@@ -21,6 +22,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
public class ProfileController {
|
public class ProfileController {
|
||||||
private final ProfileService profileService;
|
private final ProfileService profileService;
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/profile")
|
@GetMapping("/profile")
|
||||||
public String profile(Model model, HttpSession session) {
|
public String profile(Model model, HttpSession session) {
|
||||||
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||||
@@ -33,6 +35,7 @@ public class ProfileController {
|
|||||||
return "profile";
|
return "profile";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/profile/edit")
|
@GetMapping("/profile/edit")
|
||||||
public String showEditProfile(
|
public String showEditProfile(
|
||||||
Model model,
|
Model model,
|
||||||
@@ -84,6 +87,7 @@ public class ProfileController {
|
|||||||
return "redirect:/login";
|
return "redirect:/login";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/logout")
|
@PostMapping("/logout")
|
||||||
public String logout(HttpSession session) {
|
public String logout(HttpSession session) {
|
||||||
session.invalidate();
|
session.invalidate();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.aop.aspect.SessionCheck;
|
||||||
import com.example.demo.app.domain.model.LoginModel;
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
import com.example.demo.app.domain.service.CategoryService;
|
import com.example.demo.app.domain.service.CategoryService;
|
||||||
import com.example.demo.app.domain.service.GoalService;
|
import com.example.demo.app.domain.service.GoalService;
|
||||||
@@ -41,6 +42,7 @@ public class TransactionController {
|
|||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
// 一覧画面
|
// 一覧画面
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/transaction/list")
|
@GetMapping("/transaction/list")
|
||||||
public String transactionList(
|
public String transactionList(
|
||||||
@RequestParam(required = false, defaultValue = "0") String years,
|
@RequestParam(required = false, defaultValue = "0") String years,
|
||||||
@@ -124,6 +126,7 @@ public class TransactionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 詳細画面
|
// 詳細画面
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/transaction/detail")
|
@GetMapping("/transaction/detail")
|
||||||
public String findOne(@RequestParam(required = false) LocalDate todayDates, Model model, HttpSession session) {
|
public String findOne(@RequestParam(required = false) LocalDate todayDates, Model model, HttpSession session) {
|
||||||
|
|
||||||
@@ -176,6 +179,7 @@ public class TransactionController {
|
|||||||
return "transaction_detail";
|
return "transaction_detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/transaction/create")
|
@GetMapping("/transaction/create")
|
||||||
public String createOneGet(@RequestParam(defaultValue = "") LocalDate today,
|
public String createOneGet(@RequestParam(defaultValue = "") LocalDate today,
|
||||||
Model model) {
|
Model model) {
|
||||||
@@ -200,6 +204,7 @@ public class TransactionController {
|
|||||||
return "transaction_create";
|
return "transaction_create";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/transaction/create")
|
@PostMapping("/transaction/create")
|
||||||
public String createOnePost(@ModelAttribute TransactionForm transactionForm, @RequestParam LocalDate today,
|
public String createOnePost(@ModelAttribute TransactionForm transactionForm, @RequestParam LocalDate today,
|
||||||
Model model,
|
Model model,
|
||||||
@@ -215,6 +220,7 @@ public class TransactionController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/transaction/update")
|
@GetMapping("/transaction/update")
|
||||||
public String updateOneGet(@RequestParam Long transactionId, @RequestParam(defaultValue = "") LocalDate today,
|
public String updateOneGet(@RequestParam Long transactionId, @RequestParam(defaultValue = "") LocalDate today,
|
||||||
Model model) {
|
Model model) {
|
||||||
@@ -246,6 +252,7 @@ public class TransactionController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/transaction/update")
|
@PostMapping("/transaction/update")
|
||||||
public String updateOnePost(@RequestParam Long transactionId, @ModelAttribute TransactionForm transactionForm,
|
public String updateOnePost(@RequestParam Long transactionId, @ModelAttribute TransactionForm transactionForm,
|
||||||
@RequestParam LocalDate today, Model model,
|
@RequestParam LocalDate today, Model model,
|
||||||
@@ -264,6 +271,7 @@ public class TransactionController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@PostMapping("/transaction/delete")
|
@PostMapping("/transaction/delete")
|
||||||
public String deleteOne(@RequestParam Long transactionId, @RequestParam LocalDate today) {
|
public String deleteOne(@RequestParam Long transactionId, @RequestParam LocalDate today) {
|
||||||
|
|
||||||
@@ -271,6 +279,7 @@ public class TransactionController {
|
|||||||
return "redirect:/transaction/detail?todayDates=" + today;
|
return "redirect:/transaction/detail?todayDates=" + today;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SessionCheck
|
||||||
@GetMapping("/menu")
|
@GetMapping("/menu")
|
||||||
public String menu(HttpSession session, Model model,
|
public String menu(HttpSession session, Model model,
|
||||||
@RequestParam(required = false, defaultValue = "0") String years,
|
@RequestParam(required = false, defaultValue = "0") String years,
|
||||||
@@ -335,6 +344,8 @@ public class TransactionController {
|
|||||||
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
||||||
|
|
||||||
model.addAttribute("achievementRate", goalForm.getAchievementRate());
|
model.addAttribute("achievementRate", goalForm.getAchievementRate());
|
||||||
|
|
||||||
|
model.addAttribute("currentAmount", goalForm.getCurrentAmount());
|
||||||
|
|
||||||
model.addAttribute("targetAmount", goalForm.getTargetAmount());
|
model.addAttribute("targetAmount", goalForm.getTargetAmount());
|
||||||
|
|
||||||
|
|||||||
@@ -7,24 +7,45 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.service.CourseService;
|
||||||
import com.example.demo.app.presentation.form.UserForm;
|
import com.example.demo.app.presentation.form.UserForm;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
|
private final CourseService courseService;
|
||||||
|
|
||||||
@GetMapping("/user/register")
|
@GetMapping("/user/register")
|
||||||
public String showRegister(Model model, HttpSession session) {
|
public String showRegister(Model model, HttpSession session) {
|
||||||
|
UserForm userForm = new UserForm();
|
||||||
|
|
||||||
|
model.addAttribute("userForm", userForm);
|
||||||
|
return "user_register";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/user/register/return")
|
||||||
|
public String showRegisterReturn(@RequestParam(required = false) Long courseId, Model model, HttpSession session) {
|
||||||
|
|
||||||
UserForm userForm = (UserForm) session.getAttribute("userForm");
|
UserForm userForm = (UserForm) session.getAttribute("userForm");
|
||||||
|
|
||||||
if(userForm == null) {
|
if(userForm == null) {
|
||||||
userForm = new UserForm();
|
userForm = new UserForm();
|
||||||
|
userForm.setCourseId(courseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(courseId != null) {
|
||||||
|
model.addAttribute("selectedCourseName", courseService.findById(courseId).getCourseName());
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("courseId", courseId);
|
||||||
model.addAttribute("userForm", userForm);
|
model.addAttribute("userForm", userForm);
|
||||||
|
|
||||||
return "user_register";
|
return "user_register";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public class GoalForm {
|
|||||||
private Integer goalComplete;
|
private Integer goalComplete;
|
||||||
|
|
||||||
private Integer achievementRate; // 達成率
|
private Integer achievementRate; // 達成率
|
||||||
|
|
||||||
|
private Integer currentAmount; // 現在の資産
|
||||||
|
|
||||||
public static GoalForm convertFrom(GoalModel goalModel) {
|
public static GoalForm convertFrom(GoalModel goalModel) {
|
||||||
return new GoalForm(
|
return new GoalForm(
|
||||||
@@ -38,7 +40,8 @@ public class GoalForm {
|
|||||||
goalModel.getTargetAmount(),
|
goalModel.getTargetAmount(),
|
||||||
goalModel.getDeadline(),
|
goalModel.getDeadline(),
|
||||||
goalModel.getGoalComplete(),
|
goalModel.getGoalComplete(),
|
||||||
goalModel.getAchievementRate());
|
goalModel.getAchievementRate(),
|
||||||
|
goalModel.getCurrentAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static List<GoalForm> convertFrom(List<GoalModel> goalModelList) {
|
// public static List<GoalForm> convertFrom(List<GoalModel> goalModelList) {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
<h1>目標詳細</h1>
|
<h1>目標詳細</h1>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標名</th>
|
<th>目標名</th>
|
||||||
<td th:text="${goalForm.goalTitle}"></td>
|
<td th:text="${goalForm.goalTitle}"></td>
|
||||||
|
|||||||
@@ -118,6 +118,13 @@
|
|||||||
<span th:text="${targetAmount}"></span>
|
<span th:text="${targetAmount}"></span>
|
||||||
<span>円</span>
|
<span>円</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>現在高</span>
|
||||||
|
<span th:text="${currentAmount}"></span>
|
||||||
|
<span>円</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span>貯金額</span>
|
<span>貯金額</span>
|
||||||
<span th:text="${saving}"></span>
|
<span th:text="${saving}"></span>
|
||||||
|
|||||||
@@ -4,14 +4,15 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>パスワード再設定</title>
|
<title>パスワード再設定</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="pb-5 pt-5">
|
<body>
|
||||||
<div th:replace="~{header :: header}">
|
<!--<body class="pb-5 pt-5">-->
|
||||||
</div>
|
<!-- <div th:replace="~{header :: header}">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>パスワード再設定</h1>
|
<h1>パスワード再設定</h1>
|
||||||
|
|
||||||
<form th:action="@{/password_reset}" th:object="${passwordResetForm}" method="post">
|
<form th:action="@{/password/reset}" th:object="${passwordResetForm}" method="post">
|
||||||
<div>
|
<div>
|
||||||
<label for="password">新しいパスワード</label>
|
<label for="password">新しいパスワード</label>
|
||||||
<input type="password"
|
<input type="password"
|
||||||
|
|||||||
@@ -9,42 +9,34 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>コース選択</h1>
|
<h1>コース選択</h1>
|
||||||
<form th:action="@{/user/register}" th:object="${userForm}" method="post">
|
|
||||||
<input type="hidden" th:field="*{userName}">
|
|
||||||
<input type="hidden" th:field="*{mailAddress}">
|
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" method="post">
|
||||||
<input type="hidden" th:field="*{birthDate}">
|
<button type="submit">確定</button>
|
||||||
<input type="hidden" th:field="*{password}">
|
<div class="accordion" id="accordionExample">
|
||||||
<input type="hidden" th:field="*{secretQuestionId}">
|
<div class="accordion-item" th:each="course:${courseList}">
|
||||||
<input type="hidden" th:field="*{secretAnswer}">
|
<h2 class="accordion-header d-flex align-items-center">
|
||||||
<input type="hidden" th:field="*{saving}">
|
<input type="radio" name="courseId" th:value="${course.courseId}" class="form-check-input ms-3 me-2">
|
||||||
<input type="hidden" th:field="*{annualIncome}">
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" th:data-bs-target="'#collapse' + ${course.courseId}" aria-expanded="false" aria-controls="'collapse' + ${course.courseId}">
|
||||||
<input type="hidden" th:field="*{monthlyBudget}">
|
<span th:text="${course.courseName}"></span>
|
||||||
<input type="hidden" th:field="*{targetAmount}">
|
</button>
|
||||||
<button type="submit">確定</button>
|
</h2>
|
||||||
<div class="accordion" id="accordionExample">
|
<div th:id="'collapse' + ${course.courseId}" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
||||||
<div class="accordion-item" th:each="course:${courseList}">
|
<div class="accordion-body">
|
||||||
<h2 class="accordion-header d-flex align-items-center">
|
<span th:text="${course.description}"></span>
|
||||||
<input type="radio" name="courseId" th:value="${course.courseId}" class="form-check-input ms-3 me-2">
|
<table border="1">
|
||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" th:data-bs-target="'#collapse' + ${course.courseId}" aria-expanded="false" aria-controls="'collapse' + ${course.courseId}">
|
<tr>
|
||||||
<span th:text="${course.courseName}"></span>
|
<th>カテゴリ名</th><th>配分(%)</th>
|
||||||
</button>
|
</tr>
|
||||||
</h2>
|
<tr th:each="courseInfo:${courseInfoList}" th:if="${course.courseId == courseInfo.courseId}">
|
||||||
<div th:id="'collapse' + ${course.courseId}" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
<td th:text="${courseInfo.categoryName}"></td>
|
||||||
<div class="accordion-body">
|
<td th:text="${courseInfo.allocationRatio}"></td>
|
||||||
<span th:text="${course.description}"></span>
|
</tr>
|
||||||
<table border="1">
|
</table>
|
||||||
<tr>
|
</div>
|
||||||
<th>カテゴリ名</th><th>配分(%)</th>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
<tr th:each="courseInfo:${courseInfoList}" th:if="${course.courseId == courseInfo.courseId}">
|
</div>
|
||||||
<td th:text="${courseInfo.categoryName}"></td>
|
|
||||||
<td th:text="${courseInfo.allocationRatio}"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user