using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Entity;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 操作日志服务接口
/// </summary>
public interface IOperationLogService : IBaseService<OperationLog>
{
    /// <summary>
    /// 记录操作日志
    /// </summary>
    /// <param name="operatorId">操作人Id</param>
    /// <param name="operatorName">操作人用户名</param>
    /// <param name="actionType">操作类型（使用 OperationLogActionType 常量）</param>
    /// <param name="targetType">目标类型（使用 OperationLogTargetType 常量）</param>
    /// <param name="targetId">目标记录Id</param>
    /// <param name="targetName">目标名称</param>
    /// <param name="detail">操作详情（可选，JSON格式）</param>
    /// <param name="ipAddress">IP地址（可选）</param>
    Task LogAsync(long operatorId, string operatorName, string actionType, string targetType, long targetId, string? targetName = null, string? detail = null, string? ipAddress = null);

    /// <summary>
    /// 分页查询操作日志
    /// </summary>
    /// <param name="input">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PageListModel<OperationLogOutput>> GetListAsync(OperationLogQueryInput input);

    /// <summary>
    /// 获取操作日志详情
    /// </summary>
    /// <param name="id">日志Id</param>
    /// <returns>日志详情</returns>
    Task<OperationLogDetailOutput> GetDetailAsync(long id);
}
