package egovframework.dbnt.kcsc.standardCode.service;

import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentInfo;
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentContentRepository;
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentGroupRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
@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.getDocPart());
  }

  /*public List<TnDocumentInfo> selectStandardCodeList(TnDocumentInfo tnDocumentInfo) {
    return standardCodeMapper.selectStandardCodeList(tnDocumentInfo);
  }

  public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) {
    return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);
  }*/

}
