XFEExtension.NetCore.ServerInteractive
[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig
关注
0
Fork
0
Star
0
using System.Text.Json;
using XFEExtension.NetCore.ServerInteractive.Interfaces;
using XFEExtension.NetCore.ServerInteractive.Models.UserModels;
using XFEExtension.NetCore.ServerInteractive.Utilities.JsonConverter;
namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
/// <inheritdoc/>
public abstract class UserServiceBase : IUserServiceBase
{
/// <inheritdoc/>
public Func<IEnumerable<IUserInfo>> GetUserFunction { get; set; } = () => [];
/// <inheritdoc/>
public Func<IEnumerable<EncryptedUserLoginModel>> GetEncryptedUserLoginModelFunction { get; set; } = () => [];
/// <inheritdoc/>
public Action<EncryptedUserLoginModel> AddEncryptedUserLoginModelFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<EncryptedUserLoginModel> RemoveEncryptedUserLoginModelFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<IUserInfo> AddUserFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<IUserInfo> UpdateUserFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Func<int> GetLoginKeepDays { get; set; } = () => 7;
/// <inheritdoc/>
public JsonSerializerOptions JsonSerializerOptions { get; set; } = new();
/// <inheritdoc cref="IUserServiceBase" />
protected UserServiceBase() => JsonSerializerOptions.Converters.Add(new JsonDateTimeConverter());
}
using System.Text.Json;
using XFEExtension.NetCore.ServerInteractive.Interfaces;
using XFEExtension.NetCore.ServerInteractive.Models.UserModels;
using XFEExtension.NetCore.ServerInteractive.Utilities.JsonConverter;
namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
/// <inheritdoc/>
public abstract class UserServiceBase : IUserServiceBase
{
/// <inheritdoc/>
public Func<IEnumerable<IUserInfo>> GetUserFunction { get; set; } = () => [];
/// <inheritdoc/>
public Func<IEnumerable<EncryptedUserLoginModel>> GetEncryptedUserLoginModelFunction { get; set; } = () => [];
/// <inheritdoc/>
public Action<EncryptedUserLoginModel> AddEncryptedUserLoginModelFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<EncryptedUserLoginModel> RemoveEncryptedUserLoginModelFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<IUserInfo> AddUserFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Action<IUserInfo> UpdateUserFunction { get; set; } = _ => { };
/// <inheritdoc/>
public Func<int> GetLoginKeepDays { get; set; } = () => 7;
/// <inheritdoc/>
public JsonSerializerOptions JsonSerializerOptions { get; set; } = new();
/// <inheritdoc cref="IUserServiceBase" />
protected UserServiceBase() => JsonSerializerOptions.Converters.Add(new JsonDateTimeConverter());
}