Compare commits
31 Commits
1369d839af
...
064b74c49b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
064b74c49b | ||
|
|
4fc69cddb3 | ||
|
|
c7e68f6a4f | ||
|
|
083ad8644d | ||
|
|
7e648b9466 | ||
| 54512e411a | |||
|
|
19989111ec | ||
|
|
4f49c24c99 | ||
|
|
8763f88de4 | ||
|
|
5ab8109504 | ||
| be286201f5 | |||
|
|
d31d6aaf2d | ||
|
|
42bb3c608f | ||
| c279045228 | |||
|
|
67ad98b0ae | ||
| d65a84ea79 | |||
| 79cbbc1f2b | |||
|
|
792172664c | ||
| 1170c710e3 | |||
| fbd1746776 | |||
|
|
073ed5e864 | ||
| 9bc5bd20ac | |||
|
|
882212aed5 | ||
| 5506f5884b | |||
|
|
844c023ef2 | ||
| a6a9cb0b63 | |||
| 6c24eba7bf | |||
| 3d857952c9 | |||
| 83e97b7ec1 | |||
| c21e90185b | |||
| 91823240da |
@@ -0,0 +1,10 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LoginModel {
|
||||||
|
private Long userId;
|
||||||
|
}
|
||||||
@@ -3,7 +3,9 @@ package com.example.demo.app.domain.model;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||||
import com.example.demo.app.infra.entity.TransactionEntity;
|
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -35,4 +37,13 @@ public class TransactionModel {
|
|||||||
return transactionEntityList.stream().map(TransactionModel::convertFrom).toList();
|
return transactionEntityList.stream().map(TransactionModel::convertFrom).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TransactionEntity convertTo(TransactionModel transactionModel, UserEntity userEntity, CategoryEntity categoryEntity) {
|
||||||
|
return new TransactionEntity(
|
||||||
|
transactionModel.getTransactionId(),
|
||||||
|
userEntity,
|
||||||
|
categoryEntity,
|
||||||
|
transactionModel.getAmount(),
|
||||||
|
transactionModel.getTransactionDate());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserModel {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private String userName;
|
||||||
|
private String emailAddress;
|
||||||
|
private String password;
|
||||||
|
private Integer secretQuestionId;
|
||||||
|
private String secretAnswer;
|
||||||
|
private LocalDate brithDate;
|
||||||
|
private Integer saving;
|
||||||
|
private Integer annualIncome;
|
||||||
|
private Integer monthlyBudget;
|
||||||
|
private Integer goalId;
|
||||||
|
private Integer courseId;
|
||||||
|
private Integer deleteFlag;
|
||||||
|
}
|
||||||
@@ -9,4 +9,6 @@ public interface CategoryService {
|
|||||||
public List<CategoryModel> findAll();
|
public List<CategoryModel> findAll();
|
||||||
|
|
||||||
public CategoryModel findOne(Long categoryId);
|
public CategoryModel findOne(Long categoryId);
|
||||||
|
|
||||||
|
public CategoryModel findOneByCategoryName(String categoryName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
|
|
||||||
|
public interface LoginService {
|
||||||
|
|
||||||
|
LoginModel login(String mailAddress, String password);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -16,4 +16,8 @@ public interface TransactionService {
|
|||||||
|
|
||||||
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId);
|
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
public int createTransaction(TransactionModel transactionModel);
|
||||||
|
|
||||||
|
public int updateTransaction(TransactionModel transactionModel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.example.demo.app.domain.service;
|
package com.example.demo.app.domain.service.impl;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.example.demo.app.domain.model.AnalysisModel;
|
import com.example.demo.app.domain.model.AnalysisModel;
|
||||||
|
import com.example.demo.app.domain.service.AnalysisService;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CategoryServiceImpl implements CategoryService{
|
public class CategoryServiceImpl implements CategoryService {
|
||||||
|
|
||||||
private final CategoryRepository categoryRepository;
|
private final CategoryRepository categoryRepository;
|
||||||
|
|
||||||
@@ -36,4 +36,16 @@ public class CategoryServiceImpl implements CategoryService{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CategoryModel findOneByCategoryName(String categoryName) {
|
||||||
|
|
||||||
|
CategoryEntity categoryModel = categoryRepository.findByCategoryName(categoryName);
|
||||||
|
|
||||||
|
if (categoryModel == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CategoryModel.convertFrom(categoryModel);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.example.demo.app.domain.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.LoginModel;
|
||||||
|
import com.example.demo.app.domain.service.LoginService;
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
import com.example.demo.app.infra.repository.UserRepository;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LoginServiceImpl implements LoginService {
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginModel login(String mailAddress, String password) {
|
||||||
|
|
||||||
|
UserEntity userEntity = userRepository.findByMailAddressAndPassword(
|
||||||
|
mailAddress,
|
||||||
|
password).orElse(null);
|
||||||
|
|
||||||
|
if (userEntity == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LoginModel(userEntity.getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,14 +3,19 @@ package com.example.demo.app.domain.service.impl;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.example.demo.app.domain.model.TransactionModel;
|
import com.example.demo.app.domain.model.TransactionModel;
|
||||||
import com.example.demo.app.domain.service.TransactionService;
|
import com.example.demo.app.domain.service.TransactionService;
|
||||||
|
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||||
import com.example.demo.app.infra.entity.TransactionEntity;
|
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
import com.example.demo.app.infra.repository.CategoryRepository;
|
||||||
import com.example.demo.app.infra.repository.TransactionRepository;
|
import com.example.demo.app.infra.repository.TransactionRepository;
|
||||||
|
import com.example.demo.app.infra.repository.UserRepository;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
@@ -19,6 +24,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
public class TransactionServiceImpl implements TransactionService {
|
public class TransactionServiceImpl implements TransactionService {
|
||||||
|
|
||||||
private final TransactionRepository transactionRepository;
|
private final TransactionRepository transactionRepository;
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
private final CategoryRepository categoryRepository;
|
||||||
|
|
||||||
public Map<LocalDate, List<TransactionModel>> findAllByDate(LocalDate startDate, LocalDate endDate, Long userId) {
|
public Map<LocalDate, List<TransactionModel>> findAllByDate(LocalDate startDate, LocalDate endDate, Long userId) {
|
||||||
|
|
||||||
@@ -40,6 +47,7 @@ public class TransactionServiceImpl implements TransactionService {
|
|||||||
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId) {
|
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId) {
|
||||||
|
|
||||||
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
||||||
@@ -52,4 +60,59 @@ public class TransactionServiceImpl implements TransactionService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int createTransaction(TransactionModel transactionModel) {
|
||||||
|
|
||||||
|
Optional<UserEntity> userEntityOptional = userRepository.findById(transactionModel.getUserId());
|
||||||
|
|
||||||
|
if (userEntityOptional.isEmpty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<CategoryEntity> categoryEntityOptional = categoryRepository.findById(transactionModel.getCategoryId());
|
||||||
|
if (categoryEntityOptional.isEmpty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TransactionEntity transactionEntity = TransactionModel.convertTo(
|
||||||
|
transactionModel,
|
||||||
|
userEntityOptional.get(),
|
||||||
|
categoryEntityOptional.get());
|
||||||
|
if (transactionRepository.save(transactionEntity) != null) {
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int updateTransaction(TransactionModel transactionModel) {
|
||||||
|
|
||||||
|
if (!transactionRepository.existsById(transactionModel.getTransactionId())) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<UserEntity> userEntityOptional = userRepository.findById(transactionModel.getUserId());
|
||||||
|
|
||||||
|
if (userEntityOptional.isEmpty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<CategoryEntity> categoryEntityOptional = categoryRepository.findById(transactionModel.getCategoryId());
|
||||||
|
if (categoryEntityOptional.isEmpty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TransactionEntity transactionEntity = TransactionModel.convertTo(
|
||||||
|
transactionModel,
|
||||||
|
userEntityOptional.get(),
|
||||||
|
categoryEntityOptional.get());
|
||||||
|
if (transactionRepository.save(transactionEntity) != null) {
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.example.demo.app.infra.entity;
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.FetchType;
|
import jakarta.persistence.FetchType;
|
||||||
@@ -9,12 +11,14 @@ import jakarta.persistence.ManyToOne;
|
|||||||
import jakarta.persistence.OneToOne;
|
import jakarta.persistence.OneToOne;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.AllocationModel;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "allocation")
|
@Table(name = "allocation_m")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -33,4 +37,15 @@ public class AllocationEntity {
|
|||||||
@Column(name = "allocation_ratio", nullable = false)
|
@Column(name = "allocation_ratio", nullable = false)
|
||||||
private Integer allocationRatio;
|
private Integer allocationRatio;
|
||||||
|
|
||||||
|
|
||||||
|
public static List<AllocationModel> createAllocationModelList(List<AllocationEntity> allocationEntityList) {
|
||||||
|
|
||||||
|
return allocationEntityList
|
||||||
|
.stream()
|
||||||
|
.map(allocationEntity -> new AllocationModel(
|
||||||
|
allocationEntity.getCategoryEntity().getCategoryId(),
|
||||||
|
allocationEntity.getCourseEntity().getCourseId(),
|
||||||
|
allocationEntity.getAllocationRatio()
|
||||||
|
)).toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "category")
|
@Table(name = "category_t")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.CourseModel;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "course")
|
@Table(name = "course_m")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -41,4 +43,16 @@ public class CourseEntity {
|
|||||||
@OneToOne(mappedBy = "courseEntity")
|
@OneToOne(mappedBy = "courseEntity")
|
||||||
private List<AllocationEntity> allocationEntity;
|
private List<AllocationEntity> allocationEntity;
|
||||||
|
|
||||||
|
|
||||||
|
public static List<CourseModel> createCourseModelList(List<CourseEntity> courseEntityList) {
|
||||||
|
|
||||||
|
return courseEntityList
|
||||||
|
.stream()
|
||||||
|
.map(courseEntity -> new CourseModel(
|
||||||
|
courseEntity.getCourseId(),
|
||||||
|
courseEntity.getCourseName(),
|
||||||
|
courseEntity.getDescription()
|
||||||
|
)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "goal")
|
@Table(name = "goal_t")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "question")
|
@Table(name = "question_m")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "transaction")
|
@Table(name = "transaction_t")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -28,12 +28,6 @@ public class TransactionEntity {
|
|||||||
@Column(name = "transaction_id")
|
@Column(name = "transaction_id")
|
||||||
private Long transactionId;
|
private Long transactionId;
|
||||||
|
|
||||||
@Column(name = "amount", nullable = false)
|
|
||||||
private Integer amount;
|
|
||||||
|
|
||||||
@Column(name = "transaction_date", nullable = false)
|
|
||||||
private LocalDate transactionDate;
|
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "user_id")
|
@JoinColumn(name = "user_id")
|
||||||
private UserEntity userEntity;
|
private UserEntity userEntity;
|
||||||
@@ -42,4 +36,10 @@ public class TransactionEntity {
|
|||||||
@JoinColumn(name = "category_id")
|
@JoinColumn(name = "category_id")
|
||||||
private CategoryEntity categoryEntity;
|
private CategoryEntity categoryEntity;
|
||||||
|
|
||||||
|
@Column(name = "amount", nullable = false)
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
@Column(name = "transaction_date", nullable = false)
|
||||||
|
private LocalDate transactionDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "user")
|
@Table(name = "user_t")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -59,10 +59,10 @@ public class UserEntity {
|
|||||||
private Integer deleteFlag;
|
private Integer deleteFlag;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "userEntity")
|
@OneToMany(mappedBy = "userEntity")
|
||||||
private List<TransactionEntity> transactionEntity;
|
private List<TransactionEntity> transactionEntityList;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "question_id")
|
@JoinColumn(name = "secret_question_id")
|
||||||
private QuestionEntity questionEntity;
|
private QuestionEntity questionEntity;
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.example.demo.app.infra.repository;
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
import com.example.demo.app.infra.entity.AllocationEntity;
|
import com.example.demo.app.infra.entity.AllocationEntity;
|
||||||
|
|
||||||
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
|
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
|
||||||
|
|
||||||
|
List<AllocationEntity> findByCourseId(Long courseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
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 org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import com.example.demo.app.infra.entity.CategoryEntity;
|
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||||
|
|
||||||
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> {
|
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> {
|
||||||
|
|
||||||
|
|
||||||
|
@Query("select c from CategoryEntity c where c.categoryName = :categoryName")
|
||||||
|
public CategoryEntity findByCategoryName(@Param("categoryName") String categoryName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.QuestionEntity;
|
||||||
|
|
||||||
|
public interface QuestionRepository extends JpaRepository<QuestionEntity, Long> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,4 +22,6 @@ public interface TransactionRepository extends JpaRepository<TransactionEntity,
|
|||||||
@Query("select sum(t.amount) from TransactionEntity t inner join CategoryEntity c on t.categoryId = c.categoryId where (t.userId = :userId and t.transactionDate between :startDate and :endDate) and c.transactionType = 1")
|
@Query("select sum(t.amount) from TransactionEntity t inner join CategoryEntity c on t.categoryId = c.categoryId where (t.userId = :userId and t.transactionDate between :startDate and :endDate) and c.transactionType = 1")
|
||||||
public Integer findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId);
|
public Integer findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
@Query("select sum(t.amount) from TransactionEntity t where t.userEntity.userId = :userId and t.categoryEntity.categoryId = :categoryId and t.transactionDate between :startDate and :endDate")
|
||||||
|
public Integer findCategoryExpense(LocalDate startDate, LocalDate endDate, Long userId, Long categoryId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||||
|
|
||||||
|
@Query("select u from UserEntity u where u.mailAddress = :mailAddress and u.password = :password and u.deleteFlag = 0")
|
||||||
|
Optional<UserEntity> findByMailAddressAndPassword(
|
||||||
|
String mailAddress,
|
||||||
|
String password);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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.domain.model.LoginModel;
|
||||||
|
import com.example.demo.app.domain.service.LoginService;
|
||||||
|
import com.example.demo.app.presentation.form.LoginForm;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LoginController {
|
||||||
|
|
||||||
|
private final LoginService loginService;
|
||||||
|
|
||||||
|
@GetMapping("/login")
|
||||||
|
public String showLogin(Model model) {
|
||||||
|
|
||||||
|
model.addAttribute(
|
||||||
|
"loginForm",
|
||||||
|
new LoginForm());
|
||||||
|
|
||||||
|
return "login";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/login")
|
||||||
|
public String login(
|
||||||
|
@ModelAttribute LoginForm loginForm,
|
||||||
|
Model model,
|
||||||
|
HttpSession session) {
|
||||||
|
|
||||||
|
LoginModel loginModel = loginService.login(
|
||||||
|
loginForm.getMailAddress(),
|
||||||
|
loginForm.getPassword());
|
||||||
|
|
||||||
|
if (loginModel == null) {
|
||||||
|
model.addAttribute(
|
||||||
|
"errorMessage",
|
||||||
|
"Email address or password is incorrect.");
|
||||||
|
|
||||||
|
return "login";
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setAttribute("loginUser", loginModel);
|
||||||
|
|
||||||
|
return "menu";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,8 +11,11 @@ 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.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
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.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.TransactionService;
|
import com.example.demo.app.domain.service.TransactionService;
|
||||||
import com.example.demo.app.presentation.form.CategoryForm;
|
import com.example.demo.app.presentation.form.CategoryForm;
|
||||||
@@ -26,27 +29,32 @@ public class TransactionController {
|
|||||||
|
|
||||||
private final TransactionService transactionService;
|
private final TransactionService transactionService;
|
||||||
private final CategoryService categoryService;
|
private final CategoryService categoryService;
|
||||||
|
|
||||||
// 一覧画面
|
// 一覧画面
|
||||||
|
|
||||||
@GetMapping("/transaction/list")
|
@GetMapping("/transaction/list")
|
||||||
public String transactionList(@RequestParam LocalDate startDate, @RequestParam LocalDate endDate, Model model,
|
public String transactionList(@RequestParam(required = false) LocalDate startDates,
|
||||||
|
@RequestParam(required = false) LocalDate endDates, Model model,
|
||||||
HttpSession session) {
|
HttpSession session) {
|
||||||
|
|
||||||
LoginUser loginUser = (LoginUser) session.getAttribute("loginUser");
|
LocalDate startDate = (startDates == null) ? LocalDate.now().withDayOfMonth(1) : startDates;
|
||||||
|
|
||||||
|
LocalDate endDate = (endDates == null) ? LocalDate.now().withDayOfMonth(LocalDate.now().lengthOfMonth())
|
||||||
|
: endDates;
|
||||||
|
|
||||||
|
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||||
|
|
||||||
Map<LocalDate, List<TransactionForm>> transactionFormMap = new HashMap<>();
|
Map<LocalDate, List<TransactionForm>> transactionFormMap = new HashMap<>();
|
||||||
|
|
||||||
|
transactionService.findAllByDate(startDate, endDate, loginUser.getUserId()).forEach((date, list) -> {
|
||||||
transactionService.findAll(startDate, endDate, loginUser.getUserId).forEach((date, list) -> {
|
|
||||||
List<TransactionForm> transactionFormList = list.stream().map(transaction -> {
|
List<TransactionForm> transactionFormList = list.stream().map(transaction -> {
|
||||||
TransactionForm transactionForm = TransactionForm.convertFrom(
|
TransactionForm transactionForm = TransactionForm.convertFrom(
|
||||||
transaction,
|
transaction,
|
||||||
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getCategoryName(),
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId()))
|
||||||
transactionService.findTotalexpense(startDate, endDate, loginUser.getUserId),
|
.getCategoryName(),
|
||||||
transactionService.findTotalIncome(startDate, endDate, loginUser.getUserId),
|
transactionService.findTotalexpense(startDate, endDate, loginUser.getUserId()),
|
||||||
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getTransactionType()
|
transactionService.findTotalIncome(startDate, endDate, loginUser.getUserId()),
|
||||||
);
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId()))
|
||||||
|
.getTransactionType());
|
||||||
return transactionForm;
|
return transactionForm;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
transactionFormMap.put(date, transactionFormList);
|
transactionFormMap.put(date, transactionFormList);
|
||||||
@@ -54,30 +62,69 @@ public class TransactionController {
|
|||||||
|
|
||||||
model.addAttribute("transactionFormMap", transactionFormMap);
|
model.addAttribute("transactionFormMap", transactionFormMap);
|
||||||
|
|
||||||
return "transactionList";
|
return "transaction_list";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 詳細画面
|
// 詳細画面
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String findOne(@RequestParam LocalDate todayDate, Model model, HttpSession session) {
|
public String findOne(@RequestParam(required = false) LocalDate todayDates, Model model, HttpSession session) {
|
||||||
|
|
||||||
LoginUser loginUser = (LoginUser) session.getAttribute("loginUser");
|
LocalDate todayDate = (todayDates == null) ? LocalDate.now() : todayDates;
|
||||||
|
|
||||||
List<TransactionForm> transactionFormList = transactionService.findByUserIdAndDate(todayDate, ((LoginUser)session.getAttribute("loginUser")).getUserId).stream().map(transaction -> {
|
|
||||||
|
LoginModel loginUser = (LoginModel) session.getAttribute("loginUser");
|
||||||
|
|
||||||
|
List<TransactionForm> transactionFormList = transactionService
|
||||||
|
.findByUserIdAndDate(todayDate, loginUser.getUserId()).stream()
|
||||||
|
.map(transaction -> {
|
||||||
TransactionForm transactionForm = TransactionForm.convertFrom(
|
TransactionForm transactionForm = TransactionForm.convertFrom(
|
||||||
transaction,
|
transaction,
|
||||||
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getCategoryName(),
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId()))
|
||||||
transactionService.findTotalexpense(todayDate, todayDate, loginUser.getUserId),
|
.getCategoryName(),
|
||||||
transactionService.findTotalIncome(todayDate, todayDate, loginUser.getUserId),
|
transactionService.findTotalexpense(todayDate, todayDate, loginUser.getUserId()),
|
||||||
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getTransactionType()
|
transactionService.findTotalIncome(todayDate, todayDate, loginUser.getUserId()),
|
||||||
);
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId()))
|
||||||
|
.getTransactionType());
|
||||||
return transactionForm;
|
return transactionForm;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
model.addAttribute("transactionFormList", transactionFormList);
|
model.addAttribute("transactionFormList", transactionFormList);
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("")
|
||||||
|
public String createOneGet(@ModelAttribute TransactionForm transactionForm) {
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping()
|
||||||
|
public String createOnePost(@ModelAttribute TransactionForm transactionForm, Model model) {
|
||||||
|
|
||||||
|
if (transactionService.createTransaction(TransactionForm.convertTo(transactionForm)) != 0) {
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("")
|
||||||
|
public String updateOneGet(@ModelAttribute TransactionForm transactionForm) {
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping()
|
||||||
|
public String updateOnePost(@ModelAttribute TransactionForm transactionForm, Model model) {
|
||||||
|
|
||||||
|
if (transactionService.updateTransaction(TransactionForm.convertTo(transactionForm)) != 0) {
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.example.demo.app.presentation.form;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LoginForm {
|
||||||
|
|
||||||
|
private String mailAddress;
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ public class TransactionForm {
|
|||||||
|
|
||||||
private Integer transactionType;
|
private Integer transactionType;
|
||||||
|
|
||||||
|
|
||||||
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
||||||
return new TransactionForm(
|
return new TransactionForm(
|
||||||
transactionModel.getTransactionId(),
|
transactionModel.getTransactionId(),
|
||||||
@@ -45,6 +46,7 @@ public class TransactionForm {
|
|||||||
transactionType);
|
transactionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<TransactionForm> convertFrom(List<TransactionModel> transactionModelList, String categoryName, int income, int expense, int transactionType ) {
|
public static List<TransactionForm> convertFrom(List<TransactionModel> transactionModelList, String categoryName, int income, int expense, int transactionType ) {
|
||||||
return transactionModelList.stream().map(transactionModel -> TransactionForm.convertFrom(transactionModel, categoryName, income, expense, transactionType)).toList();
|
return transactionModelList.stream().map(transactionModel -> TransactionForm.convertFrom(transactionModel, categoryName, income, expense, transactionType)).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
60
src/main/resources/templates/analysis.html
Normal file
60
src/main/resources/templates/analysis.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
|
<title>分析画面</title>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h2 class="text-center">支出分析</h2>
|
||||||
|
|
||||||
|
<table class="table text-center">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">カテゴリ別</th>
|
||||||
|
<th scope="col">支出</th>
|
||||||
|
<th scope="col">前月比</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">総支出</th>
|
||||||
|
<td>¥234,000</td>
|
||||||
|
<td>+¥38,000</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<hr class="border border-primary border-2 opacity-50">
|
||||||
|
|
||||||
|
<table class="table text-center">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">カテゴリ別</th>
|
||||||
|
<th scope="col">支出</th>
|
||||||
|
<th scope="col">前月比<br>コース比</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">食費</th>
|
||||||
|
<td>¥34,000</td>
|
||||||
|
<td>+¥8,000<br>+¥1,100</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">交通費</th>
|
||||||
|
<td>¥14,000</td>
|
||||||
|
<td>+¥8,000<br>+¥1,100</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">日用品</th>
|
||||||
|
<td>¥4,000</td>
|
||||||
|
<td>+¥8,000<br>+¥1,100</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
47
src/main/resources/templates/login.html
Normal file
47
src/main/resources/templates/login.html
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!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>
|
||||||
|
|
||||||
|
<div th:if="${errorMessage}" th:text="${errorMessage}"></div>
|
||||||
|
<form th:action="@{/login}" th:object="${loginForm}" method="post">
|
||||||
|
<div>
|
||||||
|
<label for="emailAddress">メールアドレス</label>
|
||||||
|
|
||||||
|
<input type="email"
|
||||||
|
id="emailAddress"
|
||||||
|
th:field="{emailAddress}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="password">パスワード</label>
|
||||||
|
|
||||||
|
<input type="password"
|
||||||
|
id="password"
|
||||||
|
th:field="{password}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button type="submit">ログイン</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a href="@{user/register}">新規会員登録</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a href="@{password/authentication}">パスワードを忘れた方</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
136
src/main/resources/templates/user_register.html
Normal file
136
src/main/resources/templates/user_register.html
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
<!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="@{/user/register/confirm}" th:object="${userForm}" method="post">
|
||||||
|
<div>
|
||||||
|
<label for="userName">氏名</label>
|
||||||
|
<input type="text"
|
||||||
|
id="userName"
|
||||||
|
th:field="*{userName}"
|
||||||
|
maxlength="100"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="mailAddress">メールアドレス</label>
|
||||||
|
<input type="email"
|
||||||
|
id="mailAddress"
|
||||||
|
th:field="*{mailAddress}"
|
||||||
|
maxlength="255"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="birthDate">生年月日</label>
|
||||||
|
<input type="date"
|
||||||
|
id="birthDate"
|
||||||
|
th:field="*{birthDate}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="password">パスワード</label>
|
||||||
|
<input type="password"
|
||||||
|
id="password"
|
||||||
|
th:field="*{password}"
|
||||||
|
minlength="8"
|
||||||
|
maxlength="255"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="secretQuestionId">秘密の質問</label>
|
||||||
|
<select id="secretQuestionId"
|
||||||
|
th:field="*{secretQuestionId}"
|
||||||
|
required>
|
||||||
|
<option value="">選択してください</option>
|
||||||
|
<option th:each="question : ${questionList}"
|
||||||
|
th:value="${question.secretQuestionId}"
|
||||||
|
th:text="${question.questionText}">
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="secretAnswer">秘密の質問の回答</label>
|
||||||
|
<input type="text"
|
||||||
|
id="secretAnswer"
|
||||||
|
th:field="*{secretAnswer}"
|
||||||
|
maxlength="100"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="saving">貯蓄金</label>
|
||||||
|
<input type="number"
|
||||||
|
id="saving"
|
||||||
|
th:field="*{saving}"
|
||||||
|
min="0"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="annualIncome">年収</label>
|
||||||
|
<input type="number"
|
||||||
|
id="annualIncome"
|
||||||
|
th:field="*{annualIncome}"
|
||||||
|
min="0"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="monthlyBudget">月別使用可能金額</label>
|
||||||
|
<input type="number"
|
||||||
|
id="monthlyBudget"
|
||||||
|
th:field="*{monthlyBudget}"
|
||||||
|
min="0"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="goalId">目標</label>
|
||||||
|
<select id="goalId"
|
||||||
|
th:field="*{goalId}"
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button type="submit">作成</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form th:action="@{/login}" method="get">
|
||||||
|
<button type="submit">戻る</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
78
src/main/resources/templates/user_register_confirm.html
Normal file
78
src/main/resources/templates/user_register_confirm.html
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>新規会員登録確認</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header></header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<h1>新規会員登録確認</h1>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>氏名</p>
|
||||||
|
<p th:text="${session.userForm.userName}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>メールアドレス</p>
|
||||||
|
<p th:text="${session.userForm.mailAddress}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>生年月日</p>
|
||||||
|
<p th:text="${session.userForm.barthDate}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>パスワード</p>
|
||||||
|
<p>********</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>秘密の質問</p>
|
||||||
|
<p th:text="${session.userForm.secretQuestionId}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>秘密の質問の回答</p>
|
||||||
|
<p th:text="${session.userForm.secretAnswer}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>貯蓄金</p>
|
||||||
|
<p th:text="${session.userForm.saving}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>年収</p>
|
||||||
|
<p th:text="${session.userForm.annualIncome}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>月別使用可能額</p>
|
||||||
|
<p th:text="${session.userForm.monthlyBudget}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>目標</p>
|
||||||
|
<p th:text="${session.userForm.goalId}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>コース</p>
|
||||||
|
<p th:text="${session.userForm.courseId}" readonly></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<form th:action="@{/user/register}" method="get">
|
||||||
|
<button type="submit">戻る</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<form th:action="@{/user/register/complete}" method="post">
|
||||||
|
<button type="submit">確定</button>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user