Compare commits
45 Commits
s-kikuchi
...
844c023ef2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
844c023ef2 | ||
|
|
544ce423d0 | ||
| 6c24eba7bf | |||
|
|
6847f225c4 | ||
|
|
036a495bc7 | ||
| 3d857952c9 | |||
|
|
534fc2683d | ||
|
|
555d8ceb87 | ||
|
|
60159ea3fe | ||
|
|
3e0c6092aa | ||
|
|
8aba950a5f | ||
| c21e90185b | |||
|
|
4774badffe | ||
|
|
f3d599e696 | ||
| 91823240da | |||
|
|
7a38ba8e63 | ||
|
|
493dd26367 | ||
|
|
cf732c7a48 | ||
| 5b9db556e0 | |||
| e38153238d | |||
| 841a19688d | |||
| 8c4539dd49 | |||
|
|
e361e02aa8 | ||
|
|
837a82ef9a | ||
| 38b2c1b2cb | |||
| 16477f4ba1 | |||
| ad717036b4 | |||
| c7098f2ec3 | |||
| 67cd3e27ca | |||
| b2662693c2 | |||
|
|
e8eef1aa73 | ||
|
|
40ada62856 | ||
| acd31c9f2a | |||
| 842f2b55f8 | |||
|
|
c093fcad24 | ||
|
|
bae92ded58 | ||
|
|
210579de68 | ||
|
|
05797d47d4 | ||
|
|
9710b52d8d | ||
|
|
0561541bec | ||
|
|
a800606bb2 | ||
|
|
c41bcd1791 | ||
|
|
3e2af36bfb | ||
|
|
c9d0985c7f | ||
|
|
d9a556717c |
@@ -0,0 +1,20 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AnalysisModel {
|
||||||
|
|
||||||
|
private Integer currentMonthTotalAmount;
|
||||||
|
|
||||||
|
private Integer previousMonthTotalAmount;
|
||||||
|
|
||||||
|
private Integer totalDifferenceAmount;
|
||||||
|
|
||||||
|
private List<CategoryAnalysisModel>
|
||||||
|
categoryAnalysisModelList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CategoryAnalysisModel {
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
private Integer currentMonthAmount;
|
||||||
|
|
||||||
|
private Integer previousMonthAmount;
|
||||||
|
|
||||||
|
private Integer previousMonthDifferenceAmount;
|
||||||
|
|
||||||
|
private Integer courseLimitAmount;
|
||||||
|
|
||||||
|
private Integer courseDifferenceAmount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CategoryModel {
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
private String categoryName;
|
||||||
|
private Integer transactionType;
|
||||||
|
|
||||||
|
|
||||||
|
public static CategoryModel convertFrom(CategoryEntity categoryEntity) {
|
||||||
|
return new CategoryModel(
|
||||||
|
categoryEntity.getCategoryId(),
|
||||||
|
categoryEntity.getCategoryName(),
|
||||||
|
categoryEntity.getTransactionType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<CategoryModel> convertFrom(List<CategoryEntity> categoryEntityList) {
|
||||||
|
return categoryEntityList.stream().map(CategoryModel::convertFrom).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.example.demo.app.domain.model;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TransactionModel {
|
||||||
|
|
||||||
|
private Long transactionId;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
private LocalDate transactionDate;
|
||||||
|
|
||||||
|
public static TransactionModel convertFrom(TransactionEntity transactionEntity) {
|
||||||
|
return new TransactionModel(
|
||||||
|
transactionEntity.getTransactionId(),
|
||||||
|
transactionEntity.getUserEntity().getUserId(),
|
||||||
|
transactionEntity.getCategoryEntity().getCategoryId(),
|
||||||
|
transactionEntity.getAmount(),
|
||||||
|
transactionEntity.getTransactionDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<TransactionModel> convertFrom(List<TransactionEntity> transactionEntityList) {
|
||||||
|
return transactionEntityList.stream().map(TransactionModel::convertFrom).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.AnalysisModel;
|
||||||
|
|
||||||
|
public interface AnalysisService {
|
||||||
|
|
||||||
|
AnalysisModel getAnalysis(Long userId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.AnalysisModel;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AnalysisServiceImpl implements AnalysisService {
|
||||||
|
|
||||||
|
//Repositoryの呼び出し
|
||||||
|
// private final TransactionRepository transactionRepository;
|
||||||
|
// private final AllocationRepository allocationRepository;
|
||||||
|
// private final UserRepository userRepository;
|
||||||
|
// private final CategoryRepository categoryRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnalysisModel getAnalysis(Long userId) {
|
||||||
|
|
||||||
|
// ユーザー情報取得、月別使用可能資金取得
|
||||||
|
|
||||||
|
// 今月の期間取得
|
||||||
|
// 前月の期間取得
|
||||||
|
// 今月の支出取得
|
||||||
|
// 前月の支出取得
|
||||||
|
// コース配分取得
|
||||||
|
// カテゴリ別集計
|
||||||
|
// 前月との差額集計
|
||||||
|
//総支出算出
|
||||||
|
// コース限度額算出、コース別差額算出
|
||||||
|
// CategoryAnalysisModel生成
|
||||||
|
// AnalysisModelの生成
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.CategoryModel;
|
||||||
|
|
||||||
|
public interface CategoryService {
|
||||||
|
|
||||||
|
public List<CategoryModel> findAll();
|
||||||
|
|
||||||
|
public CategoryModel findOne(Long categoryId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
|
||||||
|
public interface LoginService {
|
||||||
|
|
||||||
|
UserEntity login(String mailAddress, String password);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.example.demo.app.domain.service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.TransactionModel;
|
||||||
|
|
||||||
|
public interface TransactionService {
|
||||||
|
|
||||||
|
public Map<LocalDate, List<TransactionModel>> findAllByDate(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
public List<TransactionModel> findByUserIdAndDate(LocalDate todayDate, Long userId);
|
||||||
|
|
||||||
|
public int findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.example.demo.app.domain.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.CategoryModel;
|
||||||
|
import com.example.demo.app.domain.service.CategoryService;
|
||||||
|
import com.example.demo.app.infra.entity.CategoryEntity;
|
||||||
|
import com.example.demo.app.infra.repository.CategoryRepository;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CategoryServiceImpl implements CategoryService{
|
||||||
|
|
||||||
|
private final CategoryRepository categoryRepository;
|
||||||
|
|
||||||
|
public List<CategoryModel> findAll() {
|
||||||
|
|
||||||
|
return CategoryModel.convertFrom(categoryRepository.findAll());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public CategoryModel findOne(Long categoryId) {
|
||||||
|
|
||||||
|
Optional<CategoryEntity> optionalCategoryModel = categoryRepository.findById(categoryId);
|
||||||
|
|
||||||
|
if (optionalCategoryModel.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CategoryModel.convertFrom(optionalCategoryModel.get());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.example.demo.app.domain.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
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 UserEntity login(String mailAddress, String password) {
|
||||||
|
|
||||||
|
return userRepository.findByMailAddressAndPassword(
|
||||||
|
mailAddress,
|
||||||
|
password).orElse(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.example.demo.app.domain.service.impl;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.TransactionModel;
|
||||||
|
import com.example.demo.app.domain.service.TransactionService;
|
||||||
|
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||||
|
import com.example.demo.app.infra.repository.TransactionRepository;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TransactionServiceImpl implements TransactionService {
|
||||||
|
|
||||||
|
private final TransactionRepository transactionRepository;
|
||||||
|
|
||||||
|
public Map<LocalDate, List<TransactionModel>> findAllByDate(LocalDate startDate, LocalDate endDate, Long userId) {
|
||||||
|
|
||||||
|
List<TransactionEntity> transactionEntityList = transactionRepository.findAllByDateAndUserId(startDate, endDate,
|
||||||
|
userId);
|
||||||
|
|
||||||
|
List<TransactionModel> transactionModelList = TransactionModel
|
||||||
|
.convertFrom(transactionEntityList);
|
||||||
|
|
||||||
|
Map<LocalDate, List<TransactionModel>> transactionModelMap = transactionModelList.stream()
|
||||||
|
.collect(Collectors.groupingBy(TransactionModel::getTransactionDate));
|
||||||
|
|
||||||
|
return transactionModelMap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId) {
|
||||||
|
|
||||||
|
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
||||||
|
|
||||||
|
}
|
||||||
|
public int findTotalexpense(LocalDate startDate, LocalDate endDate, Long userId) {
|
||||||
|
|
||||||
|
return transactionRepository.findTotalIncome(startDate, endDate, userId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TransactionModel> findByUserIdAndDate(LocalDate todayDate, Long userId) {
|
||||||
|
|
||||||
|
return TransactionModel.convertFrom(transactionRepository.findByUserIdAndDate(todayDate, userId));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.FetchType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "allocation")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AllocationEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "category_id")
|
||||||
|
private CategoryEntity categoryEntity;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "course_id")
|
||||||
|
private CourseEntity courseEntity;
|
||||||
|
|
||||||
|
@Column(name = "allocation_ratio", nullable = false)
|
||||||
|
private Integer allocationRatio;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "category")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CategoryEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "category_id")
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
@Column(name = "category_name", nullable = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@Column(name = "transaction_type", nullable = false)
|
||||||
|
private Integer transactionType;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "categoryEntity")
|
||||||
|
private List<TransactionEntity> transactionEntity;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "categoryEntity")
|
||||||
|
private List<AllocationEntity> allocationEntity;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import org.springframework.data.annotation.Id;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "course")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CourseEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "course_id")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
@Column(name = "course_name", nullable = false)
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "description", nullable = false)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "courseEntity")
|
||||||
|
private List<UserEntity> userEntity;
|
||||||
|
|
||||||
|
@OneToOne(mappedBy = "courseEntity")
|
||||||
|
private List<AllocationEntity> allocationEntity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "goal")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GoalEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "goal_id")
|
||||||
|
private Integer goalId;
|
||||||
|
|
||||||
|
@Column(name = "goal_title", nullable = true)
|
||||||
|
private String goalTitle;
|
||||||
|
|
||||||
|
@Column(name = "goal_subtitle", nullable = true)
|
||||||
|
private String goalSubtitle;
|
||||||
|
|
||||||
|
@Column(name = "target_amount", nullable = false)
|
||||||
|
private Integer targetAmount;
|
||||||
|
|
||||||
|
@Column(name = "deadline", nullable = false)
|
||||||
|
private LocalDate deadline;
|
||||||
|
|
||||||
|
@Column(name = "goal_complete", nullable = false)
|
||||||
|
private Integer goalComplete;
|
||||||
|
|
||||||
|
@OneToOne(mappedBy = "goalEntity")
|
||||||
|
private UserEntity userEntity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "question")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "secret_question_id")
|
||||||
|
private Integer secretQuestionId;
|
||||||
|
|
||||||
|
@Column(name = "question_text", nullable = false)
|
||||||
|
private String questionText;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "QuestionEntity")
|
||||||
|
private List<UserEntity> userEntity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.FetchType;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "transaction")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TransactionEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "transaction_id")
|
||||||
|
private Long transactionId;
|
||||||
|
|
||||||
|
@Column(name = "amount", nullable = false)
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
@Column(name = "transaction_date", nullable = false)
|
||||||
|
private LocalDate transactionDate;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "user_id")
|
||||||
|
private UserEntity userEntity;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "category_id")
|
||||||
|
private CategoryEntity categoryEntity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.example.demo.app.infra.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.FetchType;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.OneToMany;
|
||||||
|
import jakarta.persistence.OneToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "user_t")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "user_id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Column(name = "user_name", nullable = false)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Column(name = "mail_address", nullable = false)
|
||||||
|
private String mailAddress;
|
||||||
|
|
||||||
|
@Column(name = "password", nullable = false)
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Column(name = "secret_answer", nullable = false)
|
||||||
|
private String secretQuestionAnswer;
|
||||||
|
|
||||||
|
@Column(name = "birth_date", nullable = false)
|
||||||
|
private LocalDate birthDate;
|
||||||
|
|
||||||
|
@Column(name = "saving", nullable = false)
|
||||||
|
private Integer saving;
|
||||||
|
|
||||||
|
@Column(name = "annual_income", nullable = false)
|
||||||
|
private Integer annualIncome;
|
||||||
|
|
||||||
|
@Column(name = "monthly_budget", nullable = false)
|
||||||
|
private Integer monthlyBudget;
|
||||||
|
|
||||||
|
@Column(name = "delete_flag", nullable = false)
|
||||||
|
private Integer deleteFlag;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "userEntity")
|
||||||
|
private List<TransactionEntity> transactionEntityList;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "secret_question_id")
|
||||||
|
private QuestionEntity questionEntity;
|
||||||
|
|
||||||
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "goal_id")
|
||||||
|
private GoalEntity goalEntity;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "course_id")
|
||||||
|
private CourseEntity courseEntity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.AllocationEntity;
|
||||||
|
|
||||||
|
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.CategoryEntity;
|
||||||
|
|
||||||
|
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.CourseEntity;
|
||||||
|
|
||||||
|
public interface CourseRepository extends JpaRepository<CourseEntity, Long> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||||
|
|
||||||
|
public interface TransactionRepository extends JpaRepository<TransactionEntity, Long> {
|
||||||
|
|
||||||
|
@Query("select t from TransactionEntity t where t.userEntity.userId = :userId and t.transactionDate = :transactionDate")
|
||||||
|
public List<TransactionEntity> findByUserIdAndDate(LocalDate todayDate, Long userId);
|
||||||
|
|
||||||
|
@Query("select t from TransactionEntity t where (t.transactionDate between :startDate and :endDate) and (t.userId = :userId) order by t.transactionDate asc")
|
||||||
|
public List<TransactionEntity> findAllByDateAndUserId(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
@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 = 0")
|
||||||
|
public Integer findTotalExpense(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
@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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||||
|
|
||||||
|
Optional<UserEntity> findByMailAddressAndPassword(String mailAddress, String password);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.example.demo.app.presentation.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.service.AnalysisService;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AnalysisController {
|
||||||
|
|
||||||
|
private final AnalysisService analysisService;
|
||||||
|
|
||||||
|
@GetMapping("/analysis")
|
||||||
|
public String showAnalysis(Model model) {
|
||||||
|
|
||||||
|
//ログインユーザーの取得(セッション)
|
||||||
|
|
||||||
|
//分析結果の取得(Service)
|
||||||
|
|
||||||
|
//model格納
|
||||||
|
|
||||||
|
return "analysis";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.service.LoginService;
|
||||||
|
import com.example.demo.app.infra.entity.UserEntity;
|
||||||
|
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) {
|
||||||
|
|
||||||
|
UserEntity loginUser = loginService.login(
|
||||||
|
loginForm.getMailAddress(),
|
||||||
|
loginForm.getPassword());
|
||||||
|
|
||||||
|
if (loginUser == null) {
|
||||||
|
model.addAttribute(
|
||||||
|
"errorMessage",
|
||||||
|
"Email address or password is incorrect.");
|
||||||
|
|
||||||
|
return "login";
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setAttribute("loginUser", loginUser);
|
||||||
|
|
||||||
|
return "menu";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.example.demo.app.presentation.controller;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
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.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.service.CategoryService;
|
||||||
|
import com.example.demo.app.domain.service.TransactionService;
|
||||||
|
import com.example.demo.app.presentation.form.CategoryForm;
|
||||||
|
import com.example.demo.app.presentation.form.TransactionForm;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TransactionController {
|
||||||
|
|
||||||
|
private final TransactionService transactionService;
|
||||||
|
private final CategoryService categoryService;
|
||||||
|
|
||||||
|
// 一覧画面
|
||||||
|
|
||||||
|
@GetMapping("/transaction/list")
|
||||||
|
public String transactionList(@RequestParam LocalDate startDate, @RequestParam LocalDate endDate, Model model,
|
||||||
|
HttpSession session) {
|
||||||
|
|
||||||
|
LoginUser loginUser = (LoginUser) session.getAttribute("loginUser");
|
||||||
|
|
||||||
|
Map<LocalDate, List<TransactionForm>> transactionFormMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
transactionService.findAll(startDate, endDate, loginUser.getUserId).forEach((date, list) -> {
|
||||||
|
List<TransactionForm> transactionFormList = list.stream().map(transaction -> {
|
||||||
|
TransactionForm transactionForm = TransactionForm.convertFrom(
|
||||||
|
transaction,
|
||||||
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getCategoryName(),
|
||||||
|
transactionService.findTotalexpense(startDate, endDate, loginUser.getUserId),
|
||||||
|
transactionService.findTotalIncome(startDate, endDate, loginUser.getUserId),
|
||||||
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getTransactionType()
|
||||||
|
);
|
||||||
|
return transactionForm;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
transactionFormMap.put(date, transactionFormList);
|
||||||
|
});
|
||||||
|
|
||||||
|
model.addAttribute("transactionFormMap", transactionFormMap);
|
||||||
|
|
||||||
|
return "transactionList";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 詳細画面
|
||||||
|
@GetMapping()
|
||||||
|
public String findOne(@RequestParam LocalDate todayDate, Model model, HttpSession session) {
|
||||||
|
|
||||||
|
LoginUser loginUser = (LoginUser) session.getAttribute("loginUser");
|
||||||
|
|
||||||
|
List<TransactionForm> transactionFormList = transactionService.findByUserIdAndDate(todayDate, ((LoginUser)session.getAttribute("loginUser")).getUserId).stream().map(transaction -> {
|
||||||
|
TransactionForm transactionForm = TransactionForm.convertFrom(
|
||||||
|
transaction,
|
||||||
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getCategoryName(),
|
||||||
|
transactionService.findTotalexpense(todayDate, todayDate, loginUser.getUserId),
|
||||||
|
transactionService.findTotalIncome(todayDate, todayDate, loginUser.getUserId),
|
||||||
|
CategoryForm.convertFrom(categoryService.findOne(transaction.getCategoryId())).getTransactionType()
|
||||||
|
);
|
||||||
|
return transactionForm;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
model.addAttribute("transactionFormList", transactionFormList);
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.example.demo.app.presentation.form;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.CategoryModel;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CategoryForm {
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
private String categoryName;
|
||||||
|
private Integer transactionType;
|
||||||
|
|
||||||
|
public static CategoryForm convertFrom(CategoryModel categoryModel) {
|
||||||
|
return new CategoryForm(categoryModel.getCategoryId(), categoryModel.getCategoryName(), categoryModel.getTransactionType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<CategoryForm> convertFrom(List<CategoryModel> categoryModelList){
|
||||||
|
return categoryModelList.stream().map(CategoryForm::convertFrom).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.example.demo.app.presentation.form;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.example.demo.app.domain.model.TransactionModel;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TransactionForm {
|
||||||
|
|
||||||
|
private Long transactionId;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
private LocalDate transactionDate;
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
private Integer income;
|
||||||
|
|
||||||
|
private Integer expense;
|
||||||
|
|
||||||
|
private Integer transactionType;
|
||||||
|
|
||||||
|
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
||||||
|
return new TransactionForm(
|
||||||
|
transactionModel.getTransactionId(),
|
||||||
|
transactionModel.getUserId(),
|
||||||
|
transactionModel.getCategoryId(),
|
||||||
|
transactionModel.getAmount(),
|
||||||
|
transactionModel.getTransactionDate(),
|
||||||
|
categoryName,
|
||||||
|
income,
|
||||||
|
expense,
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TransactionModel convertTo(TransactionForm transactionForm) {
|
||||||
|
return new TransactionModel(
|
||||||
|
transactionForm.getTransactionId(),
|
||||||
|
transactionForm.getUserId(),
|
||||||
|
transactionForm.getCategoryId(),
|
||||||
|
transactionForm.getAmount(),
|
||||||
|
transactionForm.getTransactionDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
5
src/main/java/com/example/demo/utility/Constant.java
Normal file
5
src/main/java/com/example/demo/utility/Constant.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package com.example.demo.utility;
|
||||||
|
|
||||||
|
public class Constant {
|
||||||
|
|
||||||
|
}
|
||||||
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>
|
||||||
Reference in New Issue
Block a user