federation refinement

This commit is contained in:
2026-05-09 13:53:45 +02:00
parent df71748897
commit 470b29c9e1
56 changed files with 1513 additions and 544 deletions

View File

@@ -20,9 +20,42 @@ pub struct GetActivityFeedQuery {
pub struct GetUsersQuery;
#[derive(Debug, Clone, Copy, Default)]
pub enum ProfileView {
History,
Trends,
Ratings,
#[default]
Recent,
}
impl ProfileView {
pub fn as_str(&self) -> &'static str {
match self {
Self::History => "history",
Self::Trends => "trends",
Self::Ratings => "ratings",
Self::Recent => "recent",
}
}
}
impl std::str::FromStr for ProfileView {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"history" => Ok(Self::History),
"trends" => Ok(Self::Trends),
"ratings" => Ok(Self::Ratings),
"recent" => Ok(Self::Recent),
other => Err(format!("unknown profile view: {other}")),
}
}
}
pub struct GetUserProfileQuery {
pub user_id: Uuid,
pub view: String,
pub view: ProfileView,
pub limit: Option<u32>,
pub offset: Option<u32>,
}