gitdataai/libs/api/user/stars.rs
ZhenYi 80e2201b8b feat(user): add Activity, Following, Stars, Security tabs to profile page
- 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)
2026-04-22 22:39:14 +08:00

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())
}