mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-02 18:17:31 +08:00
@ -8,15 +8,14 @@ public sealed record SeedDataInsertedEvent : DataAbstraction, IEventSource
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeedDataInsertedEvent" /> class.
|
||||
/// </summary>
|
||||
public SeedDataInsertedEvent(int insertedCount)
|
||||
public SeedDataInsertedEvent(int insertedCount, bool isConsumOnce = false)
|
||||
{
|
||||
IsConsumOnce = isConsumOnce;
|
||||
InsertedCount = insertedCount;
|
||||
CreatedTime = DateTime.Now;
|
||||
EventId = nameof(SeedDataInsertedEvent);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public CancellationToken CancellationToken { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime CreatedTime { get; }
|
||||
|
||||
@ -27,10 +26,13 @@ public sealed record SeedDataInsertedEvent : DataAbstraction, IEventSource
|
||||
public bool IsConsumOnce { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public object Payload { get; }
|
||||
public CancellationToken CancellationToken { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 插入数量
|
||||
/// </summary>
|
||||
public int InsertedCount { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public object Payload { get; init; }
|
||||
}
|
@ -52,6 +52,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 示例是否存在
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.ExistAsync(req);
|
||||
@ -60,6 +61,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 导出示例
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.ExportAsync(req);
|
||||
@ -84,6 +86,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 查询示例
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<IEnumerable<QueryExampleRsp>> QueryAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.QueryAsync(req);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0-rc.2.24474.3"/>
|
||||
<PackageReference Include="xunit" Version="2.9.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.42">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
Reference in New Issue
Block a user