해당 요일에만 가능한 기사를 골라온 serverList를 clientList 형태로 맞춰 출력해 api로 뿌려주려고함
public List<WorkerResDto.WorkerInfo> getAbleWorker(OrderReqDto.Search condition) {
List<WorkerResDto.WorkerInfo> clientList = new ArrayList();
List<Worker> serverList = toList(repository.findALl(condition.getCondition()));
for(int i=0; i<serverList.size(); i++) {
clientList.add(toWorkerInfo(serverList(i)));
}
return clientList;
}
public List<WorkerResDto.WorkerInfo> getAbleWorker(OrderReqDto.Search condition) {
return toList(repository.findAll(condition.getCondition()))
.stream() //리스트로 스트림하기
.map(this::toWorkerInfo)
//toWorkerInfo 메서드의 형태로 객체리스트를 말기
.collect(Collectors.toList());
//최종 api를 뿌려주기 위해 dto 형태의 리스트로 출력하기
}