namespace SHH.CameraDashboard
{
    /// <summary>
    /// WebAPI 调用日志模型
    /// 用于记录 API 请求的详细信息，便于调试和性能分析
    /// </summary>
    public class LogWebApiModel
    {
        #region --- 核心属性 ---

        /// <summary>
        /// 获取或设置请求发生的时间
        /// </summary>
        public DateTime Time { get; set; } = DateTime.Now;

        /// <summary>
        /// 获取或设置 HTTP 请求方法 (GET, POST, PUT, DELETE 等)
        /// </summary>
        public string Method { get; set; } = string.Empty;

        /// <summary>
        /// 获取或设置请求的 URL 路径
        /// </summary>
        public string Url { get; set; } = string.Empty;

        /// <summary>
        /// 获取或设置响应的状态码 (200, 404, 500 等)
        /// </summary>
        public string StatusCode { get; set; } = string.Empty;

        /// <summary>
        /// 获取或设置请求的原始数据 (JSON/XML 等)
        /// </summary>
        public string RequestData { get; set; } = string.Empty;

        /// <summary>
        /// 获取或设置响应的原始数据 (JSON/XML 等)
        /// </summary>
        public string ResponseData { get; set; } = string.Empty;

        /// <summary>
        /// 获取或设置请求处理耗时（毫秒）
        /// </summary>
        public long ElapsedMilliseconds { get; set; }

        /// <summary>
        /// 调用 WebAPI 的应用模块
        /// </summary>
        public string AppModule { get; set; } = "System";

        /// <summary>
        /// 是否自动发送
        /// </summary>
        public bool IsAutoPost { get; set; } = false;

        #endregion
    }
}