- Backend: user_activity service (user_activity_log + project_activity)
- Backend: stars service (repo_star + project_follow)
- Backend: user_get_following_list (with is_following_me mutual check)
- Frontend: Tab navigation on /user/{username} with Overview/Activity/Following/Stars/Security
- Frontend: UserActivity timeline, FollowingList grid, StarsList, SecurityTab (SSH keys + PATs)
26 lines
806 B
Rust
26 lines
806 B
Rust
use crate::{ApiResponse, error::ApiError};
|
|
use actix_web::{HttpResponse, Result, web};
|
|
use service::AppService;
|
|
use session::Session;
|
|
|
|
#[utoipa::path(
|
|
get,
|
|
path = "/api/users/{username}/stars",
|
|
params(("username" = String, Path)),
|
|
responses(
|
|
(status = 200, description = "Get user stars", body = ApiResponse<service::user::stars::UserStarsResponse>),
|
|
(status = 401, description = "Unauthorized"),
|
|
(status = 404, description = "Not found"),
|
|
),
|
|
tag = "User"
|
|
)]
|
|
pub async fn get_user_stars(
|
|
service: web::Data<AppService>,
|
|
session: Session,
|
|
path: web::Path<String>,
|
|
) -> Result<HttpResponse, ApiError> {
|
|
let username = path.into_inner();
|
|
let resp = service.get_user_stars(session, username).await?;
|
|
Ok(ApiResponse::ok(resp).to_response())
|
|
}
|