Skip to content

Commit

Permalink
implemented the GetNewsAlert(s) methods
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Sep 12, 2023
1 parent 8262664 commit 100fd58
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 7 deletions.
190 changes: 190 additions & 0 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.

23 changes: 23 additions & 0 deletions server/api/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ service Campus {
response_body: "alert"
};
}
rpc GetNewsAlert (GetNewsAlertRequest) returns (GetNewsAlertReply) {
option (google.api.http) = {
get: "/news/alerts/{id}"
response_body: "alert"
};
}
rpc GetNewsAlerts (google.protobuf.Empty) returns (GetNewsAlertsReply) {
option (google.api.http) = {
get: "/news/alerts"
response_body: "alerts"
};
}

rpc GetNewsSources (google.protobuf.Empty) returns (NewsSourceReply) {
option (google.api.http) = {
Expand Down Expand Up @@ -387,6 +399,17 @@ message NewsSource {
string icon = 3;
}

message GetNewsAlertRequest {
int32 id = 1;
}

message GetNewsAlertReply {
NewsAlert alert = 1;
}

message GetNewsAlertsReply {
repeated NewsAlert alerts = 1;
}
message GetTopNewsAlertReply {
NewsAlert alert = 1;
}
Expand Down
77 changes: 77 additions & 0 deletions server/api/tumdev/campus_backend.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,32 @@
]
}
},
"/news/alerts": {
"get": {
"operationId": "Campus_GetNewsAlerts",
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/apiNewsAlert"
}
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"Campus"
]
}
},
"/news/alerts/top": {
"get": {
"operationId": "Campus_GetTopNewsAlert",
Expand All @@ -857,6 +883,37 @@
]
}
},
"/news/alerts/{id}": {
"get": {
"operationId": "Campus_GetNewsAlert",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/apiNewsAlert"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}
],
"tags": [
"Campus"
]
}
},
"/news/sources": {
"get": {
"operationId": "Campus_GetNewsSources",
Expand Down Expand Up @@ -1555,6 +1612,26 @@
}
}
},
"apiGetNewsAlertReply": {
"type": "object",
"properties": {
"alert": {
"$ref": "#/definitions/apiNewsAlert"
}
}
},
"apiGetNewsAlertsReply": {
"type": "object",
"properties": {
"alerts": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/apiNewsAlert"
}
}
}
},
"apiGetNotificationsConfirmReply": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 100fd58

Please sign in to comment.