-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact: stream unread notifications (#114)
- Loading branch information
Showing
21 changed files
with
1,381 additions
and
878 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
syntax = "proto3"; | ||
|
||
package api.v1; | ||
|
||
import "api/v1/options.proto"; | ||
import "api/v1/shared.proto"; | ||
import "api/v1/workouts.proto"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
import "buf/validate/validate.proto"; | ||
|
||
service NotificationService { | ||
rpc ListNotifications (ListNotificationsRequest) returns (ListNotificationsResponse) { | ||
option (auth) = true; | ||
} | ||
rpc UnreadNotifications (UnreadNotificationsRequest) returns (stream UnreadNotificationsResponse) { | ||
option (auth) = true; | ||
} | ||
} | ||
|
||
message ListNotificationsRequest { | ||
bool unread_only = 1; | ||
bool mark_as_read = 2; | ||
PaginationRequest pagination = 3 [(buf.validate.field).required = true]; | ||
} | ||
message ListNotificationsResponse { | ||
repeated Notification notifications = 1; | ||
PaginationResponse pagination = 2; | ||
} | ||
|
||
message Notification { | ||
message UserFollowed { | ||
User actor = 1; | ||
} | ||
message WorkoutComment { | ||
User actor = 1; | ||
Workout workout = 2; | ||
} | ||
|
||
string id = 1; | ||
// DEBT: This should be a timestamp but the client is not able to parse it. | ||
int64 notified_at_unix = 2; | ||
oneof type { | ||
UserFollowed user_followed = 3; | ||
WorkoutComment workout_comment = 4; | ||
} | ||
} | ||
|
||
message UnreadNotificationsRequest {} | ||
message UnreadNotificationsResponse { | ||
int64 count = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
server/pkg/pb/api/v1/apiv1connect/notifications.connect.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.