🐛 Fix insight register grpc service twice

This commit is contained in:
2026-01-02 21:33:33 +08:00
parent 9ecc64352c
commit 1596897a5b
2 changed files with 75 additions and 79 deletions

View File

@@ -39,10 +39,6 @@ using (var scope = app.Services.CreateScope())
await db.Database.MigrateAsync(); await db.Database.MigrateAsync();
} }
app.MapGrpcService<WebReaderGrpcService>();
app.MapGrpcService<WebArticleGrpcService>();
app.MapGrpcService<WebFeedGrpcService>();
app.ConfigureAppMiddleware(builder.Configuration); app.ConfigureAppMiddleware(builder.Configuration);
app.UseSwaggerManifest("DysonNetwork.Insight"); app.UseSwaggerManifest("DysonNetwork.Insight");

View File

@@ -9,152 +9,152 @@ import "embed.proto";
import "publisher.proto"; import "publisher.proto";
message WebFeedConfig { message WebFeedConfig {
bool scrap_page = 1; bool scrap_page = 1;
} }
message WebFeed { message WebFeed {
string id = 1; string id = 1;
string url = 2; string url = 2;
string title = 3; string title = 3;
optional string description = 4; optional string description = 4;
optional google.protobuf.Timestamp verified_at = 5; optional google.protobuf.Timestamp verified_at = 5;
optional LinkEmbed preview = 6; optional LinkEmbed preview = 6;
WebFeedConfig config = 7; WebFeedConfig config = 7;
string publisher_id = 8; string publisher_id = 8;
optional Publisher publisher = 9; optional Publisher publisher = 9;
google.protobuf.Timestamp created_at = 10; google.protobuf.Timestamp created_at = 10;
google.protobuf.Timestamp updated_at = 11; google.protobuf.Timestamp updated_at = 11;
optional google.protobuf.Timestamp deleted_at = 12; optional google.protobuf.Timestamp deleted_at = 12;
} }
message WebArticle { message WebArticle {
string id = 1; string id = 1;
string title = 2; string title = 2;
string url = 3; string url = 3;
optional string author = 4; optional string author = 4;
optional bytes meta = 5; optional bytes meta = 5;
optional LinkEmbed preview = 6; optional LinkEmbed preview = 6;
optional string content = 7; optional string content = 7;
optional google.protobuf.Timestamp published_at = 8; optional google.protobuf.Timestamp published_at = 8;
string feed_id = 9; string feed_id = 9;
optional WebFeed feed = 10; optional WebFeed feed = 10;
google.protobuf.Timestamp created_at = 11; google.protobuf.Timestamp created_at = 11;
google.protobuf.Timestamp updated_at = 12; google.protobuf.Timestamp updated_at = 12;
optional google.protobuf.Timestamp deleted_at = 13; optional google.protobuf.Timestamp deleted_at = 13;
} }
message WebFeedSubscription { message WebFeedSubscription {
string id = 1; string id = 1;
string feed_id = 2; string feed_id = 2;
optional WebFeed feed = 3; optional WebFeed feed = 3;
string account_id = 4; string account_id = 4;
google.protobuf.Timestamp created_at = 5; google.protobuf.Timestamp created_at = 5;
google.protobuf.Timestamp updated_at = 6; google.protobuf.Timestamp updated_at = 6;
} }
message ScrapedArticle { message ScrapedArticle {
LinkEmbed link_embed = 1; LinkEmbed link_embed = 1;
optional string content = 2; optional string content = 2;
} }
message GetWebArticleRequest { message GetWebArticleRequest {
string id = 1; string id = 1;
} }
message GetWebArticleResponse { message GetWebArticleResponse {
WebArticle article = 1; WebArticle article = 1;
} }
message GetWebArticleBatchRequest { message GetWebArticleBatchRequest {
repeated string ids = 1; repeated string ids = 1;
} }
message GetWebArticleBatchResponse { message GetWebArticleBatchResponse {
repeated WebArticle articles = 1; repeated WebArticle articles = 1;
} }
message ListWebArticlesRequest { message ListWebArticlesRequest {
string feed_id = 1; string feed_id = 1;
int32 page_size = 2; int32 page_size = 2;
string page_token = 3; string page_token = 3;
} }
message ListWebArticlesResponse { message ListWebArticlesResponse {
repeated WebArticle articles = 1; repeated WebArticle articles = 1;
string next_page_token = 2; string next_page_token = 2;
int32 total_size = 3; int32 total_size = 3;
} }
message GetRecentArticlesRequest { message GetRecentArticlesRequest {
int32 limit = 1; int32 limit = 1;
} }
message GetRecentArticlesResponse { message GetRecentArticlesResponse {
repeated WebArticle articles = 1; repeated WebArticle articles = 1;
} }
message GetWebFeedRequest { message GetWebFeedRequest {
oneof identifier { oneof identifier {
string id = 1; string id = 1;
string url = 2; string url = 2;
} }
} }
message GetWebFeedResponse { message GetWebFeedResponse {
WebFeed feed = 1; WebFeed feed = 1;
} }
message ListWebFeedsRequest { message ListWebFeedsRequest {
string publisher_id = 1; string publisher_id = 1;
int32 page_size = 2; int32 page_size = 2;
string page_token = 3; string page_token = 3;
} }
message ListWebFeedsResponse { message ListWebFeedsResponse {
repeated WebFeed feeds = 1; repeated WebFeed feeds = 1;
string next_page_token = 2; string next_page_token = 2;
int32 total_size = 3; int32 total_size = 3;
} }
message ScrapeArticleRequest { message ScrapeArticleRequest {
string url = 1; string url = 1;
} }
message ScrapeArticleResponse { message ScrapeArticleResponse {
ScrapedArticle article = 1; ScrapedArticle article = 1;
} }
message GetLinkPreviewRequest { message GetLinkPreviewRequest {
string url = 1; string url = 1;
bool bypass_cache = 2; bool bypass_cache = 2;
} }
message GetLinkPreviewResponse { message GetLinkPreviewResponse {
LinkEmbed preview = 1; LinkEmbed preview = 1;
} }
message InvalidateLinkPreviewCacheRequest { message InvalidateLinkPreviewCacheRequest {
string url = 1; string url = 1;
} }
message InvalidateLinkPreviewCacheResponse { message InvalidateLinkPreviewCacheResponse {
bool success = 1; bool success = 1;
} }
service WebArticleService { service WebArticleService {
rpc GetWebArticle(GetWebArticleRequest) returns (GetWebArticleResponse); rpc GetWebArticle(GetWebArticleRequest) returns (GetWebArticleResponse);
rpc GetWebArticleBatch(GetWebArticleBatchRequest) returns (GetWebArticleBatchResponse); rpc GetWebArticleBatch(GetWebArticleBatchRequest) returns (GetWebArticleBatchResponse);
rpc ListWebArticles(ListWebArticlesRequest) returns (ListWebArticlesResponse); rpc ListWebArticles(ListWebArticlesRequest) returns (ListWebArticlesResponse);
rpc GetRecentArticles(GetRecentArticlesRequest) returns (GetRecentArticlesResponse); rpc GetRecentArticles(GetRecentArticlesRequest) returns (GetRecentArticlesResponse);
} }
service WebFeedService { service WebFeedService {
rpc GetWebFeed(GetWebFeedRequest) returns (GetWebFeedResponse); rpc GetWebFeed(GetWebFeedRequest) returns (GetWebFeedResponse);
rpc ListWebFeeds(ListWebFeedsRequest) returns (ListWebFeedsResponse); rpc ListWebFeeds(ListWebFeedsRequest) returns (ListWebFeedsResponse);
} }
service WebReaderService { service WebReaderService {
rpc ScrapeArticle(ScrapeArticleRequest) returns (ScrapeArticleResponse); rpc ScrapeArticle(ScrapeArticleRequest) returns (ScrapeArticleResponse);
rpc GetLinkPreview(GetLinkPreviewRequest) returns (GetLinkPreviewResponse); rpc GetLinkPreview(GetLinkPreviewRequest) returns (GetLinkPreviewResponse);
rpc InvalidateLinkPreviewCache(InvalidateLinkPreviewCacheRequest) returns (InvalidateLinkPreviewCacheResponse); rpc InvalidateLinkPreviewCache(InvalidateLinkPreviewCacheRequest) returns (InvalidateLinkPreviewCacheResponse);
} }