初始刷
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
using Infrastructure.Extensions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统监控
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
[Verify]
|
||||
public class MonitorController : BaseController
|
||||
{
|
||||
private OptionsSetting Options;
|
||||
private IWebHostEnvironment HostEnvironment;
|
||||
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
public MonitorController(IOptions<OptionsSetting> options, IWebHostEnvironment hostEnvironment)
|
||||
{
|
||||
this.HostEnvironment = hostEnvironment;
|
||||
this.Options = options.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存监控数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("monitor/cache")]
|
||||
public IActionResult GetCache()
|
||||
{
|
||||
return SUCCESS(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取服务器信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("monitor/server")]
|
||||
//[AllowAnonymous]
|
||||
public IActionResult Server()
|
||||
{
|
||||
//核心数
|
||||
int cpuNum = Environment.ProcessorCount;
|
||||
string computerName = Environment.MachineName;
|
||||
string osName = RuntimeInformation.OSDescription;
|
||||
string osArch = RuntimeInformation.OSArchitecture.ToString();
|
||||
string version = RuntimeInformation.FrameworkDescription;
|
||||
string appRAM = ((double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + " MB";
|
||||
string startTime = Process.GetCurrentProcess().StartTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
string sysRunTime = ComputerHelper.GetRunTime();
|
||||
string serverIP = Request.HttpContext.Connection.LocalIpAddress.MapToIPv4().ToString() + ":" + Request.HttpContext.Connection.LocalPort;//获取服务器IP
|
||||
|
||||
var programStartTime = Process.GetCurrentProcess().StartTime;
|
||||
string programRunTime = DateTimeHelper.FormatTime((DateTime.Now - programStartTime).TotalMilliseconds.ToString().Split('.')[0].ParseToLong());
|
||||
var data = new
|
||||
{
|
||||
cpu = ComputerHelper.GetComputerInfo(),
|
||||
disk = ComputerHelper.GetDiskInfos(),
|
||||
sys = new { cpuNum, computerName, osName, osArch, serverIP, runTime = sysRunTime },
|
||||
app = new
|
||||
{
|
||||
name = HostEnvironment.EnvironmentName,
|
||||
rootPath = HostEnvironment.ContentRootPath,
|
||||
webRootPath = HostEnvironment.WebRootPath,
|
||||
version,
|
||||
appRAM,
|
||||
startTime,
|
||||
runTime = programRunTime,
|
||||
host = serverIP
|
||||
},
|
||||
};
|
||||
|
||||
return SUCCESS(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.ServiceCore.Services;
|
||||
|
||||
//创建时间:2023-11-19
|
||||
namespace ZR.Admin.WebApi.Controllers.System.monitor
|
||||
{
|
||||
/// <summary>
|
||||
/// 短信验证码记录
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("system/SmscodeLog")]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
public class SmsCodeLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 短信验证码记录接口
|
||||
/// </summary>
|
||||
private readonly ISmsCodeLogService _SmscodeLogService;
|
||||
|
||||
public SmsCodeLogController(ISmsCodeLogService SmscodeLogService)
|
||||
{
|
||||
_SmscodeLogService = SmscodeLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询短信验证码记录列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "smscodelog:list")]
|
||||
public IActionResult QuerySmscodeLog([FromQuery] SmscodeLogQueryDto parm)
|
||||
{
|
||||
var response = _SmscodeLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除短信验证码记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "smscodelog:delete")]
|
||||
[Log(Title = "短信验证码记录", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteSmscodeLog(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _SmscodeLogService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出短信验证码记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "短信验证码记录", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[HttpGet("export")]
|
||||
[ActionPermissionFilter(Permission = "smscodelog:export")]
|
||||
public IActionResult Export([FromQuery] SmscodeLogQueryDto parm)
|
||||
{
|
||||
parm.PageNum = 1;
|
||||
parm.PageSize = 100000;
|
||||
var list = _SmscodeLogService.GetList(parm).Result;
|
||||
if (list == null || list.Count <= 0)
|
||||
{
|
||||
return ToResponse(ResultCode.FAIL, "没有要导出的数据");
|
||||
}
|
||||
var result = ExportExcelMini(list, "短信验证码记录", "短信验证码记录");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.System.Dto;
|
||||
|
||||
|
||||
//创建时间:2023-08-17
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据差异日志
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("monitor/SqlDiffLog")]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
public class SqlDiffLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据差异日志接口
|
||||
/// </summary>
|
||||
private readonly ISqlDiffLogService _SqlDiffLogService;
|
||||
|
||||
public SqlDiffLogController(ISqlDiffLogService SqlDiffLogService)
|
||||
{
|
||||
_SqlDiffLogService = SqlDiffLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询数据差异日志列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "sqldifflog:list")]
|
||||
public IActionResult QuerySqlDiffLog([FromQuery] SqlDiffLogQueryDto parm)
|
||||
{
|
||||
var response = _SqlDiffLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除数据差异日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "sqldifflog:delete")]
|
||||
[Log(Title = "数据差异日志", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteSqlDiffLog(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _SqlDiffLogService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出数据差异日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "数据差异日志", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[HttpGet("export")]
|
||||
[ActionPermissionFilter(Permission = "sqldifflog:export")]
|
||||
public IActionResult Export([FromQuery] SqlDiffLogQueryDto parm)
|
||||
{
|
||||
parm.PageNum = 1;
|
||||
parm.PageSize = 100000;
|
||||
var list = _SqlDiffLogService.GetList(parm).Result;
|
||||
if (list == null || list.Count <= 0)
|
||||
{
|
||||
return ToResponse(ResultCode.FAIL, "没有要导出的数据");
|
||||
}
|
||||
var result = ExportExcelMini(list, "数据差异日志", "数据差异日志");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.System;
|
||||
using ZR.Model.System.Dto;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统访问记录
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("/monitor/logininfor")]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
public class SysLogininforController : BaseController
|
||||
{
|
||||
private ISysLoginService sysLoginService;
|
||||
|
||||
public SysLogininforController(ISysLoginService sysLoginService)
|
||||
{
|
||||
this.sysLoginService = sysLoginService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询登录日志
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "monitor:logininfor:list")]
|
||||
public IActionResult LoignLogList([FromQuery] SysLogininfoQueryDto param)
|
||||
{
|
||||
var list = sysLoginService.GetLoginLog(param);
|
||||
|
||||
return SUCCESS(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询我的登录日志
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("mylist")]
|
||||
public IActionResult QueryMyLoignLogList([FromQuery] SysLogininfoQueryDto param)
|
||||
{
|
||||
param.UserId = HttpContext.GetUId();
|
||||
var list = sysLoginService.GetLoginLog(param);
|
||||
|
||||
return SUCCESS(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空登录日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "清空登录日志", BusinessType = BusinessType.CLEAN)]
|
||||
[ActionPermissionFilter(Permission = "monitor:logininfor:remove")]
|
||||
[HttpDelete("clean")]
|
||||
public IActionResult CleanLoginInfo()
|
||||
{
|
||||
if (!HttpContextExtension.IsAdmin(HttpContext))
|
||||
{
|
||||
return ToResponse(ApiResult.Error("操作失败"));
|
||||
}
|
||||
sysLoginService.TruncateLogininfo();
|
||||
return SUCCESS(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="infoIds"></param>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "删除登录日志", BusinessType = BusinessType.DELETE)]
|
||||
[HttpDelete("{infoIds}")]
|
||||
[ActionPermissionFilter(Permission = "monitor:logininfor:remove")]
|
||||
public IActionResult Remove(string infoIds)
|
||||
{
|
||||
if (!HttpContextExtension.IsAdmin(HttpContext))
|
||||
{
|
||||
return ToResponse(ApiResult.Error("操作失败"));
|
||||
}
|
||||
long[] infoIdss = Tools.SpitLongArrary(infoIds);
|
||||
return SUCCESS(sysLoginService.DeleteLogininforByIds(infoIdss));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录日志导出
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(BusinessType = BusinessType.EXPORT, IsSaveResponseData = false, Title = "登录日志导出")]
|
||||
[HttpGet("export")]
|
||||
[ActionPermissionFilter(Permission = "monitor:logininfor:export")]
|
||||
public IActionResult Export([FromQuery] SysLogininfor logininfoDto)
|
||||
{
|
||||
logininfoDto.BeginTime = DateTimeHelper.GetBeginTime(logininfoDto.BeginTime, -1);
|
||||
logininfoDto.EndTime = DateTimeHelper.GetBeginTime(logininfoDto.EndTime, 1);
|
||||
var exp = Expressionable.Create<SysLogininfor>()
|
||||
.And(it => it.LoginTime >= logininfoDto.BeginTime && it.LoginTime <= logininfoDto.EndTime);
|
||||
|
||||
var list = sysLoginService.Queryable().Where(exp.ToExpression())
|
||||
.ToList();
|
||||
|
||||
string sFileName = ExportExcel(list, "loginlog", "登录日志");
|
||||
return SUCCESS(new { path = "/export/" + sFileName, fileName = sFileName });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询登录日志统计
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("statiLoginLog")]
|
||||
[ActionPermissionFilter(Permission = "common")]
|
||||
public IActionResult QueryStatiLoginLog()
|
||||
{
|
||||
var list = sysLoginService.GetStatiLoginlog();
|
||||
var categories = list.Select(x => x.Date.ToString("dd日")).ToList();
|
||||
var numList = list.Select(x => x.Num).ToList();
|
||||
return SUCCESS(new { categories, numList });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.System.Dto;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作日志记录
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("/monitor/operlog")]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
public class SysOperlogController : BaseController
|
||||
{
|
||||
private ISysOperLogService sysOperLogService;
|
||||
|
||||
public SysOperlogController(ISysOperLogService sysOperLogService)
|
||||
{
|
||||
this.sysOperLogService = sysOperLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询操作日志
|
||||
/// </summary>
|
||||
/// <param name="sysOperLog"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public IActionResult OperList([FromQuery] SysOperLogQueryDto sysOperLog)
|
||||
{
|
||||
sysOperLog.OperName = !HttpContextExtension.IsAdmin(HttpContext) ? HttpContextExtension.GetName(HttpContext) : sysOperLog.OperName;
|
||||
var list = sysOperLogService.SelectOperLogList(sysOperLog);
|
||||
|
||||
return SUCCESS(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除操作日志
|
||||
/// </summary>
|
||||
/// <param name="operIds"></param>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "操作日志", BusinessType = BusinessType.DELETE)]
|
||||
[ActionPermissionFilter(Permission = "monitor:operlog:delete")]
|
||||
[HttpDelete("{operIds}")]
|
||||
public IActionResult Remove(string operIds)
|
||||
{
|
||||
if (!HttpContextExtension.IsAdmin(HttpContext))
|
||||
{
|
||||
return ToResponse(ApiResult.Error("操作失败"));
|
||||
}
|
||||
long[] operIdss = Tools.SpitLongArrary(operIds);
|
||||
return SUCCESS(sysOperLogService.DeleteOperLogByIds(operIdss));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空操作日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "清空操作日志", BusinessType = BusinessType.CLEAN)]
|
||||
[ActionPermissionFilter(Permission = "monitor:operlog:delete")]
|
||||
[HttpDelete("clean")]
|
||||
public IActionResult ClearOperLog()
|
||||
{
|
||||
if (!HttpContextExtension.IsAdmin(HttpContext))
|
||||
{
|
||||
return ToResponse(ResultCode.CUSTOM_ERROR,"操作失败");
|
||||
}
|
||||
sysOperLogService.CleanOperLog();
|
||||
|
||||
return SUCCESS(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出操作日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "操作日志", BusinessType = BusinessType.EXPORT)]
|
||||
[ActionPermissionFilter(Permission = "monitor:operlog:export")]
|
||||
[HttpGet("export")]
|
||||
public IActionResult Export([FromQuery] SysOperLogQueryDto sysOperLog)
|
||||
{
|
||||
sysOperLog.PageSize = 100000;
|
||||
var list = sysOperLogService.SelectOperLogList(sysOperLog);
|
||||
var result = ExportExcelMini(list.Result, "操作日志", "操作日志");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model;
|
||||
using ZR.Model.System.Dto;
|
||||
using ZR.ServiceCore.Signalr;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
{
|
||||
/// <summary>
|
||||
/// 在线用户
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("monitor/online")]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
public class SysUserOnlineController : BaseController
|
||||
{
|
||||
private readonly IHubContext<MessageHub> HubContext;
|
||||
|
||||
public SysUserOnlineController(IHubContext<MessageHub> hubContext)
|
||||
{
|
||||
HubContext = hubContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取在线用户列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public IActionResult Index([FromQuery] PagerInfo parm)
|
||||
{
|
||||
var result = MessageHub.onlineClients
|
||||
.OrderByDescending(f => f.LoginTime)
|
||||
.Skip(parm.PageNum - 1).Take(parm.PageSize);
|
||||
|
||||
return SUCCESS(new { result, totalNum = MessageHub.onlineClients.Count });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个强退
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("force")]
|
||||
[Log(Title = "强退", BusinessType = BusinessType.FORCE)]
|
||||
[ActionPermissionFilter(Permission = "monitor:online:forceLogout")]
|
||||
public async Task<IActionResult> Force([FromBody] LockUserDto dto)
|
||||
{
|
||||
if (dto == null) { return ToResponse(ResultCode.PARAM_ERROR); }
|
||||
|
||||
await HubContext.Clients.Client(dto.ConnnectionId)
|
||||
.SendAsync(HubsConstant.ForceUser, new { dto.Reason, dto.Time });
|
||||
|
||||
//var expirTime = DateTimeHelper.GetUnixTimeSeconds(DateTime.Now.AddMinutes(dto.Time));
|
||||
////PC 端采用设备 + 用户名的方式进行封锁
|
||||
//CacheService.SetLockUser(dto.ClientId + dto.Name, expirTime, dto.Time);
|
||||
return SUCCESS(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量强退
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("batchForce")]
|
||||
[Log(Title = "强退", BusinessType = BusinessType.FORCE)]
|
||||
[ActionPermissionFilter(Permission = "monitor:online:batchLogout")]
|
||||
public async Task<IActionResult> BatchforceLogout([FromBody] LockUserDto dto)
|
||||
{
|
||||
if (dto == null) { return ToResponse(ResultCode.PARAM_ERROR); }
|
||||
|
||||
await HubContext.Clients.All.SendAsync(HubsConstant.ForceUser, new { dto.Reason });
|
||||
|
||||
return SUCCESS(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.ServiceCore.Monitor.IMonitorService;
|
||||
|
||||
//创建时间:2024-03-27
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户在线时长
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[ApiExplorerSettings(GroupName = "sys")]
|
||||
[Route("monitor/UserOnlineLog")]
|
||||
public class UserOnlineLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户在线时长接口
|
||||
/// </summary>
|
||||
private readonly IUserOnlineLogService _UserOnlineLogService;
|
||||
|
||||
public UserOnlineLogController(IUserOnlineLogService UserOnlineLogService)
|
||||
{
|
||||
_UserOnlineLogService = UserOnlineLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户在线时长列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
//[ActionPermissionFilter(Permission = "useronlinelog:list")]
|
||||
public IActionResult QueryUserOnlineLog([FromQuery] UserOnlineLogQueryDto parm)
|
||||
{
|
||||
var response = _UserOnlineLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户在线时长
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("delete/{ids}")]
|
||||
[ActionPermissionFilter(Permission = "useronlinelog:delete")]
|
||||
[Log(Title = "用户在线时长", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteUserOnlineLog([FromRoute]string ids)
|
||||
{
|
||||
var idArr = Tools.SplitAndConvert<long>(ids);
|
||||
|
||||
return ToResponse(_UserOnlineLogService.Delete(idArr));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出用户在线时长
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "用户在线时长", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[HttpGet("export")]
|
||||
[ActionPermissionFilter(Permission = "useronlinelog:export")]
|
||||
public IActionResult Export([FromQuery] UserOnlineLogQueryDto parm)
|
||||
{
|
||||
parm.PageNum = 1;
|
||||
parm.PageSize = 100000;
|
||||
var list = _UserOnlineLogService.ExportList(parm).Result;
|
||||
if (list == null || list.Count <= 0)
|
||||
{
|
||||
return ToResponse(ResultCode.FAIL, "没有要导出的数据");
|
||||
}
|
||||
var result = ExportExcelMini(list, "用户在线时长", "用户在线时长");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user