♻️ Move the web reader to insight completely

This commit is contained in:
2026-01-02 01:23:45 +08:00
parent ede49333f8
commit 07b8c99682
65 changed files with 806 additions and 864 deletions

View File

@@ -0,0 +1,28 @@
using DysonNetwork.Shared.Models;
using DysonNetwork.Shared.Proto;
namespace DysonNetwork.Shared.Registry;
public class RemoteWebFeedService(WebFeedService.WebFeedServiceClient webFeeds)
{
public async Task<SnWebFeed> GetWebFeed(Guid id)
{
var request = new GetWebFeedRequest { Id = id.ToString() };
var response = await webFeeds.GetWebFeedAsync(request);
return response.Feed != null ? SnWebFeed.FromProtoValue(response.Feed) : null!;
}
public async Task<SnWebFeed> GetWebFeedByUrl(string url)
{
var request = new GetWebFeedRequest { Url = url };
var response = await webFeeds.GetWebFeedAsync(request);
return response.Feed != null ? SnWebFeed.FromProtoValue(response.Feed) : null!;
}
public async Task<List<SnWebFeed>> ListWebFeeds(Guid publisherId)
{
var request = new ListWebFeedsRequest { PublisherId = publisherId.ToString() };
var response = await webFeeds.ListWebFeedsAsync(request);
return response.Feeds.Select(SnWebFeed.FromProtoValue).ToList();
}
}