package com.dbnt.kcscopensearch.kcsc.tnDocumentGroup.service;

import com.dbnt.kcscopensearch.kcsc.tnDocumentGroup.repository.TnDocumentGroupRepository;
import com.dbnt.kcscopensearch.kcsc.tnDocumentGroup.model.TnDocumentGroup;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class TnDocumentGroupService {
  private final TnDocumentGroupRepository tnDocumentGroupRepository;

  public List<TnDocumentGroup> selectAll(){
    /*List<TnDocumentGroup> documentGroupList = new ArrayList<>();
    Integer totalCnt = tnDocumentGroupRepository.countBy();
    Integer pageCnt = 0;
    while (pageCnt < totalCnt){
      List<TnDocumentGroup> temp = tnDocumentGroupRepository.findByOrderByGroupSeqAsc(PageRequest.of(pageCnt, pageCnt+100));
      documentGroupList.addAll(temp);
      pageCnt += 100;
    }
    return documentGroupList;*/
    return tnDocumentGroupRepository.findAll();
  }
}
