using WmsMobileServe.Utils.HttpUtils.Entity;

namespace WmsMobileServe.ApiClient;

/// <summary>
/// 客户端请求的响应后事件
/// </summary>
public class ApiClientResponseEvent
{

    /// <summary>
    /// 当请求其他系统时触发本方法
    /// </summary>
    /// <param name="responseInfo"></param>
    public static void ApiResponse(ApiResponseInfo responseInfo)
    {
        //try
        //{
        //    // 写日志
        //    //WcsLog.Instance().WriteApiRequestLog(responseInfo.ToString());
        //    // 存库
        //    AppApiRequest insertData = new()
        //    {
        //        RequestId = dataBaseData.GetNewUUID(),
        //        RequestUrl = responseInfo.RequestUrl,
        //        RequestMethod = responseInfo.RequestMethod,
        //        IsSuccess = responseInfo.IsSend ? 1 : 0,
        //        RequestMsg = responseInfo.RequestMsg,
        //        ResponseMsg = responseInfo.ResponseMsg,
        //        RequestTime = responseInfo.RequestTime,
        //        ResponseTime = responseInfo.ResponseTime,
        //        UseTime = responseInfo.UseTime,
        //        ErrMsg = responseInfo.RequestException?.Message,
        //    };
        //    apiRequestDao.Insert(insertData);
        //}
        //catch (Exception ex)
        //{
        //    ConsoleLog.Error($"【异常】写接口日志发生异常，信息：{ex}");
        //}
    }


}
