[EDIT] 余計な機能を削除しました。

This commit is contained in:
s-choi
2026-09-29 15:08:16 +09:00
parent fa0bfa7c90
commit 7299ee0d06
2 changed files with 0 additions and 24 deletions

View File

@@ -8,6 +8,4 @@ public interface AllocationService {
public List<AllocationModel> findAll();
public List<AllocationModel> save(List<AllocationModel> allocationModelList);
}

View File

@@ -1,6 +1,5 @@
package com.example.demo.app.domain.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;
@@ -26,26 +25,5 @@ public class AllocationServiceImpl implements AllocationService {
return AllocationEntity.createAllocationModelList(allocationRepository.findAll());
}
public List<AllocationModel> save(List<AllocationModel> allocationModelList) {
List<AllocationEntity> allocationEntityList = new ArrayList<>();
allocationModelList.forEach(allocationModel -> {
allocationEntityList.add(
AllocationModel.convertTo(
categoryRepository.findById(allocationModel.getCategoryId()).get(),
courseRepository.findById(allocationModel.getCourseId()).get(),
allocationModel.getAllocationRatio()));
});
List<AllocationModel> result = new ArrayList<>();
for (AllocationEntity allocationEntity : allocationEntityList) {
result.add(AllocationModel.convertFrom(allocationRepository.save(allocationEntity)));
}
return result;
}
}