Audit Service

This commit is contained in:
Andre Beging
2022-05-23 10:29:10 +02:00
parent 5961c06004
commit 5d713db83f
14 changed files with 552 additions and 49 deletions

View File

@@ -1,5 +1,6 @@
using FoodsharingSiegen.Contracts;
using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Server.Auth;
using Microsoft.EntityFrameworkCore;
namespace FoodsharingSiegen.Server.Data.Service
@@ -16,10 +17,8 @@ namespace FoodsharingSiegen.Server.Data.Service
/// Initializes a new instance of the <see cref="UserService"/> class
/// </summary>
/// <param name="context">The context</param>
public UserService(FsContext context) : base(context)
{
}
/// <param name="authService"></param>
public UserService(FsContext context, AuthService authService) : base(context, authService) { }
#endregion
@@ -58,28 +57,6 @@ namespace FoodsharingSiegen.Server.Data.Service
#endregion
#region Public Method CheckForceLogout
/// <summary>
/// Checks the force logout using the specified user (a. beging, 11.04.2022)
/// </summary>
/// <param name="user">The user</param>
/// <returns>A task containing an operation result of bool</returns>
public async Task<OperationResult<bool>> CheckForceLogout(User user)
{
try
{
var anyR = await Context.Users.AnyAsync(x => x.Id == user.Id && x.ForceLogout);
return new OperationResult<bool>(anyR);
}
catch (Exception e)
{
return new OperationResult<bool>(e);
}
}
#endregion
#region Public Method GetUsersAsync
////////////////////////////////////////////////////////////////////////////////////////////////////