package egovframework.dbnt.kcsc.standardCode.service;

import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentGroup;
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentContentRepository;
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentGroupRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class StandardCodeService {
  private final TnDocumentGroupRepository tnDocumentGroupRepository;
  private final TnDocumentContentRepository tnDocumentContentRepository;

  public List<StandardCodeTreeInterface> selectStandardCodeTree(){
    return tnDocumentGroupRepository.spGetTnDocumentCodeByTree();
  }

  public List<StandardCodeContentInterface> selectStandardCodeDocument(StandardCodeVO param) {
    return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getContentPoint());
  }
}
