😎增加消息日志页面及服务

This commit is contained in:
zuohuaijun 2024-12-26 14:45:53 +08:00
parent 99b911e41c
commit 6d021dbcd2
30 changed files with 1630 additions and 139 deletions

View File

@ -4,32 +4,14 @@
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
using Microsoft.AspNetCore.Localization;
public class LogVisOutput
namespace Admin.NET.Application.Service.Test;
public class CookieNameCultureProvider : CookieRequestCultureProvider
{
/// <summary>
/// 登录地点
/// </summary>
public string Location { get; set; }
/// <summary>
/// 经度
/// </summary>
public double? Longitude { get; set; }
/// <summary>
/// 纬度
/// </summary>
public double? Latitude { get; set; }
/// <summary>
/// 真实姓名
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 日志时间
/// </summary>
public DateTime? LogDateTime { get; set; }
public CookieNameCultureProvider()
{
CookieName = "zuohuaijun";
}
}

View File

@ -5,6 +5,7 @@
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using Furion.EventBus;
using Furion.Localization;
namespace Admin.NET.Application;
@ -35,4 +36,15 @@ public class TestService : IDynamicApiController
{
await App.GetRequiredService<IEventPublisher>().PublishAsync(CommonConst.SendErrorMail, "Admin.NET");
}
/// <summary>
/// 多语言测试
/// </summary>
/// <returns></returns>
public string GetCulture()
{
L.SetCulture("en-US", true);
return L.GetSelectCulture().Culture.Name;
}
}

View File

@ -46,7 +46,7 @@
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.5.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1149" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1150" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>

View File

@ -27,6 +27,11 @@ public class CommonConst
/// </summary>
public const string AddExLog = "Add:ExLog";
/// <summary>
/// 事件-增加消息日志
/// </summary>
public const string AddMsgLog = "Add:MsgLog";
/// <summary>
/// 事件-发送异常邮件
/// </summary>

View File

@ -0,0 +1,123 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 系统消息日志表
/// </summary>
[SugarTable(null, "系统消息日志表")]
[SysTable]
[LogTable]
public partial class SysLogMsg : EntityTenant
{
/// <summary>
/// 消息标题
/// </summary>
[SugarColumn(ColumnDescription = "消息标题", Length = 64)]
[MaxLength(64)]
public string Title { get; set; }
/// <summary>
/// 消息内容
/// </summary>
[SugarColumn(ColumnDescription = "消息内容", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Message { get; set; }
/// <summary>
/// 接收者Id
/// </summary>
[SugarColumn(ColumnDescription = "接收者Id")]
public long ReceiveUserId { get; set; }
/// <summary>
/// 接收者名称
/// </summary>
[SugarColumn(ColumnDescription = "接收者名称", Length = 32)]
[MaxLength(32)]
public string ReceiveUserName { get; set; }
/// <summary>
/// 接收者Id集合
/// </summary>
[SugarColumn(ColumnDescription = "接收者Id集合", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? ReceiveUserIds { get; set; }
/// <summary>
/// 接收者IP
/// </summary>
[SugarColumn(ColumnDescription = "接收者IP", Length = 256)]
[MaxLength(256)]
public string? ReceiveIp { get; set; }
/// <summary>
/// 接收者浏览器
/// </summary>
[SugarColumn(ColumnDescription = "接收者浏览器", Length = 128)]
[MaxLength(128)]
public string? ReceiveBrowser { get; set; }
/// <summary>
/// 接收者操作系统
/// </summary>
[SugarColumn(ColumnDescription = "接收者操作系统", Length = 128)]
[MaxLength(128)]
public string? ReceiveOs { get; set; }
/// <summary>
/// 接收者设备
/// </summary>
[SugarColumn(ColumnDescription = "接收者设备", Length = 256)]
[MaxLength(256)]
public string? ReceiveDevice { get; set; }
/// <summary>
/// 发送者Id
/// </summary>
[SugarColumn(ColumnDescription = "发送者Id")]
public long SendUserId { get; set; }
/// <summary>
/// 发送者名称
/// </summary>
[SugarColumn(ColumnDescription = "发送者名称", Length = 32)]
[MaxLength(32)]
public string SendUserName { get; set; }
/// <summary>
/// 发送时间
/// </summary>
[SugarColumn(ColumnDescription = "发送时间")]
public DateTime SendTime { get; set; }
/// <summary>
/// 发送者IP
/// </summary>
[SugarColumn(ColumnDescription = "发送者IP", Length = 256)]
[MaxLength(256)]
public string? SendIp { get; set; }
/// <summary>
/// 发送者浏览器
/// </summary>
[SugarColumn(ColumnDescription = "发送者浏览器", Length = 128)]
[MaxLength(128)]
public string? SendBrowser { get; set; }
/// <summary>
/// 发送者操作系统
/// </summary>
[SugarColumn(ColumnDescription = "发送者操作系统", Length = 128)]
[MaxLength(128)]
public string? SendOs { get; set; }
/// <summary>
/// 发送者设备
/// </summary>
[SugarColumn(ColumnDescription = "发送者设备", Length = 256)]
[MaxLength(256)]
public string? SendDevice { get; set; }
}

View File

@ -30,6 +30,18 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
await db.CopyNew().Insertable(context.GetPayload<SysLogEx>()).ExecuteCommandAsync();
}
/// <summary>
/// 增加消息日志
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
[EventSubscribe(CommonConst.AddMsgLog)]
public async Task CreateMsgLog(EventHandlerExecutingContext context)
{
var db = _serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>();
await db.CopyNew().Insertable(context.GetPayload<SysLogMsg>()).ExecuteCommandAsync();
}
/// <summary>
/// 发送异常邮件
/// </summary>

View File

@ -199,6 +199,9 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
new SysMenu{ Id=1310000000541, Pid=1310000000501, Title="差异日志", Path="/log/logdiff", Name="sysLogDiff", Component="/system/log/logdiff/index", Icon="ele-Document", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=130 },
new SysMenu{ Id=1310000000542, Pid=1310000000541, Title="查询", Permission="sysLogDiff/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000543, Pid=1310000000541, Title="清空", Permission="sysLogDiff/clear", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000551, Pid=1310000000501, Title="消息日志", Path="/log/logmsg", Name="sysLogMsg", Component="/system/log/logmsg/index", Icon="ele-Document", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=140 },
new SysMenu{ Id=1310000000552, Pid=1310000000551, Title="查询", Permission="sysLogMsg/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000553, Pid=1310000000551, Title="清空", Permission="sysLogMsg/clear", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000601, Pid=0, Title="开发工具", Path="/develop", Name="develop", Component="Layout", Icon="ele-Cpu", Type=MenuTypeEnum.Dir, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=13000 },
new SysMenu{ Id=1310000000611, Pid=1310000000601, Title="库表管理", Path="/develop/database", Name="sysDatabase", Component="/system/database/index",Icon="ele-Coin", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },

View File

@ -59,6 +59,29 @@ public class PageLogInput : BasePageInput
public string? RemoteIp { get; set; }
}
public class PageMsgLogInput : BasePageInput
{
/// <summary>
/// 接收者名称
/// </summary>
public string ReceiveUserName { get; set; }
/// <summary>
/// 发送者名称
/// </summary>
public string SendUserName { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public DateTime? StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndTime { get; set; }
}
public class LogInput
{
/// <summary>

View File

@ -6,6 +6,34 @@
namespace Admin.NET.Core.Service;
public class LogVisOutput
{
/// <summary>
/// 登录地点
/// </summary>
public string Location { get; set; }
/// <summary>
/// 经度
/// </summary>
public double? Longitude { get; set; }
/// <summary>
/// 纬度
/// </summary>
public double? Latitude { get; set; }
/// <summary>
/// 真实姓名
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 日志时间
/// </summary>
public DateTime? LogDateTime { get; set; }
}
public class StatLogOutput
{
/// <summary>

View File

@ -0,0 +1,91 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
/// <summary>
/// 系统消息日志服务 🧩
/// </summary>
[ApiDescriptionSettings(Order = 370, Description = "消息日志")]
public class SysLogMsgService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<SysLogMsg> _sysLogMsgRep;
public SysLogMsgService(SqlSugarRepository<SysLogMsg> sysLogMsgRep)
{
_sysLogMsgRep = sysLogMsgRep;
}
/// <summary>
/// 获取消息日志分页列表 🔖
/// </summary>
/// <returns></returns>
[SuppressMonitor]
[DisplayName("获取消息日志分页列表")]
public async Task<SqlSugarPagedList<SysLogMsg>> Page(PageMsgLogInput input)
{
return await _sysLogMsgRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.CreateTime >= input.StartTime)
.WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.CreateTime <= input.EndTime)
.WhereIF(!string.IsNullOrWhiteSpace(input.ReceiveUserName), u => u.ReceiveUserName == input.ReceiveUserName)
.WhereIF(!string.IsNullOrWhiteSpace(input.SendUserName), u => u.SendUserName == input.SendUserName)
.IgnoreColumns(u => new { u.Message })
.OrderBuilder(input)
.ToPagedListAsync(input.Page, input.PageSize);
}
/// <summary>
/// 获取消息日志详情 🔖
/// </summary>
/// <returns></returns>
[SuppressMonitor]
[DisplayName("获取消息日志详情")]
public async Task<SysLogMsg> GetDetail(long id)
{
return await _sysLogMsgRep.GetByIdAsync(id);
}
/// <summary>
/// 清空消息日志 🔖
/// </summary>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Clear"), HttpPost]
[DisplayName("清空消息日志")]
public void Clear()
{
_sysLogMsgRep.AsSugarClient().DbMaintenance.TruncateTable<SysLogMsg>();
}
/// <summary>
/// 按年按天数统计消息日志 🔖
/// </summary>
/// <returns></returns>
[DisplayName("按年按天数统计消息日志")]
public async Task<List<StatLogOutput>> GetYearDayStats()
{
var _db = _sysLogMsgRep.AsSugarClient();
var now = DateTime.Now;
var days = (now - now.AddYears(-1)).Days + 1;
var day365 = Enumerable.Range(0, days).Select(u => now.AddDays(-u)).ToList();
var queryableLeft = _db.Reportable(day365).ToQueryable<DateTime>();
var queryableRight = _db.Queryable<SysLogMsg>(); //.SplitTable(tab => tab);
var list = await _db.Queryable(queryableLeft, queryableRight, JoinType.Left,
(x1, x2) => x1.ColumnName.Date == x2.CreateTime.Date)
.GroupBy((x1, x2) => x1.ColumnName)
.Select((x1, x2) => new StatLogOutput
{
Count = SqlFunc.AggregateSum(SqlFunc.IIF(x2.Id > 0, 1, 0)),
Date = x1.ColumnName.ToString("yyyy-MM-dd")
})
.MergeTable()
.OrderBy(x => x.Date)
.ToListAsync();
return list;
}
}

View File

@ -83,10 +83,10 @@ public class SysLogOpService : IDynamicApiController, ITransient
}
/// <summary>
/// 按天数统计操作日志 🔖
/// 按年按天数统计消息日志 🔖
/// </summary>
/// <returns></returns>
[DisplayName("按天数统计操作日志")]
[DisplayName("按年按天数统计消息日志")]
public async Task<List<StatLogOutput>> GetYearDayStats()
{
var _db = _sysLogOpRep.AsSugarClient();

View File

@ -71,10 +71,10 @@ public class SysLogVisService : IDynamicApiController, ITransient
}
/// <summary>
/// 按天数统计操作日志 🔖
/// 按年按天数统计消息日志 🔖
/// </summary>
/// <returns></returns>
[DisplayName("按天数统计操作日志")]
[DisplayName("按年按天数统计消息日志")]
public async Task<List<StatLogOutput>> GetYearDayStats()
{
var _db = _sysLogVisRep.AsSugarClient();

View File

@ -8,30 +8,15 @@ namespace Admin.NET.Core;
public class MessageInput
{
/// <summary>
/// 接收者用户Id
/// </summary>
public long ReceiveUserId { get; set; }
/// <summary>
/// 接收者名称
/// </summary>
public string ReceiveUserName { get; set; }
/// <summary>
/// 用户ID列表
/// </summary>
public List<long> UserIds { get; set; }
/// <summary>
/// 消息标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 消息类型
/// </summary>
public MessageTypeEnum MessageType { get; set; }
///// <summary>
///// 消息类型
///// </summary>
//public MessageTypeEnum MessageType { get; set; }
/// <summary>
/// 消息内容
@ -41,15 +26,15 @@ public class MessageInput
/// <summary>
/// 发送者Id
/// </summary>
public string SendUserId { get; set; }
public long SendUserId { get; set; }
/// <summary>
/// 发送者名称
/// 接收者Id
/// </summary>
public string SendUserName { get; set; }
public long ReceiveUserId { get; set; }
/// <summary>
/// 发送时间
/// 接收者Id集合
/// </summary>
public DateTime SendTime { get; set; }
public List<long> UserIds { get; set; }
}

View File

@ -15,12 +15,15 @@ namespace Admin.NET.Core.Service;
public class SysMessageService : IDynamicApiController, ITransient
{
private readonly SysCacheService _sysCacheService;
private readonly IEventPublisher _eventPublisher;
private readonly IHubContext<OnlineUserHub, IOnlineUserHub> _chatHubContext;
public SysMessageService(SysCacheService sysCacheService,
IEventPublisher eventPublisher,
IHubContext<OnlineUserHub, IOnlineUserHub> chatHubContext)
{
_sysCacheService = sysCacheService;
_eventPublisher = eventPublisher;
_chatHubContext = chatHubContext;
}
@ -56,9 +59,11 @@ public class SysMessageService : IDynamicApiController, ITransient
[DisplayName("发送消息给某个人")]
public async Task SendUser(MessageInput input)
{
var sysLogMsg = await SaveMsgLog(input);
var hashKey = _sysCacheService.HashGetAll<SysOnlineUser>(CacheConst.KeyUserOnline);
var receiveUsers = hashKey.Where(u => u.Value.UserId == input.ReceiveUserId).Select(u => u.Value).ToList();
await receiveUsers.ForEachAsync(u => _chatHubContext.Clients.Client(u.ConnectionId ?? "").ReceiveMessage(input));
var receiveUser = hashKey.Where(u => u.Value.UserId == input.ReceiveUserId).Select(u => u.Value).FirstOrDefault();
await _chatHubContext.Clients.Client(receiveUser.ConnectionId ?? "").ReceiveMessage(sysLogMsg);
}
/// <summary>
@ -73,4 +78,37 @@ public class SysMessageService : IDynamicApiController, ITransient
var receiveUsers = hashKey.Where(u => input.UserIds.Any(a => a == u.Value.UserId)).Select(u => u.Value).ToList();
await receiveUsers.ForEachAsync(u => _chatHubContext.Clients.Client(u.ConnectionId ?? "").ReceiveMessage(input));
}
/// <summary>
/// 记录消息日志
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task<SysLogMsg> SaveMsgLog(MessageInput input)
{
var hashKey = _sysCacheService.HashGetAll<SysOnlineUser>(CacheConst.KeyUserOnline);
var receiveUser = hashKey.Where(u => u.Value.UserId == input.ReceiveUserId).Select(u => u.Value).FirstOrDefault();
var sendUser = hashKey.Where(u => u.Value.UserId == input.SendUserId).Select(u => u.Value).FirstOrDefault();
var sysLogMsg = new SysLogMsg
{
Title = input.Title,
Message = input.Message,
ReceiveUserId = receiveUser.UserId,
ReceiveUserName = receiveUser.RealName + "/" + receiveUser.UserName,
ReceiveIp = receiveUser.Ip,
ReceiveBrowser = receiveUser.Browser,
ReceiveOs = receiveUser.Os,
ReceiveDevice = receiveUser.Device,
SendUserId = sendUser.UserId,
SendUserName = sendUser.RealName + "/" + sendUser.UserName,
SendIp = sendUser.Ip,
SendBrowser = sendUser.Browser,
SendOs = sendUser.Os,
SendDevice = sendUser.Device,
SendTime = DateTime.Now
};
await _eventPublisher.PublishAsync(CommonConst.AddMsgLog, sysLogMsg);
return sysLogMsg;
}
}

View File

@ -4,6 +4,7 @@
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using Admin.NET.Application.Service.Test;
using Admin.NET.Core;
using Admin.NET.Core.Service;
using AspNetCoreRateLimit;
@ -325,7 +326,10 @@ public class Startup : AppStartup
app.UseUnifyResultStatusCodes();
// 启用多语言,必须在 UseRouting 之前
app.UseAppLocalization();
app.UseAppLocalization(option =>
{
option.AddInitialRequestCultureProvider(new CookieNameCultureProvider());
});
// 路由注册
app.UseRouting();

View File

@ -2,7 +2,7 @@
"name": "admin.net.pro",
"type": "module",
"version": "2.4.33",
"lastBuildTime": "2024.12.25",
"lastBuildTime": "2024.12.26",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun",
"license": "MIT",
@ -103,7 +103,7 @@
"sass": "^1.83.0",
"terser": "^5.37.0",
"typescript": "^5.7.2",
"vite": "^6.0.5",
"vite": "^6.0.6",
"vite-plugin-cdn-import": "^1.0.1",
"vite-plugin-compression2": "^1.3.3",
"vite-plugin-vue-setup-extend": "^0.4.0",

View File

@ -32,6 +32,7 @@ export * from './apis/sys-job-api';
export * from './apis/sys-ldap-api';
export * from './apis/sys-log-diff-api';
export * from './apis/sys-log-ex-api';
export * from './apis/sys-log-msg-api';
export * from './apis/sys-log-op-api';
export * from './apis/sys-log-vis-api';
export * from './apis/sys-menu-api';

View File

@ -0,0 +1,375 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AdminResultListStatLogOutput } from '../models';
import { AdminResultSqlSugarPagedListSysLogMsg } from '../models';
import { AdminResultSysLogMsg } from '../models';
import { PageMsgLogInput } from '../models';
/**
* SysLogMsgApi - axios parameter creator
* @export
*/
export const SysLogMsgApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysLogMsgClearPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysLogMsg/clear`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysLogMsgDetailIdGet: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysLogMsgDetailIdGet.');
}
const localVarPath = `/api/sysLogMsg/detail/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {PageMsgLogInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysLogMsgPagePost: async (body?: PageMsgLogInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysLogMsg/page`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysLogMsgYearDayStatsGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysLogMsg/yearDayStats`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* SysLogMsgApi - functional programming interface
* @export
*/
export const SysLogMsgApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgClearPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysLogMsgApiAxiosParamCreator(configuration).apiSysLogMsgClearPost(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgDetailIdGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysLogMsg>>> {
const localVarAxiosArgs = await SysLogMsgApiAxiosParamCreator(configuration).apiSysLogMsgDetailIdGet(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {PageMsgLogInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgPagePost(body?: PageMsgLogInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLogMsg>>> {
const localVarAxiosArgs = await SysLogMsgApiAxiosParamCreator(configuration).apiSysLogMsgPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgYearDayStatsGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListStatLogOutput>>> {
const localVarAxiosArgs = await SysLogMsgApiAxiosParamCreator(configuration).apiSysLogMsgYearDayStatsGet(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* SysLogMsgApi - factory interface
* @export
*/
export const SysLogMsgApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgClearPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysLogMsgApiFp(configuration).apiSysLogMsgClearPost(options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgDetailIdGet(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysLogMsg>> {
return SysLogMsgApiFp(configuration).apiSysLogMsgDetailIdGet(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {PageMsgLogInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgPagePost(body?: PageMsgLogInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLogMsg>> {
return SysLogMsgApiFp(configuration).apiSysLogMsgPagePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysLogMsgYearDayStatsGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListStatLogOutput>> {
return SysLogMsgApiFp(configuration).apiSysLogMsgYearDayStatsGet(options).then((request) => request(axios, basePath));
},
};
};
/**
* SysLogMsgApi - object-oriented interface
* @export
* @class SysLogMsgApi
* @extends {BaseAPI}
*/
export class SysLogMsgApi extends BaseAPI {
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogMsgApi
*/
public async apiSysLogMsgClearPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysLogMsgApiFp(this.configuration).apiSysLogMsgClearPost(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogMsgApi
*/
public async apiSysLogMsgDetailIdGet(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysLogMsg>> {
return SysLogMsgApiFp(this.configuration).apiSysLogMsgDetailIdGet(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {PageMsgLogInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogMsgApi
*/
public async apiSysLogMsgPagePost(body?: PageMsgLogInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLogMsg>> {
return SysLogMsgApiFp(this.configuration).apiSysLogMsgPagePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogMsgApi
*/
public async apiSysLogMsgYearDayStatsGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListStatLogOutput>> {
return SysLogMsgApiFp(this.configuration).apiSysLogMsgYearDayStatsGet(options).then((request) => request(this.axios, this.basePath));
}
}

View File

@ -218,7 +218,7 @@ export const SysLogOpApiAxiosParamCreator = function (configuration?: Configurat
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -325,7 +325,7 @@ export const SysLogOpApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -386,7 +386,7 @@ export const SysLogOpApiFactory = function (configuration?: Configuration, baseP
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -448,7 +448,7 @@ export class SysLogOpApi extends BaseAPI {
}
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogOpApi

View File

@ -163,7 +163,7 @@ export const SysLogVisApiAxiosParamCreator = function (configuration?: Configura
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -255,7 +255,7 @@ export const SysLogVisApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -305,7 +305,7 @@ export const SysLogVisApiFactory = function (configuration?: Configuration, base
},
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -355,7 +355,7 @@ export class SysLogVisApi extends BaseAPI {
}
/**
*
* @summary 🔖
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysLogVisApi

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { SqlSugarPagedListSysLogMsg } from './sql-sugar-paged-list-sys-log-msg';
/**
*
*
* @export
* @interface AdminResultSqlSugarPagedListSysLogMsg
*/
export interface AdminResultSqlSugarPagedListSysLogMsg {
/**
*
*
* @type {number}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
message?: string | null;
/**
* @type {SqlSugarPagedListSysLogMsg}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
result?: SqlSugarPagedListSysLogMsg;
/**
*
*
* @type {any}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultSqlSugarPagedListSysLogMsg
*/
time?: Date;
}

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { SysLogMsg } from './sys-log-msg';
/**
*
*
* @export
* @interface AdminResultSysLogMsg
*/
export interface AdminResultSysLogMsg {
/**
*
*
* @type {number}
* @memberof AdminResultSysLogMsg
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultSysLogMsg
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultSysLogMsg
*/
message?: string | null;
/**
* @type {SysLogMsg}
* @memberof AdminResultSysLogMsg
*/
result?: SysLogMsg;
/**
*
*
* @type {any}
* @memberof AdminResultSysLogMsg
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultSysLogMsg
*/
time?: Date;
}

View File

@ -93,6 +93,7 @@ export * from './admin-result-sql-sugar-paged-list-sys-job-trigger-record';
export * from './admin-result-sql-sugar-paged-list-sys-ldap';
export * from './admin-result-sql-sugar-paged-list-sys-log-diff';
export * from './admin-result-sql-sugar-paged-list-sys-log-ex';
export * from './admin-result-sql-sugar-paged-list-sys-log-msg';
export * from './admin-result-sql-sugar-paged-list-sys-log-op';
export * from './admin-result-sql-sugar-paged-list-sys-log-vis';
export * from './admin-result-sql-sugar-paged-list-sys-notice';
@ -116,6 +117,7 @@ export * from './admin-result-sys-file';
export * from './admin-result-sys-ldap';
export * from './admin-result-sys-log-diff';
export * from './admin-result-sys-log-ex';
export * from './admin-result-sys-log-msg';
export * from './admin-result-sys-log-op';
export * from './admin-result-sys-print';
export * from './admin-result-sys-schedule';
@ -259,7 +261,6 @@ export * from './menu-output';
export * from './menu-type-enum';
export * from './message-input';
export * from './message-template-send-input';
export * from './message-type-enum';
export * from './method-attributes';
export * from './method-base';
export * from './method-impl-attributes';
@ -283,6 +284,7 @@ export * from './page-file-input';
export * from './page-job-detail-input';
export * from './page-job-trigger-record-input';
export * from './page-log-input';
export * from './page-msg-log-input';
export * from './page-notice-input';
export * from './page-online-user-input';
export * from './page-op-log-input';
@ -346,6 +348,7 @@ export * from './sql-sugar-paged-list-sys-job-trigger-record';
export * from './sql-sugar-paged-list-sys-ldap';
export * from './sql-sugar-paged-list-sys-log-diff';
export * from './sql-sugar-paged-list-sys-log-ex';
export * from './sql-sugar-paged-list-sys-log-msg';
export * from './sql-sugar-paged-list-sys-log-op';
export * from './sql-sugar-paged-list-sys-log-vis';
export * from './sql-sugar-paged-list-sys-notice';
@ -386,6 +389,7 @@ export * from './sys-ldap';
export * from './sys-ldap-input';
export * from './sys-log-diff';
export * from './sys-log-ex';
export * from './sys-log-msg';
export * from './sys-log-op';
export * from './sys-log-vis';
export * from './sys-menu';

View File

@ -12,7 +12,6 @@
* Do not edit the class manually.
*/
import { MessageTypeEnum } from './message-type-enum';
/**
*
*
@ -21,30 +20,6 @@ import { MessageTypeEnum } from './message-type-enum';
*/
export interface MessageInput {
/**
* Id
*
* @type {number}
* @memberof MessageInput
*/
receiveUserId?: number;
/**
*
*
* @type {string}
* @memberof MessageInput
*/
receiveUserName?: string | null;
/**
* ID列表
*
* @type {Array<number>}
* @memberof MessageInput
*/
userIds?: Array<number> | null;
/**
*
*
@ -53,12 +28,6 @@ export interface MessageInput {
*/
title?: string | null;
/**
* @type {MessageTypeEnum}
* @memberof MessageInput
*/
messageType?: MessageTypeEnum;
/**
*
*
@ -70,24 +39,24 @@ export interface MessageInput {
/**
* Id
*
* @type {string}
* @type {number}
* @memberof MessageInput
*/
sendUserId?: string | null;
sendUserId?: number;
/**
*
* Id
*
* @type {string}
* @type {number}
* @memberof MessageInput
*/
sendUserName?: string | null;
receiveUserId?: number;
/**
*
* Id集合
*
* @type {Date}
* @type {Array<number>}
* @memberof MessageInput
*/
sendTime?: Date;
userIds?: Array<number> | null;
}

View File

@ -1,26 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
* <br />&nbsp; Info = 0<br />&nbsp; Success = 1<br />&nbsp; Warning = 2<br />&nbsp; Error = 3<br />
* @export
* @enum {string}
*/
export enum MessageTypeEnum {
NUMBER_0 = 0,
NUMBER_1 = 1,
NUMBER_2 = 2,
NUMBER_3 = 3
}

View File

@ -0,0 +1,116 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { Filter } from './filter';
import { Search } from './search';
/**
*
*
* @export
* @interface PageMsgLogInput
*/
export interface PageMsgLogInput {
/**
* @type {Search}
* @memberof PageMsgLogInput
*/
search?: Search;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
keyword?: string | null;
/**
* @type {Filter}
* @memberof PageMsgLogInput
*/
filter?: Filter;
/**
*
*
* @type {number}
* @memberof PageMsgLogInput
*/
page?: number;
/**
*
*
* @type {number}
* @memberof PageMsgLogInput
*/
pageSize?: number;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
field?: string | null;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
order?: string | null;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
descStr?: string | null;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
receiveUserName?: string | null;
/**
*
*
* @type {string}
* @memberof PageMsgLogInput
*/
sendUserName?: string | null;
/**
*
*
* @type {Date}
* @memberof PageMsgLogInput
*/
startTime?: Date | null;
/**
*
*
* @type {Date}
* @memberof PageMsgLogInput
*/
endTime?: Date | null;
}

View File

@ -0,0 +1,79 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { SysLogMsg } from './sys-log-msg';
/**
*
*
* @export
* @interface SqlSugarPagedListSysLogMsg
*/
export interface SqlSugarPagedListSysLogMsg {
/**
*
*
* @type {number}
* @memberof SqlSugarPagedListSysLogMsg
*/
page?: number;
/**
*
*
* @type {number}
* @memberof SqlSugarPagedListSysLogMsg
*/
pageSize?: number;
/**
*
*
* @type {number}
* @memberof SqlSugarPagedListSysLogMsg
*/
total?: number;
/**
*
*
* @type {number}
* @memberof SqlSugarPagedListSysLogMsg
*/
totalPages?: number;
/**
*
*
* @type {Array<SysLogMsg>}
* @memberof SqlSugarPagedListSysLogMsg
*/
items?: Array<SysLogMsg> | null;
/**
*
*
* @type {boolean}
* @memberof SqlSugarPagedListSysLogMsg
*/
hasPrevPage?: boolean;
/**
*
*
* @type {boolean}
* @memberof SqlSugarPagedListSysLogMsg
*/
hasNextPage?: boolean;
}

View File

@ -0,0 +1,222 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface SysLogMsg
*/
export interface SysLogMsg {
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof SysLogMsg
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof SysLogMsg
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof SysLogMsg
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
tenantId?: number | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
title?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
message?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
receiveUserId?: number;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
receiveUserName?: string | null;
/**
* Id集合
*
* @type {string}
* @memberof SysLogMsg
*/
receiveUserIds?: string | null;
/**
* IP
*
* @type {string}
* @memberof SysLogMsg
*/
receiveIp?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
receiveBrowser?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
receiveOs?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
receiveDevice?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysLogMsg
*/
sendUserId?: number;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
sendUserName?: string | null;
/**
*
*
* @type {Date}
* @memberof SysLogMsg
*/
sendTime?: Date;
/**
* IP
*
* @type {string}
* @memberof SysLogMsg
*/
sendIp?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
sendBrowser?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
sendOs?: string | null;
/**
*
*
* @type {string}
* @memberof SysLogMsg
*/
sendDevice?: string | null;
}

View File

@ -0,0 +1,310 @@
<template>
<div class="syslogmsg-container">
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px' }">
<scEcharts v-if="echartsOption.series.data" height="200px" :option="echartsOption" @clickData="clickData"></scEcharts>
</el-card>
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
<el-row :gutter="10">
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-form-item label="开始时间" prop="name">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" :shortcuts="shortcuts" class="w100" />
</el-form-item>
</el-col>
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-form-item label="结束时间" prop="code">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" :shortcuts="shortcuts" class="w100" />
</el-form-item>
</el-col>
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-form-item label="接收者名称">
<el-input v-model="state.queryParams.receiveUserName" placeholder="接收者名称" clearable />
</el-form-item>
</el-col>
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-form-item label="发送者名称">
<el-input v-model="state.queryParams.sendUserName" placeholder="发送者名称" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
<el-row>
<el-col>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLogOp/page'" :loading="options.loading"> 查询 </el-button>
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
</el-button-group>
</el-col>
</el-row>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents" @cell-dblclick="handleView">
<template #toolbar_buttons>
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysLogOp/clear'"> 清空 </el-button>
</template>
<template #toolbar_tools> </template>
<template #empty>
<el-empty :image-size="200" />
</template>
<template #row_logLevel="{ row }">
<el-tag v-if="row.logLevel === 1">调试</el-tag>
<el-tag v-else-if="row.logLevel === 2">消息</el-tag>
<el-tag v-else-if="row.logLevel === 3">警告</el-tag>
<el-tag v-else-if="row.logLevel === 4">错误</el-tag>
<el-tag v-else>其他</el-tag>
</template>
<template #row_status="{ row }">
<el-tag type="success">成功</el-tag>
</template>
<template #row_buttons="{ row }">
<el-button icon="ele-InfoFilled" text type="primary" @click="handleView({ row })">详情</el-button>
</template>
</vxe-grid>
</el-card>
<el-dialog v-model="state.visible" draggable overflow destroy-on-close>
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Document /> </el-icon>
<span> 日志详情 </span>
</div>
</template>
<el-scrollbar height="calc(100vh - 250px)">
<div v-html="state.detail.message"></div>
</el-scrollbar>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="sysLogMsg">
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { ElMessage } from 'element-plus';
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
import { Local } from '/@/utils/storage';
import { formatDate } from '/@/utils/formatTime';
import { getAPI } from '/@/utils/axios-utils';
import { SysLogMsgApi } from '/@/api-services/api';
import { SysLogMsg, PageMsgLogInput } from '/@/api-services/models';
const scEcharts = defineAsyncComponent(() => import('/@/components/scEcharts/index.vue'));
const shortcuts = useDateTimeShortCust();
const xGrid = ref<VxeGridInstance>();
const state = reactive({
queryParams: {
startTime: undefined as any,
endTime: undefined as any,
receiveUserName: undefined,
sendUserName: undefined,
},
localPageParam: {
pageSize: 50 as number,
defaultSort: { field: 'id', order: 'desc', descStr: 'desc' },
},
visible: false,
detail: {
message: '' as string | null | undefined,
},
activeTab: 'message',
logMaxValue: 1,
});
const echartsOption = ref({
title: {
top: 30,
left: 'center',
text: '日志统计',
show: false,
},
tooltip: {
formatter: function (p: any) {
return p.data[1] + ' 数据量:' + p.data[0];
},
},
visualMap: {
show: true,
// inRange: {
// color: ['#fbeee2', '#f2cac9', '#efafad', '#f19790', '#f1908c', '#f17666', '#f05a46', '#ed3b2f', '#ec2b24', '#de2a18'],
// },
min: 0,
max: 1000,
maxOpen: {
type: 'piecewise',
},
type: 'piecewise',
orient: 'horizontal',
left: 'right',
},
calendar: {
top: 30,
left: 30,
right: 30,
bottom: 30,
cellSize: ['auto', 20],
range: ['', ''],
splitLine: true,
dayLabel: {
firstDay: 1,
nameMap: 'ZH',
},
itemStyle: {
color: '#ccc',
borderWidth: 3,
borderColor: '#fff',
},
monthLabel: {
nameMap: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
},
yearLabel: {
show: false,
},
},
series: {
type: 'heatmap',
coordinateSystem: 'calendar',
data: [],
},
});
//
const localPageParamKey = 'localPageParam:sysOpLog';
//
const options = useVxeTable<SysLogMsg>(
{
id: 'sysOpLog',
name: '操作日志',
columns: [
// { type: 'checkbox', width: 40 },
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
{ field: 'createTime', title: '日志时间', minWidth: 160, showOverflow: 'tooltip' },
{ field: 'title', title: '消息标题', minWidth: 120, showOverflow: 'tooltip' },
{ field: 'receiveUserName', title: '接收者名称', minWidth: 150, showOverflow: 'tooltip' },
{ field: 'receiveIp', title: '接收者IP', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'receiveBrowser', title: '接收者浏览器', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'receiveOs', title: '接收者操作系统', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'receiveDevice', title: '接收者设备', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'sendUserName', title: '接收者名称', minWidth: 150, showOverflow: 'tooltip' },
{ field: 'sendIp', title: '接收者IP', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'sendBrowser', title: '接收者浏览器', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'sendOs', title: '接收者操作系统', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'sendDevice', title: '接收者设备', minWidth: 100, showOverflow: 'tooltip' },
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
],
},
// vxeGrid()vxe-table
{
//
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
//
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
//
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
//
toolbarConfig: { export: false },
}
);
//
onMounted(async () => {
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
await getYearDayStatsData();
});
//
const getYearDayStatsData = async () => {
let data = [] as any;
var res = await getAPI(SysLogMsgApi).apiSysLogMsgYearDayStatsGet();
res.data.result?.forEach((item: any) => {
data.push([item.date, item.count]);
if (item.count > state.logMaxValue) state.logMaxValue = item.count; //
});
echartsOption.value.visualMap.max = state.logMaxValue;
echartsOption.value.series.data = data;
echartsOption.value.calendar.range = [data[0][0], data[data.length - 1][0]];
};
//
const clickData = (e: any) => {
if (e[1] < 1) return ElMessage.warning('没有日志数据');
state.queryParams.startTime = e[0];
var today = new Date(state.queryParams.startTime);
let endTime = today.setDate(today.getDate() + 1);
state.queryParams.endTime = formatDate(new Date(endTime), 'YYYY-mm-dd');
xGrid.value?.commitProxy('query');
};
// api
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageMsgLogInput;
return getAPI(SysLogMsgApi).apiSysLogMsgPagePost(params);
};
//
const handleQuery = async (reset = false) => {
options.loading = true;
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
options.loading = false;
};
//
const resetQuery = async () => {
state.queryParams.startTime = undefined;
state.queryParams.endTime = undefined;
state.queryParams.receiveUserName = undefined;
state.queryParams.sendUserName = undefined;
await xGrid.value?.commitProxy('reload');
};
//
const gridEvents: VxeGridListeners<SysLogMsg> = {
// pager-config
async pageChange({ pageSize }) {
state.localPageParam.pageSize = pageSize;
Local.set(localPageParamKey, state.localPageParam);
},
//
async sortChange({ field, order }) {
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
Local.set(localPageParamKey, state.localPageParam);
},
};
//
const handleClear = async () => {
options.loading = true;
await getAPI(SysLogMsgApi).apiSysLogMsgClearPost();
options.loading = false;
ElMessage.success('清空成功');
await handleQuery();
};
//
const handleView = async ({ row }: any) => {
const { data } = await getAPI(SysLogMsgApi).apiSysLogMsgDetailIdGet(row.id);
state.activeTab = 'message';
state.detail.message = data?.result?.message;
state.visible = true;
};
</script>
<style lang="scss" scoped>
pre {
line-height: 20px;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
</style>

View File

@ -39,7 +39,6 @@
import { reactive, ref } from 'vue';
import { useUserInfo } from '/@/stores/userInfo';
import { storeToRefs } from 'pinia';
import { formatDate } from '/@/utils/formatTime';
import Editor from '/@/components/editor/index.vue';
import { signalR } from '../signalR';
@ -49,7 +48,7 @@ const { userInfos } = storeToRefs(stores);
const props = defineProps({
title: String,
});
const emits = defineEmits(['handleQuery']);
// const emits = defineEmits(['handleQuery']);
const ruleFormRef = ref();
const state = reactive({
isShowDialog: false,
@ -62,12 +61,10 @@ const openDialog = (row: any) => {
var receiveUser = JSON.parse(JSON.stringify(row));
state.ruleForm.receiveUserId = receiveUser.userId;
state.ruleForm.receiveUserName = receiveUser.realName;
state.ruleForm.receiveUserName = receiveUser.realName + '/' + receiveUser.userName;
state.ruleForm.connectionId = receiveUser.connectionId;
state.ruleForm.sendUserId = userInfos.value.id;
state.ruleForm.sendUserName = userInfos.value.realName;
state.ruleForm.sendTime = formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS');
state.isShowDialog = true;
};