package com.codvision.monitor.service;

import com.codvision.monitor.entity.WebsiteAccessRecord;
import com.codvision.monitor.entity.vo.WebsiteAccessRecordVO;
import com.codvision.webcore.service.IBaseService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 站点访问记录 服务类
 * </p>
 *
 * @author lingee
 * @since 2023-11-20
 */
public interface IWebsiteAccessRecordService extends IBaseService<WebsiteAccessRecord, WebsiteAccessRecordVO> {

    /**
     * 添加访问记录
     *
     * @param accessRecord 访问记录
     * @param request      请求信息
     */
    void addRecord(WebsiteAccessRecord accessRecord, HttpServletRequest request);

    /**
     * 浏览量PV统计
     *
     * @param websiteKey 站点key
     * @param startTime  开始时间
     * @param endTime    结束时间
     * @return PV统计结果
     */
    List<WebsiteAccessRecordVO> getPvCountList(String websiteKey, String startTime, String endTime);

    /**
     * 访客数UV统计
     *
     * @param websiteKey 站点key
     * @param startTime  开始时间
     * @param endTime    结束时间
     * @return UV统计结果
     */
    List<WebsiteAccessRecordVO> getUvCountList(String websiteKey, String startTime, String endTime);
}
