v1
This commit is contained in:
26
OrpaonVision.Core/Abstractions/IUserContext.cs
Normal file
26
OrpaonVision.Core/Abstractions/IUserContext.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace OrpaonVision.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户上下文抽象。
|
||||
///
|
||||
/// 用途:
|
||||
/// - 为审计字段(CreatedBy/UpdatedBy)提供统一来源;
|
||||
/// - 在应用服务中统一获取当前登录人信息。
|
||||
/// </summary>
|
||||
public interface IUserContext
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前用户 ID。
|
||||
/// </summary>
|
||||
string UserId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户名或工号。
|
||||
/// </summary>
|
||||
string UserName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户角色集合。
|
||||
/// </summary>
|
||||
IReadOnlyCollection<string> Roles { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user