Skip to content

Commit

Permalink
chore(users): migrate proto backend to native
Browse files Browse the repository at this point in the history
  • Loading branch information
ABCxFF committed Jan 28, 2025
1 parent 2519b6f commit 4bfdbf2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/services/user/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod ops;
pub mod types;
18 changes: 18 additions & 0 deletions packages/services/user/src/types/identity.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#[derive(Clone, PartialEq)]
pub struct Email {
pub email: String,
}

#[derive(Clone, PartialEq)]
pub struct DefaultUser {}

#[derive(Clone, PartialEq)]
pub enum Kind {
Email(Email),
DefaultUser(DefaultUser),
}

#[derive(Clone, PartialEq)]
pub struct Identity {
pub kind: Kind
}
21 changes: 21 additions & 0 deletions packages/services/user/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use chirp_workflow::prelude::*;
use rivet_operation::prelude::{proto};
use proto::backend;

pub mod identity;

#[derive(Debug, Default)]
pub struct User {
pub user_id: Uuid,
pub display_name: String,
pub account_number: i64,
pub avatar_id: String,
pub profile_upload_id: Option<Uuid>,
pub profile_file_name: Option<String>,
pub profile_provider: Option<backend::upload::Provider>,
pub join_ts: i64,
pub bio: String,
pub is_admin: bool,
pub delete_request_ts: Option<i64>,
pub delete_complete_ts: Option<i64>,
}

0 comments on commit 4bfdbf2

Please sign in to comment.