add 操作日志
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using Dlhis.Basic.Common.ApiLog.Request;
|
||||
using Dlhis.Basic.Common.ApiLog.Response;
|
||||
using Dlhis.Basic.Common.ApiLog.Services.Implements;
|
||||
using Dlhis.Entity.Common;
|
||||
using Dlhis.Entity.Common.Entities;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using SqlSugar;
|
||||
|
||||
9
Src/Dlhis.Basic/Common/ApiLog/Services/IOperateLog.cs
Normal file
9
Src/Dlhis.Basic/Common/ApiLog/Services/IOperateLog.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Dlhis.Entity.Common.Enums;
|
||||
|
||||
namespace Dlhis.Basic.Common.ApiLog.Services;
|
||||
|
||||
public interface IOperateLog : IScopeDependency
|
||||
{
|
||||
Task LogAsync(OperateLogType type, string content);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Dlhis.Entity.Common.Entities;
|
||||
using Dlhis.Entity.Common.Enums;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Basic.Common.ApiLog.Services.Implements;
|
||||
|
||||
public class OperateLogService : IOperateLog
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public OperateLogService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext.ChangeDb("log");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task LogAsync(OperateLogType type, string content)
|
||||
{
|
||||
await _dbContext.InsertAsync(new OperateLogEntity
|
||||
{
|
||||
Type = type,
|
||||
Content = content
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.Common.FileOperation.Request;
|
||||
using Dlhis.Basic.Common.FileOperation.Response;
|
||||
using Dlhis.Entity.Common;
|
||||
using Dlhis.Entity.Common.Entities;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
|
||||
Reference in New Issue
Block a user