Skip to content

Commit 891a9b9

Browse files
committed
Add new classes and interfaces for knowledge management
This commit introduces new classes `QuantizedTaskDto`, `KnowledgeStore`, and `KnowledgeHandle`, as well as the interface `IKnowledgeStore` to support knowledge management functionalities. The `KnowledgeStore` class implements the `IKnowledgeStore` interface, providing methods for writing and reading knowledge, while `KnowledgeHandle` is a background service that logs the start of the knowledge service.
1 parent 4ba947f commit 891a9b9

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Koala.Application.Contract.knowledge.Dto;
2+
3+
public class QuantizedTaskDto
4+
{
5+
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Koala.Application.Contract.knowledge;
2+
3+
public interface IKnowledgeStore
4+
{
5+
Task Write();
6+
7+
Task<bool> TryRead();
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Extensions.Hosting;
2+
using Microsoft.Extensions.Logging;
3+
4+
namespace Koala.Application.knowledge;
5+
6+
public class KnowledgeHandle(ILogger<KnowledgeHandle> logger) : BackgroundService
7+
{
8+
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
9+
{
10+
logger.LogInformation("知识库后台服务启动");
11+
12+
while (!stoppingToken.IsCancellationRequested)
13+
{
14+
}
15+
16+
}
17+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Koala.Application.Contract.knowledge;
2+
3+
namespace Koala.Application.knowledge;
4+
5+
public class KnowledgeStore : IKnowledgeStore
6+
{
7+
public Task Write()
8+
{
9+
throw new NotImplementedException();
10+
}
11+
12+
public Task<bool> TryRead()
13+
{
14+
throw new NotImplementedException();
15+
}
16+
}

0 commit comments

Comments
 (0)