Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:News alerts #219

Merged
merged 16 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,352 changes: 1,313 additions & 1,039 deletions server/api/tumdev/campus_backend.pb.go

Large diffs are not rendered by default.

227 changes: 213 additions & 14 deletions server/api/tumdev/campus_backend.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 31 additions & 3 deletions server/api/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,22 @@ import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

service Campus {
rpc GetTopNews (google.protobuf.Empty) returns (GetTopNewsReply) {
rpc GetTopNewsAlert (google.protobuf.Empty) returns (GetTopNewsAlertReply) {
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
option (google.api.http) = {
get: "/news/top"
get: "/news/alerts/top"
response_body: "alert"
};
}
rpc GetNewsAlert (GetNewsAlertRequest) returns (GetNewsAlertReply) {
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
option (google.api.http) = {
get: "/news/alerts/{id}"
response_body: "alert"
};
}
rpc GetNewsAlerts (google.protobuf.Empty) returns (GetNewsAlertsReply) {
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
option (google.api.http) = {
get: "/news/alerts"
response_body: "alerts"
};
}

Expand Down Expand Up @@ -386,7 +399,22 @@ message NewsSource {
string icon = 3;
}

message GetTopNewsReply {
message GetNewsAlertRequest {
int32 id = 1;
}

message GetNewsAlertReply {
NewsAlert alert = 1;
}

message GetNewsAlertsReply {
repeated NewsAlert alerts = 1;
}
message GetTopNewsAlertReply {
NewsAlert alert = 1;
}

message NewsAlert {
string image_url = 1;
string link = 2;
google.protobuf.Timestamp created = 3;
Expand Down
Loading