using Learun.Util;
using System;
using System.Collections.Generic;
namespace Learun.Application.Base.SystemModule
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创建人:陈彬彬
/// 日 期:2017.03.21
/// 描 述:系统日志
///
public static class LogBLL
{
private static LogService service = new LogService();
#region 获取数据
///
/// 日志列表
///
/// 分页
/// 查询参数
///
public static IEnumerable GetPageList(Pagination pagination, string queryJson, string userId)
{
try
{
return service.GetPageList(pagination, queryJson, userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
///
/// 日志列表
///
/// 查询参数
///
public static IEnumerable GetList(string queryJson, bool isYear)
{
try
{
return service.GetList(queryJson, isYear);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
public static IEnumerable GetGroupLog(string userid)
{
try
{
return service.GetGroupLog(userid);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
#region 提交数据
///
/// 清空日志
///
/// 日志分类Id
/// 保留时间段内
public static void RemoveLog(int categoryId, string keepTime)
{
try
{
service.RemoveLog(categoryId, keepTime);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
///
/// 写日志
///
/// 对象
public static void WriteLog(this LogEntity logEntity)
{
try
{
service.WriteLog(logEntity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
#region 扩展数据
///
/// 获取在线用户人数【登录页面】
///
///
public static IEnumerable GetOnlineUserList()
{
try
{
return service.GetOnlineUserList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
public static LogEntity GetUserLogList(string userId)
{
try
{
return service.GetUserLogList(userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
}
}