use axum::Json; use axum::extract::{Path, Query, State}; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use crate::features::extras::UserMini; #[derive(serde::Deserialize, utoipa::IntoParams)] pub struct StargazerQuery { pub page: Option, pub limit: Option, } #[utoipa::path( get, path = "/repo/{channel_id}/{repo_id}/stargazers", tag = "repo", params(StargazerQuery), responses((status = 200, description = "List stargazers", body = Vec)), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((_, repo_id)): Path<(Uuid, Uuid)>, Query(q): Query, ) -> RepoResult>> { let out = svc .list_stargazers(claims.sub, repo_id, q.page, q.limit) .await?; Ok(Json(out)) }