package com.zioinfo.cms.analytics.mapper;

import com.zioinfo.cms.analytics.CmsContentStat;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AnalyticsMapper {
    /** 이벤트 누적 — upsert. eventType: VIEW / DWELL / CONVERSION. */
    int recordEvent(@Param("contentId") Long contentId,
                    @Param("eventType") String eventType,
                    @Param("amount") long amount);

    List<CmsContentStat> topContent(@Param("limit") int limit);

    CmsContentStat findByContent(@Param("contentId") Long contentId);

    long totalViews();
    long totalConversions();
}
