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

import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
import com.dbnt.kcscbackend.admin.dashboard.repository.TnDailyUserLogRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
@RequiredArgsConstructor
public class AdminDashboardService extends EgovAbstractServiceImpl {
    private final TnDailyUserLogRepository tnDailyUserLogRepository;

    public List<TnDailyUserLog> selectDailyUserLogList(LocalDate startDate, LocalDate endDate) {
        return tnDailyUserLogRepository.findByLogDtBetweenOrderByLogDt(startDate, endDate);
    }

    public List<Object[]> selectMonthlyUserLogList(LocalDate startDate, LocalDate endDate) {
        return tnDailyUserLogRepository.selectMonthlyUserLogStatistics(startDate, endDate);
    }
}
