forked from xiongyuxing/tiku-backend.net
32 lines
757 B
C#
32 lines
757 B
C#
namespace Tiku.Application.Security;
|
|
|
|
public enum SystemScopeCallerType
|
|
{
|
|
Platform,
|
|
Worker,
|
|
Migrator,
|
|
PublicQuestionBank,
|
|
Test
|
|
}
|
|
|
|
public sealed record SystemScopeRequest(
|
|
Guid? TargetTenantId,
|
|
SystemScopeCallerType CallerType,
|
|
string Caller,
|
|
string Reason,
|
|
string CorrelationId);
|
|
|
|
public interface ITenantExecutionScope
|
|
{
|
|
Task ExecuteAsync(
|
|
SystemScopeRequest request,
|
|
Func<IServiceProvider, CancellationToken, Task> operation,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
Task<TResult> ExecuteAsync<TResult>(
|
|
SystemScopeRequest request,
|
|
Func<IServiceProvider, CancellationToken, Task<TResult>> operation,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
}
|