Compare commits
1 Commits
e361e02aa8
...
s-kikuchi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f9287765d |
0
kikuchi.txt
Normal file
0
kikuchi.txt
Normal file
@@ -1,20 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.example.demo.app.domain.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.example.demo.app.domain.service;
|
||||
|
||||
public interface TransactionService {
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.example.demo.app.domain.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.app.domain.service.TransactionService;
|
||||
|
||||
@Service
|
||||
public class TransactionServiceImpl implements TransactionService{
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
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")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "user_id")
|
||||
private Integer 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> transactionEntity;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "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;
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
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>{
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.example.demo.app.infra.repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.example.demo.app.infra.entity.AllocationEntity;
|
||||
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||
import com.example.demo.app.infra.entity.UserEntity;
|
||||
|
||||
public interface AnalysisRepository {
|
||||
|
||||
List<TransactionEntity> findExpenseByPeriod(
|
||||
Integer userId,
|
||||
LocalDate startDate,
|
||||
LocalDate endDate);
|
||||
|
||||
List<AllocationEntity> findAllocationByCourseId(
|
||||
Integer courseId);
|
||||
|
||||
UserEntity findUserByUserId(
|
||||
Integer userId);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.example.demo.app.infra.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import com.example.demo.app.infra.entity.TransactionEntity;
|
||||
|
||||
public interface TransactionRepository extends JpaRepository<TransactionEntity, Long>{
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.example.demo.app.presentation.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import com.example.demo.app.domain.service.TransactionService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class TransactionController {
|
||||
|
||||
private final TransactionService transactionService;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
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;
|
||||
|
||||
public static TransactionForm convertFrom(TransactionModel transactionModel) {
|
||||
return new TransactionForm(
|
||||
transactionModel.getTransactionId(),
|
||||
transactionModel.getUserId(),
|
||||
transactionModel.getCategoryId(),
|
||||
transactionModel.getAmount(),
|
||||
transactionModel.getTransactionDate());
|
||||
}
|
||||
|
||||
public static List<TransactionForm> convertFrom(List<TransactionModel> transactionModelList) {
|
||||
return transactionModelList.stream().map(TransactionForm::convertFrom).toList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.example.demo.utility;
|
||||
|
||||
public class Constant {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user