feat: add module prefixes to all routes and load all modules in swagger

Route structure:
  /v1/iam/auth/*         (was /v1/auth/*)
  /v1/iam/users/*        (was /v1/users/*)
  /v1/iam/roles/*        (was /v1/roles/*)
  /v1/iam/permissions/*  (was /v1/permissions/*)
  /v1/landing/cms/events/*        (was /v1/cms/landing/events/*)
  /v1/landing/cms/testimonials/*  (was /v1/cms/landing/testimonials/*)
  /v1/dimentorin/mentors/*   (was /v1/mentors/*)
  /v1/dimentorin/sessions/*  (was /v1/sessions/*)
  /v1/gacha/*            (unchanged)
  /v1/hackathon/*        (unchanged)
  /v1/qr/*               (unchanged)

Swagger: add gacha_credits endpoints which were missing from OpenAPI spec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
maulanasdqn
2026-04-03 00:26:29 +07:00
co-authored by Claude Sonnet 4.6
parent c38b718eb4
commit 76201d8d3e
17 changed files with 115 additions and 97 deletions
@@ -21,7 +21,7 @@ use uuid::Uuid;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/cms/landing/events", path = "/v1/landing/cms/events",
params( params(
("page" = Option<i64>, Query, description = "Page number"), ("page" = Option<i64>, Query, description = "Page number"),
("per_page" = Option<i64>, Query, description = "Items per page"), ("per_page" = Option<i64>, Query, description = "Items per page"),
@@ -57,7 +57,7 @@ pub async fn get_event_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/cms/landing/events/detail/{id}", path = "/v1/landing/cms/events/detail/{id}",
params( params(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
@@ -90,7 +90,7 @@ pub async fn get_event_by_id(
#[utoipa::path( #[utoipa::path(
post, post,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/events/create", path = "/v1/landing/cms/events/create",
request_body = EventsCreateRequestDto, request_body = EventsCreateRequestDto,
responses( responses(
(status = 201, description = "[ADMIN] Create new event") (status = 201, description = "[ADMIN] Create new event")
@@ -113,7 +113,7 @@ pub async fn post_create_event(
#[utoipa::path( #[utoipa::path(
patch, patch,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/events/update/{id}", path = "/v1/landing/cms/events/update/{id}",
params( params(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
@@ -156,7 +156,7 @@ pub async fn patch_update_event(
#[utoipa::path( #[utoipa::path(
delete, delete,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/events/delete/{id}", path = "/v1/landing/cms/events/delete/{id}",
params( params(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
@@ -20,16 +20,16 @@ fn build_service(db: DatabaseConnection) -> Arc<dyn EventService> {
pub fn events_public_routes(db: DatabaseConnection) -> Router { pub fn events_public_routes(db: DatabaseConnection) -> Router {
let service = build_service(db); let service = build_service(db);
Router::new() Router::new()
.route("/cms/landing/events", get(get_event_list)) .route("/events", get(get_event_list))
.route("/cms/landing/events/detail/{id}", get(get_event_by_id)) .route("/events/detail/{id}", get(get_event_by_id))
.layer(Extension(service)) .layer(Extension(service))
} }
pub fn events_protected_routes(db: DatabaseConnection) -> Router { pub fn events_protected_routes(db: DatabaseConnection) -> Router {
let service = build_service(db); let service = build_service(db);
Router::new() Router::new()
.route("/cms/landing/events/create", post(post_create_event)) .route("/events/create", post(post_create_event))
.route("/cms/landing/events/update/{id}", patch(patch_update_event)) .route("/events/update/{id}", patch(patch_update_event))
.route("/cms/landing/events/delete/{id}", delete(delete_event)) .route("/events/delete/{id}", delete(delete_event))
.layer(Extension(service)) .layer(Extension(service))
} }
@@ -24,7 +24,7 @@ use uuid::Uuid;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/cms/landing/testimonials", path = "/v1/landing/cms/testimonials",
params( params(
("page" = Option<i64>, Query, description = "Page number"), ("page" = Option<i64>, Query, description = "Page number"),
("per_page" = Option<i64>, Query, description = "Items per page"), ("per_page" = Option<i64>, Query, description = "Items per page"),
@@ -62,7 +62,7 @@ pub async fn get_testimonial_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/cms/landing/testimonials/detail/{id}", path = "/v1/landing/cms/testimonials/detail/{id}",
params( params(
("id" = String, Path, description = "Testimonial ID") ("id" = String, Path, description = "Testimonial ID")
), ),
@@ -96,7 +96,7 @@ pub async fn get_testimonial_by_id(
#[utoipa::path( #[utoipa::path(
post, post,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/testimonials/create", path = "/v1/landing/cms/testimonials/create",
request_body = TestimonialsCreateRequestDto, request_body = TestimonialsCreateRequestDto,
responses( responses(
(status = 201, description = "[USER] Create new testimonial", body = ResponseSuccessDto<TestimonialsDetailItemDto>) (status = 201, description = "[USER] Create new testimonial", body = ResponseSuccessDto<TestimonialsDetailItemDto>)
@@ -139,7 +139,7 @@ pub async fn post_create_testimonial(
#[utoipa::path( #[utoipa::path(
patch, patch,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/testimonials/update/{id}", path = "/v1/landing/cms/testimonials/update/{id}",
params( params(
("id" = String, Path, description = "Testimonial ID") ("id" = String, Path, description = "Testimonial ID")
), ),
@@ -178,7 +178,7 @@ pub async fn patch_update_testimonial(
#[utoipa::path( #[utoipa::path(
delete, delete,
security(("Bearer" = [])), security(("Bearer" = [])),
path = "/v1/cms/landing/testimonials/delete/{id}", path = "/v1/landing/cms/testimonials/delete/{id}",
params( params(
("id" = String, Path, description = "Testimonial ID") ("id" = String, Path, description = "Testimonial ID")
), ),
@@ -20,9 +20,9 @@ fn build_service(db: DatabaseConnection) -> Arc<dyn TestimonialService> {
pub fn testimonials_public_routes(db: DatabaseConnection) -> Router { pub fn testimonials_public_routes(db: DatabaseConnection) -> Router {
let service = build_service(db); let service = build_service(db);
Router::new() Router::new()
.route("/cms/landing/testimonials", get(get_testimonial_list)) .route("/testimonials", get(get_testimonial_list))
.route( .route(
"/cms/landing/testimonials/detail/{id}", "/testimonials/detail/{id}",
get(get_testimonial_by_id), get(get_testimonial_by_id),
) )
.layer(Extension(service)) .layer(Extension(service))
@@ -32,15 +32,15 @@ pub fn testimonials_protected_routes(db: DatabaseConnection) -> Router {
let service = build_service(db); let service = build_service(db);
Router::new() Router::new()
.route( .route(
"/cms/landing/testimonials/create", "/testimonials/create",
post(post_create_testimonial), post(post_create_testimonial),
) )
.route( .route(
"/cms/landing/testimonials/update/{id}", "/testimonials/update/{id}",
patch(patch_update_testimonial), patch(patch_update_testimonial),
) )
.route( .route(
"/cms/landing/testimonials/delete/{id}", "/testimonials/delete/{id}",
delete(delete_testimonial), delete(delete_testimonial),
) )
.layer(Extension(service)) .layer(Extension(service))
@@ -17,7 +17,7 @@ use uuid::Uuid;
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/mentors/create", path = "/v1/dimentorin/mentors/create",
request_body = MentorUserRegisterRequestDto, request_body = MentorUserRegisterRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Mentor registered successfully", body = MentorRegisterResponseDto), (status = 200, description = "[PUBLIC] Mentor registered successfully", body = MentorRegisterResponseDto),
@@ -41,7 +41,7 @@ pub async fn post_register_mentor(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/mentors/update/{id}", path = "/v1/dimentorin/mentors/update/{id}",
params( params(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
@@ -76,7 +76,7 @@ pub async fn put_update_mentor(
#[utoipa::path( #[utoipa::path(
delete, delete,
path = "/v1/mentors/delete/{id}", path = "/v1/dimentorin/mentors/delete/{id}",
params( params(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
@@ -107,7 +107,7 @@ pub async fn delete_mentor(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/mentors/verify/{id}", path = "/v1/dimentorin/mentors/verify/{id}",
params( params(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
@@ -142,7 +142,7 @@ pub async fn put_verify_mentor(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/mentors/me/update", path = "/v1/dimentorin/mentors/me/update",
request_body = MentorUpdateRequestDto, request_body = MentorUpdateRequestDto,
responses( responses(
(status = 200, description = "[MENTOR] Mentor profile updated successfully", body = MentorDetailResponseDto), (status = 200, description = "[MENTOR] Mentor profile updated successfully", body = MentorDetailResponseDto),
@@ -177,7 +177,7 @@ pub async fn put_update_mentor_me(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/mentors/update", path = "/v1/dimentorin/mentors/update",
request_body = MentorUpdateRequestDto, request_body = MentorUpdateRequestDto,
responses( responses(
(status = 400, description = "[PUBLIC] Bad request - Mentor ID is required for update"), (status = 400, description = "[PUBLIC] Bad request - Mentor ID is required for update"),
@@ -16,7 +16,7 @@ use uuid::Uuid;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors", path = "/v1/dimentorin/mentors",
params( params(
("page" = Option<u64>, Query, description = "Page number"), ("page" = Option<u64>, Query, description = "Page number"),
("per_page" = Option<u64>, Query, description = "Items per page"), ("per_page" = Option<u64>, Query, description = "Items per page"),
@@ -53,7 +53,7 @@ pub async fn get_mentor_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors/detail/{id}", path = "/v1/dimentorin/mentors/detail/{id}",
params( params(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
@@ -84,7 +84,7 @@ pub async fn get_mentor_by_id(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors/me", path = "/v1/dimentorin/mentors/me",
responses( responses(
(status = 200, description = "[MENTOR] Current user's mentor profile", body = MentorDetailResponseDto), (status = 200, description = "[MENTOR] Current user's mentor profile", body = MentorDetailResponseDto),
(status = 401, description = "[MENTOR] Unauthorized - invalid token"), (status = 401, description = "[MENTOR] Unauthorized - invalid token"),
@@ -119,7 +119,7 @@ pub async fn get_mentor_me(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors/me/status", path = "/v1/dimentorin/mentors/me/status",
responses( responses(
(status = 200, description = "[MENTOR] Mentor application status", body = String), (status = 200, description = "[MENTOR] Mentor application status", body = String),
(status = 401, description = "[MENTOR] Unauthorized - invalid token"), (status = 401, description = "[MENTOR] Unauthorized - invalid token"),
@@ -16,7 +16,7 @@ use std::sync::Arc;
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/mentors/{id}/sessions/create", path = "/v1/dimentorin/mentors/{id}/sessions/create",
tag = "sessions", tag = "sessions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
@@ -48,7 +48,7 @@ pub async fn post_book_session(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/sessions/update/{id}/status", path = "/v1/dimentorin/sessions/update/{id}/status",
tag = "sessions", tag = "sessions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
@@ -80,7 +80,7 @@ pub async fn put_update_session_status(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/sessions/{id}/feedback/create", path = "/v1/dimentorin/sessions/{id}/feedback/create",
tag = "sessions", tag = "sessions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
@@ -17,7 +17,7 @@ pub struct SessionStatusFilter {
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors/{id}/sessions", path = "/v1/dimentorin/mentors/{id}/sessions",
tag = "sessions", tag = "sessions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
@@ -48,7 +48,7 @@ pub async fn get_mentor_sessions(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/mentors/{id}/availability", path = "/v1/dimentorin/mentors/{id}/availability",
tag = "sessions", tag = "sessions",
params( params(
("id" = String, Path, description = "Mentor ID"), ("id" = String, Path, description = "Mentor ID"),
@@ -69,7 +69,7 @@ pub async fn get_mentor_availability(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/users/me/sessions", path = "/v1/dimentorin/sessions/me",
tag = "sessions", tag = "sessions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
@@ -38,7 +38,7 @@ pub fn sessions_protected_routes(
put(put_update_session_status), put(put_update_session_status),
) )
.route("/sessions/{id}/feedback/create", post(post_submit_feedback)) .route("/sessions/{id}/feedback/create", post(post_submit_feedback))
.route("/users/me/sessions", get(get_my_sessions)) .route("/sessions/me", get(get_my_sessions))
.layer(Extension(service)) .layer(Extension(service))
.layer(Extension((*state).clone())) .layer(Extension((*state).clone()))
} }
+19 -11
View File
@@ -29,6 +29,10 @@ use imphnen_gacha::gacha_claims::infrastructure::http::dto::{
GachaClaimCreateRequestDto, GachaClaimDetailDto, GachaClaimCreateRequestDto, GachaClaimDetailDto,
}; };
use imphnen_gacha::gacha_claims::infrastructure::http::handlers as gacha_claims_controller; use imphnen_gacha::gacha_claims::infrastructure::http::handlers as gacha_claims_controller;
use imphnen_gacha::gacha_credits::infrastructure::http::dto::{
GachaCreditAddRequestDto, GachaCreditDto,
};
use imphnen_gacha::gacha_credits::infrastructure::http::handlers as gacha_credits_controller;
use imphnen_gacha::gacha_items::infrastructure::http::dto::{ use imphnen_gacha::gacha_items::infrastructure::http::dto::{
GachaItemCreateRequestDto, GachaItemDto, GachaItemCreateRequestDto, GachaItemDto,
}; };
@@ -77,6 +81,8 @@ use utoipa::OpenApi;
permissions_controller::post_create_permission, permissions_controller::put_update_permission, permissions_controller::post_create_permission, permissions_controller::put_update_permission,
permissions_controller::delete_permission, permissions_controller::delete_permission,
gacha_claims_controller::get_gacha_claim_by_id, gacha_claims_controller::post_create_gacha_claim, gacha_claims_controller::get_gacha_claim_by_id, gacha_claims_controller::post_create_gacha_claim,
gacha_credits_controller::get_user_credits, gacha_credits_controller::post_add_credits,
gacha_credits_controller::post_consume_credit,
gacha_items_controller::get_gacha_item_list, gacha_items_controller::get_gacha_item_by_id, gacha_items_controller::get_gacha_item_list, gacha_items_controller::get_gacha_item_by_id,
gacha_items_controller::post_create_gacha_item, gacha_items_controller::put_update_gacha_item, gacha_items_controller::post_create_gacha_item, gacha_items_controller::put_update_gacha_item,
gacha_items_controller::delete_gacha_item, gacha_items_controller::delete_gacha_item,
@@ -104,7 +110,9 @@ use utoipa::OpenApi;
RolesListItemDto, RolesDetailItemDto, RolesCreateRequestDto, RolesUpdateRequestDto, RolesListItemDto, RolesDetailItemDto, RolesCreateRequestDto, RolesUpdateRequestDto,
PermissionsCreateRequestDto, PermissionsItemDto, PermissionsCreateRequestDto, PermissionsItemDto,
UsersDetailItemDto, UsersListItemDto, UsersUpdateRequestDto, UsersCreateRequestDto, FileUploadSchema, UsersDetailItemDto, UsersListItemDto, UsersUpdateRequestDto, UsersCreateRequestDto, FileUploadSchema,
GachaClaimDetailDto, GachaClaimCreateRequestDto, GachaItemDto, GachaItemCreateRequestDto, GachaClaimDetailDto, GachaClaimCreateRequestDto,
GachaCreditDto, GachaCreditAddRequestDto,
GachaItemDto, GachaItemCreateRequestDto,
GachaRollItemDto, GachaRollCreateRequestDto, GachaRollItemDto, GachaRollCreateRequestDto,
ResponseListSuccessDto<Vec<GachaItemDto>>, ResponseSuccessDto<GachaRollItemDto>, ResponseListSuccessDto<Vec<GachaItemDto>>, ResponseSuccessDto<GachaRollItemDto>,
ResponseSuccessDto<GachaItemDto>, ResponseSuccessDto<GachaClaimDetailDto>, ResponseSuccessDto<GachaItemDto>, ResponseSuccessDto<GachaClaimDetailDto>,
@@ -137,16 +145,16 @@ use utoipa::OpenApi;
), ),
modifiers(&SecurityAddon), modifiers(&SecurityAddon),
tags( tags(
(name = "Authentication", description = "List of Authentication Endpoints"), (name = "Authentication", description = "IAM — Auth endpoints (/v1/iam/auth)"),
(name = "Users", description = "User Management Endpoints"), (name = "Users", description = "IAM — User management (/v1/iam/users)"),
(name = "Roles", description = "Role Management Endpoints"), (name = "Roles", description = "IAM — Role management (/v1/iam/roles)"),
(name = "Permissions", description = "Permission Management Endpoints"), (name = "Permissions", description = "IAM — Permission management (/v1/iam/permissions)"),
(name = "Events", description = "Event Management Endpoints"), (name = "Events", description = "Landing CMS — Event management (/v1/landing/cms/events)"),
(name = "Testimonials", description = "Testimonial Management Endpoints"), (name = "Testimonials", description = "Landing CMS — Testimonial management (/v1/landing/cms/testimonials)"),
(name = "Mentors", description = "Mentor Management Endpoints"), (name = "Mentors", description = "Dimentorin — Mentor management (/v1/dimentorin/mentors)"),
(name = "Mentors - Admin", description = "Mentor Admin Management Endpoints (Admin Access Required)"), (name = "Mentors - Admin", description = "Dimentorin — Mentor admin endpoints (/v1/dimentorin/mentors)"),
(name = "sessions", description = "Mentoring Sessions Management API"), (name = "sessions", description = "Dimentorin Session management (/v1/dimentorin/sessions)"),
(name = "Gacha", description = "Gacha System Endpoints"), (name = "Gacha", description = "Gacha system (/v1/gacha)"),
) )
)] )]
pub struct ApiDoc; pub struct ApiDoc;
+33 -23
View File
@@ -45,40 +45,50 @@ pub async fn gateway_service(postgres_clients: PostgresClients) -> Router {
.await .await
.expect("Failed to create MinIO service"), .expect("Failed to create MinIO service"),
); );
let public_routes = Router::new()
let iam_routes = Router::new()
.merge( .merge(
auth_public_routes(db.clone(), Arc::clone(&state_arc)) auth_public_routes(db.clone(), Arc::clone(&state_arc))
.layer(from_fn(rate_limiting_middleware)), .layer(from_fn(rate_limiting_middleware)),
) )
.merge(
Router::new()
.merge(users_protected_routes(db.clone(), Arc::clone(&state_arc)))
.merge(roles_protected_routes(db.clone(), Arc::clone(&state_arc)))
.merge(permissions_protected_routes(db.clone(), Arc::clone(&state_arc)))
.layer(from_fn(auth_middleware)),
);
let cms_routes = Router::new()
.merge(testimonials_public_routes(db.clone())) .merge(testimonials_public_routes(db.clone()))
.merge(events_public_routes(db.clone())) .merge(events_public_routes(db.clone()))
.merge(mentors_public_routes(db.clone(), Arc::clone(&state_arc))) .merge(
.merge(sessions_public_routes(db.clone())); Router::new()
.merge(events_protected_routes(db.clone()))
.merge(testimonials_protected_routes(db.clone()))
.layer(from_fn(auth_middleware)),
);
let protected_routes = Router::new() let dimentorin_routes = Router::new()
.merge(users_protected_routes(db.clone(), Arc::clone(&state_arc))) .merge(mentors_public_routes(db.clone(), Arc::clone(&state_arc)))
.merge(roles_protected_routes(db.clone(), Arc::clone(&state_arc))) .merge(sessions_public_routes(db.clone()))
.merge(permissions_protected_routes( .merge(
db.clone(), Router::new()
Arc::clone(&state_arc), .merge(mentors_protected_routes(db.clone(), Arc::clone(&state_arc)))
)) .merge(sessions_protected_routes(db.clone(), Arc::clone(&state_arc)))
.merge(events_protected_routes(db.clone())) .layer(from_fn(auth_middleware)),
.merge(testimonials_protected_routes(db.clone())) );
.merge(mentors_protected_routes(db.clone(), Arc::clone(&state_arc)))
.merge(sessions_protected_routes( let gacha_routes = gacha_router(db.clone(), Arc::clone(&state_arc))
db.clone(),
Arc::clone(&state_arc),
))
.nest("/gacha", gacha_router(db.clone(), Arc::clone(&state_arc)))
.layer(from_fn(auth_middleware)); .layer(from_fn(auth_middleware));
Router::new() Router::new()
.route("/", get(Redirect::to("/docs"))) .route("/", get(Redirect::to("/docs")))
.nest("/v1", public_routes.merge(protected_routes)) .nest("/v1/iam", iam_routes)
.nest( .nest("/v1/landing/cms", cms_routes)
"/v1/hackathon", .nest("/v1/dimentorin", dimentorin_routes)
hackathon_router(db.clone(), minio), .nest("/v1/gacha", gacha_routes)
) .nest("/v1/hackathon", hackathon_router(db.clone(), minio))
.nest("/v1/qr", qr_router(db.clone())) .nest("/v1/qr", qr_router(db.clone()))
.merge(SwaggerUi::new("/docs").url("/openapi.json", docs_router())) .merge(SwaggerUi::new("/docs").url("/openapi.json", docs_router()))
.layer(cors_middleware()) .layer(cors_middleware())
@@ -41,7 +41,7 @@ fn login_resp_to_dto(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/login", path = "/v1/iam/auth/login",
request_body = AuthLoginRequestDto, request_body = AuthLoginRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Login successful"), (status = 200, description = "[PUBLIC] Login successful"),
@@ -63,7 +63,7 @@ pub async fn post_login(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/login-mentor", path = "/v1/iam/auth/login-mentor",
request_body = AuthLoginRequestDto, request_body = AuthLoginRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Mentor login successful"), (status = 200, description = "[PUBLIC] Mentor login successful"),
@@ -86,7 +86,7 @@ pub async fn post_login_mentor(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/register", path = "/v1/iam/auth/register",
request_body = AuthRegisterRequestDto, request_body = AuthRegisterRequestDto,
responses( responses(
(status = 201, description = "[PUBLIC] Register successful"), (status = 201, description = "[PUBLIC] Register successful"),
@@ -110,7 +110,7 @@ pub async fn post_register(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/verify-email", path = "/v1/iam/auth/verify-email",
request_body = AuthVerifyEmailRequestDto, request_body = AuthVerifyEmailRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Verify email successful"), (status = 200, description = "[PUBLIC] Verify email successful"),
@@ -132,7 +132,7 @@ pub async fn post_verify_email(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/send-otp", path = "/v1/iam/auth/send-otp",
request_body = AuthResendOtpRequestDto, request_body = AuthResendOtpRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Resend OTP successful"), (status = 200, description = "[PUBLIC] Resend OTP successful"),
@@ -153,7 +153,7 @@ pub async fn post_resend_otp(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/forgot", path = "/v1/iam/auth/forgot",
request_body = AuthResendOtpRequestDto, request_body = AuthResendOtpRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Forgot password request successful") (status = 200, description = "[PUBLIC] Forgot password request successful")
@@ -175,7 +175,7 @@ pub async fn post_forgot_password(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/new-password", path = "/v1/iam/auth/new-password",
request_body = AuthNewPasswordRequestDto, request_body = AuthNewPasswordRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] New password set successfully"), (status = 200, description = "[PUBLIC] New password set successfully"),
@@ -197,7 +197,7 @@ pub async fn post_new_password(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/auth/refresh", path = "/v1/iam/auth/refresh",
request_body = AuthRefreshTokenRequestDto, request_body = AuthRefreshTokenRequestDto,
responses( responses(
(status = 200, description = "[PUBLIC] Refresh token successful"), (status = 200, description = "[PUBLIC] Refresh token successful"),
@@ -18,7 +18,7 @@ use std::sync::Arc;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/permissions", path = "/v1/iam/permissions",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
("page" = Option<i64>, Query, description = "Page number"), ("page" = Option<i64>, Query, description = "Page number"),
@@ -56,7 +56,7 @@ pub async fn get_permission_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/permissions/detail/{id}", path = "/v1/iam/permissions/detail/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")), params(("id" = String, Path, description = "Permission ID")),
responses( responses(
@@ -78,7 +78,7 @@ pub async fn get_permission_by_id(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/permissions/create", path = "/v1/iam/permissions/create",
security(("Bearer" = [])), security(("Bearer" = [])),
request_body = PermissionsCreateRequestDto, request_body = PermissionsCreateRequestDto,
responses( responses(
@@ -100,7 +100,7 @@ pub async fn post_create_permission(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/permissions/update/{id}", path = "/v1/iam/permissions/update/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")), params(("id" = String, Path, description = "Permission ID")),
request_body = PermissionsUpdateRequestDto, request_body = PermissionsUpdateRequestDto,
@@ -129,7 +129,7 @@ pub async fn put_update_permission(
#[utoipa::path( #[utoipa::path(
delete, delete,
path = "/v1/permissions/delete/{id}", path = "/v1/iam/permissions/delete/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")), params(("id" = String, Path, description = "Permission ID")),
responses( responses(
@@ -18,7 +18,7 @@ use std::sync::Arc;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/roles", path = "/v1/iam/roles",
security(("Bearer" = [])), security(("Bearer" = [])),
params( params(
("page" = Option<i64>, Query, description = "Page number"), ("page" = Option<i64>, Query, description = "Page number"),
@@ -56,7 +56,7 @@ pub async fn get_role_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/roles/detail/{id}", path = "/v1/iam/roles/detail/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")), params(("id" = String, Path, description = "Role ID")),
responses( responses(
@@ -78,7 +78,7 @@ pub async fn get_role_by_id(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/roles/create", path = "/v1/iam/roles/create",
security(("Bearer" = [])), security(("Bearer" = [])),
request_body = RolesCreateRequestDto, request_body = RolesCreateRequestDto,
responses( responses(
@@ -100,7 +100,7 @@ pub async fn post_create_role(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/roles/update/{id}", path = "/v1/iam/roles/update/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")), params(("id" = String, Path, description = "Role ID")),
request_body = RolesUpdateRequestDto, request_body = RolesUpdateRequestDto,
@@ -126,7 +126,7 @@ pub async fn put_update_role(
#[utoipa::path( #[utoipa::path(
delete, delete,
path = "/v1/roles/delete/{id}", path = "/v1/iam/roles/delete/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")), params(("id" = String, Path, description = "Role ID")),
responses( responses(
@@ -52,7 +52,7 @@ pub async fn get_user_list(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/users/detail/{id}", path = "/v1/iam/users/detail/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")), params(("id" = String, Path, description = "User ID")),
responses( responses(
@@ -80,7 +80,7 @@ pub async fn get_user_by_id(
#[utoipa::path( #[utoipa::path(
get, get,
path = "/v1/users/me", path = "/v1/iam/users/me",
security(("Bearer" = [])), security(("Bearer" = [])),
responses( responses(
(status = 200, description = "[USER] Get current user", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[USER] Get current user", body = ResponseSuccessDto<UsersDetailItemDto>)
@@ -15,7 +15,7 @@ use uuid::Uuid;
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/users/create", path = "/v1/iam/users/create",
security(("Bearer" = [])), security(("Bearer" = [])),
request_body = UsersCreateRequestDto, request_body = UsersCreateRequestDto,
responses( responses(
@@ -54,7 +54,7 @@ pub async fn post_create_user(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/users/update/{id}", path = "/v1/iam/users/update/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")), params(("id" = String, Path, description = "User ID")),
request_body = UsersUpdateRequestDto, request_body = UsersUpdateRequestDto,
@@ -108,7 +108,7 @@ pub async fn put_update_user(
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/users/activate/{id}", path = "/v1/iam/users/activate/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")), params(("id" = String, Path, description = "User ID")),
request_body = UsersActiveInactiveRequestDto, request_body = UsersActiveInactiveRequestDto,
@@ -135,7 +135,7 @@ pub async fn patch_user_active_status(
#[utoipa::path( #[utoipa::path(
delete, delete,
path = "/v1/users/delete/{id}", path = "/v1/iam/users/delete/{id}",
security(("Bearer" = [])), security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")), params(("id" = String, Path, description = "User ID")),
responses( responses(
@@ -16,7 +16,7 @@ use tracing::error;
#[utoipa::path( #[utoipa::path(
put, put,
path = "/v1/users/update/me", path = "/v1/iam/users/update/me",
security(("Bearer" = [])), security(("Bearer" = [])),
request_body = UsersUpdateRequestDto, request_body = UsersUpdateRequestDto,
responses( responses(
@@ -70,7 +70,7 @@ pub async fn put_update_user_me(
#[utoipa::path( #[utoipa::path(
post, post,
path = "/v1/users/upload", path = "/v1/iam/users/upload",
security(("Bearer" = [])), security(("Bearer" = [])),
request_body( request_body(
content = super::super::dto::FileUploadSchema, content = super::super::dto::FileUploadSchema,