-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphQL): add notifications api
Signed-off-by: Wei Zhang <[email protected]>
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
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
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
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
use juniper::GraphQLEnum; | ||
use chrono::{DateTime, Utc}; | ||
use juniper::{GraphQLEnum, GraphQLObject, ID}; | ||
|
||
#[derive(GraphQLEnum, Clone, Debug)] | ||
pub enum NotificationRecipient { | ||
Admin, | ||
AllUser, | ||
} | ||
|
||
#[derive(GraphQLObject)] | ||
pub struct Notification { | ||
pub id: ID, | ||
pub content: String, | ||
pub read: bool, | ||
pub created_at: DateTime<Utc>, | ||
pub updated_at: DateTime<Utc>, | ||
} |