diff --git a/src/main/java/com/example/demo/app/domain/model/AuthenticationModel.java b/src/main/java/com/example/demo/app/domain/model/AuthenticationModel.java new file mode 100644 index 0000000..ec8db4b --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/model/AuthenticationModel.java @@ -0,0 +1,10 @@ +package com.example.demo.app.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class AuthenticationModel { + private Long userId; +} diff --git a/src/main/java/com/example/demo/app/domain/model/GoalModel.java b/src/main/java/com/example/demo/app/domain/model/GoalModel.java new file mode 100644 index 0000000..7764281 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/model/GoalModel.java @@ -0,0 +1,24 @@ +package com.example.demo.app.domain.model; + +import java.time.LocalDate; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class GoalModel { + + private Long goalId; + + private String goalTitle; + + private String goalSubtitle; + + private Integer targetAmount; + + private LocalDate deadline; + + private Integer goalComplete; + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/app/domain/model/UserModel.java b/src/main/java/com/example/demo/app/domain/model/UserModel.java index bb34609..1f79b0c 100644 --- a/src/main/java/com/example/demo/app/domain/model/UserModel.java +++ b/src/main/java/com/example/demo/app/domain/model/UserModel.java @@ -8,10 +8,9 @@ import lombok.Getter; @Getter @AllArgsConstructor public class UserModel { - private Long userId; private String userName; - private String emailAddress; + private String mailAddress; private String password; private Integer secretQuestionId; private String secretAnswer; @@ -19,7 +18,7 @@ public class UserModel { private Integer saving; private Integer annualIncome; private Integer monthlyBudget; - private Integer goalId; - private Integer courseId; + private Long goalId; + private Long courseId; private Integer deleteFlag; } diff --git a/src/main/java/com/example/demo/app/domain/service/AllocationService.java b/src/main/java/com/example/demo/app/domain/service/AllocationService.java new file mode 100644 index 0000000..240c1fd --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/service/AllocationService.java @@ -0,0 +1,11 @@ +package com.example.demo.app.domain.service; + +import java.util.List; + +import com.example.demo.app.domain.model.AllocationModel; + +public interface AllocationService { + + public List findAll(); + +} diff --git a/src/main/java/com/example/demo/app/domain/service/AuthenticationService.java b/src/main/java/com/example/demo/app/domain/service/AuthenticationService.java new file mode 100644 index 0000000..824c752 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/service/AuthenticationService.java @@ -0,0 +1,9 @@ +package com.example.demo.app.domain.service; + +import com.example.demo.app.domain.model.AuthenticationModel; +import com.example.demo.app.presentation.form.AuthenticationForm; + +public interface AuthenticationService { + + AuthenticationModel authenticate(AuthenticationForm authenticationForm); +} diff --git a/src/main/java/com/example/demo/app/domain/service/CourseInfoService.java b/src/main/java/com/example/demo/app/domain/service/CourseInfoService.java index 83cf4ab..2699f13 100644 --- a/src/main/java/com/example/demo/app/domain/service/CourseInfoService.java +++ b/src/main/java/com/example/demo/app/domain/service/CourseInfoService.java @@ -5,6 +5,6 @@ import java.util.List; import com.example.demo.app.domain.model.CourseInfoModel; public interface CourseInfoService { - + // public List findAll(); } diff --git a/src/main/java/com/example/demo/app/domain/service/CourseService.java b/src/main/java/com/example/demo/app/domain/service/CourseService.java index 4681860..bbf92f7 100644 --- a/src/main/java/com/example/demo/app/domain/service/CourseService.java +++ b/src/main/java/com/example/demo/app/domain/service/CourseService.java @@ -5,7 +5,7 @@ import java.util.List; import com.example.demo.app.domain.model.CourseModel; public interface CourseService { - + // public List findAll(); } diff --git a/src/main/java/com/example/demo/app/domain/service/PasswordResetService.java b/src/main/java/com/example/demo/app/domain/service/PasswordResetService.java deleted file mode 100644 index ec1140e..0000000 --- a/src/main/java/com/example/demo/app/domain/service/PasswordResetService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.example.demo.app.domain.service; - -import com.example.demo.app.presentation.form.PasswordResetForm; - -public interface PasswordResetService { - - boolean resetPassword(Long userId, PasswordResetForm passwordResetForm); -} diff --git a/src/main/java/com/example/demo/app/domain/service/UserService.java b/src/main/java/com/example/demo/app/domain/service/UserService.java deleted file mode 100644 index 4a7a338..0000000 --- a/src/main/java/com/example/demo/app/domain/service/UserService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.example.demo.app.domain.service; - -import com.example.demo.app.presentation.form.UserForm; - -public interface UserService { - - void register(UserForm userForm); -} diff --git a/src/main/java/com/example/demo/app/domain/service/impl/AllocationServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/AllocationServiceImpl.java new file mode 100644 index 0000000..fa287d4 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/service/impl/AllocationServiceImpl.java @@ -0,0 +1,24 @@ +package com.example.demo.app.domain.service.impl; + +import java.util.List; + +import org.springframework.stereotype.Service; + +import com.example.demo.app.domain.model.AllocationModel; +import com.example.demo.app.domain.service.AllocationService; +import com.example.demo.app.infra.entity.AllocationEntity; +import com.example.demo.app.infra.repository.AllocationRepository; + +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class AllocationServiceImpl implements AllocationService { + + AllocationRepository allocationRepository; + + public List findAll(){ + return AllocationEntity.createAllocationModelList(allocationRepository.findAll()); + } + +} diff --git a/src/main/java/com/example/demo/app/domain/service/impl/AnalysisServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/AnalysisServiceImpl.java index d0f3388..0764d41 100644 --- a/src/main/java/com/example/demo/app/domain/service/impl/AnalysisServiceImpl.java +++ b/src/main/java/com/example/demo/app/domain/service/impl/AnalysisServiceImpl.java @@ -33,7 +33,9 @@ public class AnalysisServiceImpl implements AnalysisService { public AnalysisModel getAnalysis(Long userId) { // ユーザー情報取得、月別使用可能資金取得 - UserEntity userEntity = userRepository.findById(userId).orElseThrow(); + UserEntity userEntity = userRepository.findById(userId).orElseThrow(() -> + new RuntimeException( + "User not found.")); // コースID取得 Long courseId = userEntity.getCourseEntity().getCourseId(); diff --git a/src/main/java/com/example/demo/app/domain/service/impl/AuthenticationServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/AuthenticationServiceImpl.java new file mode 100644 index 0000000..89ac9f4 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/service/impl/AuthenticationServiceImpl.java @@ -0,0 +1,42 @@ +package com.example.demo.app.domain.service.impl; + +import org.springframework.stereotype.Service; + +import com.example.demo.app.domain.model.AuthenticationModel; +import com.example.demo.app.domain.service.AuthenticationService; +import com.example.demo.app.infra.entity.UserEntity; +import com.example.demo.app.infra.repository.UserRepository; +import com.example.demo.app.presentation.form.AuthenticationForm; + +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class AuthenticationServiceImpl implements AuthenticationService { + + private final UserRepository userRepository; + + @Override + public AuthenticationModel authenticate(AuthenticationForm authenticationForm) { + + UserEntity userEntity = userRepository.findByMailAddress( + authenticationForm.getMailAddress()) + .orElse(null); + + if (userEntity == null) { + return null; + } + + if (!userEntity.getQuestionEntity().getSecretQuestionId() + .equals(authenticationForm.getSecretQuestionId())) { + return null; + } + + if (!userEntity.getSecretQuestionAnswer() + .equals(authenticationForm.getSecretAnswer())) { + return null; + } + + return new AuthenticationModel(userEntity.getUserId()); + } +} diff --git a/src/main/java/com/example/demo/app/domain/service/impl/CourseInfoServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/CourseInfoServiceImpl.java deleted file mode 100644 index 4658a18..0000000 --- a/src/main/java/com/example/demo/app/domain/service/impl/CourseInfoServiceImpl.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.demo.app.domain.service.impl; - -import java.util.List; - -import org.springframework.stereotype.Service; - -import com.example.demo.app.domain.model.CourseInfoModel; -import com.example.demo.app.domain.service.CourseInfoService; -import com.example.demo.app.infra.repository.AllocationRepository; - -import lombok.RequiredArgsConstructor; - -@Service -@RequiredArgsConstructor -public class CourseInfoServiceImpl implements CourseInfoService { - - private final AllocationRepository allocationRepository; - - @Override - public List findAll() { - return allocationRepository.findAllJoinedAllocation(); - } -} diff --git a/src/main/java/com/example/demo/app/domain/service/impl/CourseServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/CourseServiceImpl.java index a4dec5f..fa62a60 100644 --- a/src/main/java/com/example/demo/app/domain/service/impl/CourseServiceImpl.java +++ b/src/main/java/com/example/demo/app/domain/service/impl/CourseServiceImpl.java @@ -18,6 +18,7 @@ public class CourseServiceImpl implements CourseService { private final CourseRepository courseRepository; public List findAll(){ + return CourseEntity.createCourseModelList(courseRepository.findAll()); } diff --git a/src/main/java/com/example/demo/app/domain/service/impl/PasswordResetServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/PasswordResetServiceImpl.java deleted file mode 100644 index 2866cea..0000000 --- a/src/main/java/com/example/demo/app/domain/service/impl/PasswordResetServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.example.demo.app.domain.service.impl; - -import org.springframework.stereotype.Service; - -import com.example.demo.app.domain.service.PasswordResetService; -import com.example.demo.app.infra.entity.UserEntity; -import com.example.demo.app.infra.repository.UserRepository; -import com.example.demo.app.presentation.form.PasswordResetForm; - -import lombok.RequiredArgsConstructor; - -@Service -@RequiredArgsConstructor -public class PasswordResetServiceImpl implements PasswordResetService { - - private final UserRepository userRepository; - - @Override - public boolean resetPassword( - Long userId, - PasswordResetForm passwordResetForm) { - - if (!passwordResetForm.getPassword() - .equals(passwordResetForm.getPasswordConfirm())) { - return false; - } - - UserEntity userEntity = - userRepository.findById(userId).orElse(null); - - if (userEntity == null) { - return false; - } - - userEntity.setPassword(passwordResetForm.getPassword()); - - userRepository.save(userEntity); - - return true; - } -} diff --git a/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java deleted file mode 100644 index a74f42b..0000000 --- a/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -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.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); - } -} diff --git a/src/main/java/com/example/demo/app/presentation/controller/AnalysisController.java b/src/main/java/com/example/demo/app/presentation/controller/AnalysisController.java index 5bc8cd9..a3a745f 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/AnalysisController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/AnalysisController.java @@ -24,15 +24,15 @@ public class AnalysisController { public String showAnalysis(Model model, HttpSession session) { //ログインユーザーの取得(セッション) - LoginModel loginUser = (LoginModel) session.getAttribute("loginUser"); - + LoginModel loginUser = (LoginModel) session.getAttribute("loginUser"); + //分析結果の取得(Service) - AnalysisModel analysisModel = analysisService.getAnalysis(loginUser.getUserId()); - - AnalysisForm analysisForm = AnalysisForm.convertFrom(analysisModel); - + AnalysisModel analysisModel = analysisService.getAnalysis(loginUser.getUserId()); + + AnalysisForm analysisForm = AnalysisForm.convertFrom(analysisModel); + //model格納 - model.addAttribute("analysisForm", analysisForm); + model.addAttribute("analysisForm", analysisForm); return "analysis"; } diff --git a/src/main/java/com/example/demo/app/presentation/controller/AuthenticationController.java b/src/main/java/com/example/demo/app/presentation/controller/AuthenticationController.java new file mode 100644 index 0000000..5cf8569 --- /dev/null +++ b/src/main/java/com/example/demo/app/presentation/controller/AuthenticationController.java @@ -0,0 +1,56 @@ +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.PostMapping; + +import com.example.demo.app.domain.model.AuthenticationModel; +import com.example.demo.app.domain.service.AuthenticationService; +import com.example.demo.app.infra.repository.QuestionRepository; +import com.example.demo.app.presentation.form.AuthenticationForm; + +import lombok.RequiredArgsConstructor; + +@Controller +@RequiredArgsConstructor +public class AuthenticationController { + + private final AuthenticationService authenticationService; + private final QuestionRepository questionRepository; + + @GetMapping("/authentication") + public String showAuthentication(Model model) { + + model.addAttribute("authenticationForm", new AuthenticationForm()); + model.addAttribute("questionList", questionRepository.findAll()); + + return "authentication"; + } + + @PostMapping("/authentication") + public String authenticate( + AuthenticationForm authenticationForm, + Model model, + HttpSession session) { + + AuthenticationModel authenticationModel = + authenticationService.authenticate(authenticationForm); + + if (authenticationModel == null) { + model.addAttribute("errorMessage", "認証情報が正しくありません。"); + model.addAttribute("questionList", questionRepository.findAll()); + + return "authentication"; + } + + session.setAttribute( + "passwordResetUserId", + authenticationModel.getUserId()); + + return "password_reset"; + + } +} diff --git a/src/main/java/com/example/demo/app/presentation/controller/PasswordResetController.java b/src/main/java/com/example/demo/app/presentation/controller/PasswordResetController.java deleted file mode 100644 index b5fcfba..0000000 --- a/src/main/java/com/example/demo/app/presentation/controller/PasswordResetController.java +++ /dev/null @@ -1,61 +0,0 @@ -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.PostMapping; - -import com.example.demo.app.domain.service.PasswordResetService; -import com.example.demo.app.presentation.form.PasswordResetForm; - -import lombok.RequiredArgsConstructor; - -@Controller -@RequiredArgsConstructor -public class PasswordResetController { - - private final PasswordResetService passwordResetService; - - @GetMapping("/password_reset") - public String showPasswordReset(Model model) { - - model.addAttribute( - "passwordResetForm", - new PasswordResetForm()); - - return "password_reset"; - } - - @PostMapping("/password_reset") - public String resetPassword( - PasswordResetForm passwordResetForm, - Model model, - HttpSession session) { - - Long userId = - (Long) session.getAttribute("passwordResetUserId"); - - if (userId == null) { - return "redirect:/login"; - } - - boolean isReset = - passwordResetService.resetPassword( - userId, - passwordResetForm); - - if (!isReset) { - model.addAttribute( - "errorMessage", - "パスワードが一致していません。"); - - return "password_reset"; - } - - session.removeAttribute("passwordResetUserId"); - - return "redirect:/login"; - } -} diff --git a/src/main/java/com/example/demo/app/presentation/controller/UserController.java b/src/main/java/com/example/demo/app/presentation/controller/UserController.java deleted file mode 100644 index 7b2aef4..0000000 --- a/src/main/java/com/example/demo/app/presentation/controller/UserController.java +++ /dev/null @@ -1,49 +0,0 @@ -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) { - model.addAttribute("userForm", new 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"; - } - - -} diff --git a/src/main/java/com/example/demo/app/presentation/form/AllocationForm.java b/src/main/java/com/example/demo/app/presentation/form/AllocationForm.java new file mode 100644 index 0000000..6c28c9b --- /dev/null +++ b/src/main/java/com/example/demo/app/presentation/form/AllocationForm.java @@ -0,0 +1,28 @@ +package com.example.demo.app.presentation.form; + +import java.util.List; + +import com.example.demo.app.domain.model.AllocationModel; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AllocationForm { + + private Long categoryId; + private Long courseId; + private Integer allocationRatio; + + public static AllocationForm convertFrom(AllocationModel allocationModel) { + return new AllocationForm(allocationModel.getCategoryId(), allocationModel.getCourseId(), allocationModel.getAllocationRatio()); + } + + public static List convertFrom(List allocationModelList){ + return allocationModelList.stream().map(AllocationForm::convertFrom).toList(); + } + +} diff --git a/src/main/java/com/example/demo/app/presentation/form/AnalysisForm.java b/src/main/java/com/example/demo/app/presentation/form/AnalysisForm.java index c9c4202..1594955 100644 --- a/src/main/java/com/example/demo/app/presentation/form/AnalysisForm.java +++ b/src/main/java/com/example/demo/app/presentation/form/AnalysisForm.java @@ -13,20 +13,23 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class AnalysisForm { - private Integer currentMonthTotalAmount; - private Integer previousMonthTotalAmount; - private Integer totalDifferenceAmount; - private List categoryAnalysisFormList; - - public static AnalysisForm convertFrom( - AnalysisModel analysisModel) { + private Integer currentMonthTotalAmount; - return new AnalysisForm( - analysisModel.getCurrentMonthTotalAmount(), - analysisModel.getPreviousMonthTotalAmount(), - analysisModel.getTotalDifferenceAmount(), - CategoryAnalysisForm.convertFrom( - analysisModel.getCategoryAnalysisModelList())); - } + private Integer previousMonthTotalAmount; + private Integer totalDifferenceAmount; + + private List + categoryAnalysisFormList; + + public static AnalysisForm convertFrom( + AnalysisModel analysisModel) { + + return new AnalysisForm( + analysisModel.getCurrentMonthTotalAmount(), + analysisModel.getPreviousMonthTotalAmount(), + analysisModel.getTotalDifferenceAmount(), + CategoryAnalysisForm.convertFrom( + analysisModel.getCategoryAnalysisModelList())); + } } diff --git a/src/main/java/com/example/demo/app/presentation/form/PasswordResetForm.java b/src/main/java/com/example/demo/app/presentation/form/AuthenticationForm.java similarity index 57% rename from src/main/java/com/example/demo/app/presentation/form/PasswordResetForm.java rename to src/main/java/com/example/demo/app/presentation/form/AuthenticationForm.java index 3213e1b..2c27a5d 100644 --- a/src/main/java/com/example/demo/app/presentation/form/PasswordResetForm.java +++ b/src/main/java/com/example/demo/app/presentation/form/AuthenticationForm.java @@ -7,7 +7,8 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -public class PasswordResetForm { - private String password; - private String passwordConfirm; +public class AuthenticationForm { + private String mailAddress; + private Integer secretQuestionId; + private String secretAnswer; } diff --git a/src/main/java/com/example/demo/app/presentation/form/CategoryAnalysisForm.java b/src/main/java/com/example/demo/app/presentation/form/CategoryAnalysisForm.java index add1762..1b44353 100644 --- a/src/main/java/com/example/demo/app/presentation/form/CategoryAnalysisForm.java +++ b/src/main/java/com/example/demo/app/presentation/form/CategoryAnalysisForm.java @@ -12,8 +12,8 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor public class CategoryAnalysisForm { - - private String categoryName; + + private String categoryName; private Integer currentMonthAmount; @@ -24,25 +24,24 @@ public class CategoryAnalysisForm { private Integer courseLimitAmount; private Integer courseDifferenceAmount; - - public static CategoryAnalysisForm convertFrom( - - CategoryAnalysisModel categoryAnalysisModel) { - return new CategoryAnalysisForm( - categoryAnalysisModel.getCategoryName(), - categoryAnalysisModel.getCurrentMonthAmount(), - categoryAnalysisModel.getPreviousMonthAmount(), - categoryAnalysisModel.getMonthDifferenceAmount(), - categoryAnalysisModel.getCourseLimitAmount(), - categoryAnalysisModel.getCourseDifferenceAmount()); - } - - public static List convertFrom( - List categoryAnalysisModelList) { - - return categoryAnalysisModelList.stream() - .map(CategoryAnalysisForm::convertFrom) - .toList(); - } + public static CategoryAnalysisForm convertFrom( + CategoryAnalysisModel categoryAnalysisModel) { + + return new CategoryAnalysisForm( + categoryAnalysisModel.getCategoryName(), + categoryAnalysisModel.getCurrentMonthAmount(), + categoryAnalysisModel.getPreviousMonthAmount(), + categoryAnalysisModel.getMonthDifferenceAmount(), + categoryAnalysisModel.getCourseLimitAmount(), + categoryAnalysisModel.getCourseDifferenceAmount()); + } + + public static List convertFrom( + List categoryAnalysisModelList) { + + return categoryAnalysisModelList.stream() + .map(CategoryAnalysisForm::convertFrom) + .toList(); + } } diff --git a/src/main/java/com/example/demo/app/presentation/form/CourseInfoForm.java b/src/main/java/com/example/demo/app/presentation/form/CourseInfoForm.java index addce2f..e034917 100644 --- a/src/main/java/com/example/demo/app/presentation/form/CourseInfoForm.java +++ b/src/main/java/com/example/demo/app/presentation/form/CourseInfoForm.java @@ -25,7 +25,7 @@ public class CourseInfoForm { public static CourseInfoForm convertFrom(CourseInfoModel courseInfoModel ) { - return new CourseInfoForm(courseInfoModel.getCategoryId(), courseInfoModel.getCourseName(), courseInfoModel.getCategoryId(), courseInfoModel.getCategoryName(), courseInfoModel.getAllocationRatio()); + return new CourseInfoForm(courseInfoModel.getCourseId(), courseInfoModel.getCourseName(), courseInfoModel.getCategoryId(), courseInfoModel.getCategoryName(), courseInfoModel.getAllocationRatio()); } public static List convertFrom(List courseInfoModelList ) { diff --git a/src/main/java/com/example/demo/app/presentation/form/UserForm.java b/src/main/java/com/example/demo/app/presentation/form/UserForm.java deleted file mode 100644 index e51f23f..0000000 --- a/src/main/java/com/example/demo/app/presentation/form/UserForm.java +++ /dev/null @@ -1,24 +0,0 @@ -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; -} diff --git a/src/main/resources/templates/Authentication.html b/src/main/resources/templates/Authentication.html new file mode 100644 index 0000000..336b3cc --- /dev/null +++ b/src/main/resources/templates/Authentication.html @@ -0,0 +1,53 @@ + + + + + + 認証 + + + +
+

本人認証確認

+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+ +
+ +
+
+ + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/analysis.html b/src/main/resources/templates/analysis.html index 55201dd..22b1075 100644 --- a/src/main/resources/templates/analysis.html +++ b/src/main/resources/templates/analysis.html @@ -1,18 +1,21 @@ - + 分析画面 +
+
+

支出分析

- + @@ -24,8 +27,8 @@ 0 - + @@ -63,16 +62,16 @@
カテゴリ別 支出 前月比
@@ -42,11 +45,7 @@
カテゴリ別 支出 - 前月比 -
- コース比 -
前月比
コース比

diff --git a/src/main/resources/templates/header.html b/src/main/resources/templates/header.html new file mode 100644 index 0000000..29aac43 --- /dev/null +++ b/src/main/resources/templates/header.html @@ -0,0 +1,29 @@ + + + + +ヘッダー + + + + +
+ + + +
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/password_reset.html b/src/main/resources/templates/password_reset.html deleted file mode 100644 index 522fd4b..0000000 --- a/src/main/resources/templates/password_reset.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - -パスワード再設定 - - -
- -
-

パスワード再設定

- -
-
- - -
- -
- - -
- - -
- -
-

-
-
- - \ No newline at end of file diff --git a/src/main/resources/templates/user_register_confirm.html b/src/main/resources/templates/user_register_confirm.html index 2b35041..aad56dd 100644 --- a/src/main/resources/templates/user_register_confirm.html +++ b/src/main/resources/templates/user_register_confirm.html @@ -1,5 +1,5 @@ - + 新規会員登録確認