[EDIT] 改行・コード位置を調整しました。
This commit is contained in:
@@ -28,12 +28,6 @@ public class TransactionEntity {
|
||||
@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;
|
||||
@@ -42,4 +36,10 @@ public class TransactionEntity {
|
||||
@JoinColumn(name = "category_id")
|
||||
private CategoryEntity categoryEntity;
|
||||
|
||||
@Column(name = "amount", nullable = false)
|
||||
private Integer amount;
|
||||
|
||||
@Column(name = "transaction_date", nullable = false)
|
||||
private LocalDate transactionDate;
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public class TransactionForm {
|
||||
|
||||
private Integer transactionType;
|
||||
|
||||
|
||||
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
||||
return new TransactionForm(
|
||||
transactionModel.getTransactionId(),
|
||||
@@ -45,6 +46,7 @@ public class TransactionForm {
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user