
package com.lideeyunji.core.framework.service;

import com.lideeyunji.core.framework.entity.LogRequestApiEntity;
import com.lideeyunji.core.framework.entity.LogRequestErrorApiEntity;
import com.lideeyunji.core.framework.params.LogRequestApiParam;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 日志相关
 */
public interface IApiLogService {
    //清除某一个日期前的api请求日志
    Integer clearApiLog(Date clearDate);

    //清除某一个日期前的api错误请求日志
    Integer clearApiErrorLog(Date clearDate);

    //获取info日志列表
    IPage<LogRequestApiEntity> getInfoApiLogPage(LogRequestApiParam param, Page page);
    //获取error日志列表
    IPage<LogRequestErrorApiEntity> getErrorApiLogPage(LogRequestApiParam param, Page page);

    //获取info日志详情
    LogRequestApiEntity getInfoApiLogDetail(Long id);
    //获取error日志详情
    LogRequestErrorApiEntity getErrorApiLogDetail(Long id);

    // 统计模块使用记录
    List<Map<String, Object>> countModelUsageRecords(Date begin, Date end);
}
