030e59e
zhenyi
refactor(lib): migrate storage and security tier to central lib/config (auth, cache, db, email, jwt, payment, queue, rate_limit, storage)
030e59e
use axum::extract::{Path, State};
use export::data::AppResponseData;
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
use crate::features::issue_watch::WatchView;
#[utoipa::path(
get,
path = "/issues/{channel_id}/{issue_id}/watch",
tag = "issues",
responses((status = 200, description = "Get my watch state", body = AppResponseData<WatchView>)),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<IssueService>,
AuthUser { claims }: AuthUser,
Path((channel_id, issue_id)): Path<(Uuid, Uuid)>,
) -> IssueResult<AppResponseData<WatchView>> {
let view = svc.get_my_watch(claims.sub, channel_id, issue_id).await?;
Ok(AppResponseData::ok(view))
}