Skip to content

Commit

Permalink
deprecate companions field in ArticlePage and add new method GetArtic…
Browse files Browse the repository at this point in the history
…leCompanions (#344)
  • Loading branch information
Harry Urban authored Jan 31, 2022
1 parent d4b37d4 commit 890d715
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 3 deletions.
11 changes: 11 additions & 0 deletions node-legacy/__tests__/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ test('gRPC article page service client is generated and matches the snapshot', (
Object {
"ArticlePageServiceClient": [Function],
"ArticlePageServiceService": Object {
"getArticleCompanions": Object {
"path": "/stroeer.page.article.v1.ArticlePageService/GetArticleCompanions",
"requestDeserialize": [Function],
"requestSerialize": [Function],
"requestStream": false,
"requestType": [Function],
"responseDeserialize": [Function],
"responseSerialize": [Function],
"responseStream": false,
"responseType": [Function],
},
"getArticlePage": Object {
"path": "/stroeer.page.article.v1.ArticlePageService/GetArticlePage",
"requestDeserialize": [Function],
Expand Down
11 changes: 11 additions & 0 deletions node/__tests__/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ test('gRPC article page service client is generated and matches the snapshot', (
Object {
"ArticlePageServiceClient": [Function],
"ArticlePageServiceService": Object {
"getArticleCompanions": Object {
"path": "/stroeer.page.article.v1.ArticlePageService/GetArticleCompanions",
"requestDeserialize": [Function],
"requestSerialize": [Function],
"requestStream": false,
"requestType": [Function],
"responseDeserialize": [Function],
"responseSerialize": [Function],
"responseStream": false,
"responseType": [Function],
},
"getArticlePage": Object {
"path": "/stroeer.page.article.v1.ArticlePageService/GetArticlePage",
"requestDeserialize": [Function],
Expand Down
4 changes: 2 additions & 2 deletions stroeer/page/article/v1/article_page.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ message ArticlePage {
// stage(s) for the bottom of article pages, mostly seo cases like A-Z Modules
repeated stroeer.page.stage.v1.Stage stages = 3;

// companion items
repeated stroeer.page.stage.v1.Stage.Item companions = 4;
// deprecated companion items. field is getting replaced by a new method in the article page service due to performance issues.
repeated stroeer.page.stage.v1.Stage.Item companions = 4 [deprecated = true];
}

// An editorial article, which is related to another article.
Expand Down
36 changes: 35 additions & 1 deletion stroeer/page/article/v1/article_page_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ syntax = "proto3";
package stroeer.page.article.v1;

import "stroeer/page/article/v1/article_page.proto";
import "stroeer/page/stage/v1/stage.proto";

option go_package = "github.com/stroeer/go-tapir/page/article/v1;article";
option java_multiple_files = true;
Expand All @@ -16,15 +17,17 @@ option java_package = "de.stroeer.page.article.v1";
* ```protobuf
* service ArticlePageService {
* rpc GetArticlePage (GetArticlePageRequest) returns (GetArticlePageResponse) {}
* rpc GetArticleCompanions (GetArticleCompanionsRequest) returns (GetArticleCompanionsResponse) {}
* }
*```
* # Description
*
* turns the requested article with all render relevant data for the user and SEO bots.
* turns the requested article with editorial render relevant data for the user and SEO bots.
*
*/
service ArticlePageService {
rpc GetArticlePage (GetArticlePageRequest) returns (GetArticlePageResponse) {}
rpc GetArticleCompanions (GetArticleCompanionsRequest) returns (GetArticleCompanionsResponse) {}
}

/**
Expand Down Expand Up @@ -59,6 +62,37 @@ message GetArticlePageResponse {
stroeer.page.article.v1.ArticlePage article_page = 1;
}

/**
* ## Request message to get companions for an article page.
* ```protobuf
* message GetArticleCompanionsRequest {
* # section path of the article, e.g. "/sport/fussball/"
* string section_path = 1;
* }
* ```
*/
message GetArticleCompanionsRequest {
string section_path = 1;
}

/**
* ## Response message for an companions request.
*
* Status codes:
* - `OK`
*
* ```protobuf
* message GetArticleCompanionsResponse {
* # List of companions as Stage.Items.
* repeated stroeer.page.stage.v1.Stage.Item companions = 1;
* }
* ```
*/
message GetArticleCompanionsResponse {
// companions with current article teasers to allure seo users to make additional page impressions.
repeated stroeer.page.stage.v1.Stage.Item companions = 1;
}

/**
*
* # Status/Error scenario's
Expand Down

0 comments on commit 890d715

Please sign in to comment.