package com.dbnt.kcscbackend.admin.config.service;

import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp;
import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem;
import com.dbnt.kcscbackend.admin.config.mapper.AdminConfigMapper;
import com.dbnt.kcscbackend.admin.config.repository.TcCodeGrpRepository;
import com.dbnt.kcscbackend.admin.config.repository.TcCodeItemRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class AdminConfigService extends EgovAbstractServiceImpl {

  private final TcCodeGrpRepository codeGrpRepository;
  private final TcCodeItemRepository codeItemRepository;
  private final AdminConfigMapper adminConfigMapper;

  public List<TcCodeGrp> selectCodeGrpList(){
    return codeGrpRepository.findAll();
  }

  public List<TcCodeItem> selectCodeItemList(String grpCd){
    return codeItemRepository.findByGrpCdOrderByGrpOrder(grpCd);
  }
}
