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
@@ -41,7 +41,7 @@ fn login_resp_to_dto(
#[utoipa::path(
post,
path = "/v1/auth/login",
path = "/v1/iam/auth/login",
request_body = AuthLoginRequestDto,
responses(
(status = 200, description = "[PUBLIC] Login successful"),
@@ -63,7 +63,7 @@ pub async fn post_login(
#[utoipa::path(
post,
path = "/v1/auth/login-mentor",
path = "/v1/iam/auth/login-mentor",
request_body = AuthLoginRequestDto,
responses(
(status = 200, description = "[PUBLIC] Mentor login successful"),
@@ -86,7 +86,7 @@ pub async fn post_login_mentor(
#[utoipa::path(
post,
path = "/v1/auth/register",
path = "/v1/iam/auth/register",
request_body = AuthRegisterRequestDto,
responses(
(status = 201, description = "[PUBLIC] Register successful"),
@@ -110,7 +110,7 @@ pub async fn post_register(
#[utoipa::path(
post,
path = "/v1/auth/verify-email",
path = "/v1/iam/auth/verify-email",
request_body = AuthVerifyEmailRequestDto,
responses(
(status = 200, description = "[PUBLIC] Verify email successful"),
@@ -132,7 +132,7 @@ pub async fn post_verify_email(
#[utoipa::path(
post,
path = "/v1/auth/send-otp",
path = "/v1/iam/auth/send-otp",
request_body = AuthResendOtpRequestDto,
responses(
(status = 200, description = "[PUBLIC] Resend OTP successful"),
@@ -153,7 +153,7 @@ pub async fn post_resend_otp(
#[utoipa::path(
post,
path = "/v1/auth/forgot",
path = "/v1/iam/auth/forgot",
request_body = AuthResendOtpRequestDto,
responses(
(status = 200, description = "[PUBLIC] Forgot password request successful")
@@ -175,7 +175,7 @@ pub async fn post_forgot_password(
#[utoipa::path(
post,
path = "/v1/auth/new-password",
path = "/v1/iam/auth/new-password",
request_body = AuthNewPasswordRequestDto,
responses(
(status = 200, description = "[PUBLIC] New password set successfully"),
@@ -197,7 +197,7 @@ pub async fn post_new_password(
#[utoipa::path(
post,
path = "/v1/auth/refresh",
path = "/v1/iam/auth/refresh",
request_body = AuthRefreshTokenRequestDto,
responses(
(status = 200, description = "[PUBLIC] Refresh token successful"),
@@ -18,7 +18,7 @@ use std::sync::Arc;
#[utoipa::path(
get,
path = "/v1/permissions",
path = "/v1/iam/permissions",
security(("Bearer" = [])),
params(
("page" = Option<i64>, Query, description = "Page number"),
@@ -56,7 +56,7 @@ pub async fn get_permission_list(
#[utoipa::path(
get,
path = "/v1/permissions/detail/{id}",
path = "/v1/iam/permissions/detail/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")),
responses(
@@ -78,7 +78,7 @@ pub async fn get_permission_by_id(
#[utoipa::path(
post,
path = "/v1/permissions/create",
path = "/v1/iam/permissions/create",
security(("Bearer" = [])),
request_body = PermissionsCreateRequestDto,
responses(
@@ -100,7 +100,7 @@ pub async fn post_create_permission(
#[utoipa::path(
put,
path = "/v1/permissions/update/{id}",
path = "/v1/iam/permissions/update/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")),
request_body = PermissionsUpdateRequestDto,
@@ -129,7 +129,7 @@ pub async fn put_update_permission(
#[utoipa::path(
delete,
path = "/v1/permissions/delete/{id}",
path = "/v1/iam/permissions/delete/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Permission ID")),
responses(
@@ -18,7 +18,7 @@ use std::sync::Arc;
#[utoipa::path(
get,
path = "/v1/roles",
path = "/v1/iam/roles",
security(("Bearer" = [])),
params(
("page" = Option<i64>, Query, description = "Page number"),
@@ -56,7 +56,7 @@ pub async fn get_role_list(
#[utoipa::path(
get,
path = "/v1/roles/detail/{id}",
path = "/v1/iam/roles/detail/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")),
responses(
@@ -78,7 +78,7 @@ pub async fn get_role_by_id(
#[utoipa::path(
post,
path = "/v1/roles/create",
path = "/v1/iam/roles/create",
security(("Bearer" = [])),
request_body = RolesCreateRequestDto,
responses(
@@ -100,7 +100,7 @@ pub async fn post_create_role(
#[utoipa::path(
put,
path = "/v1/roles/update/{id}",
path = "/v1/iam/roles/update/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")),
request_body = RolesUpdateRequestDto,
@@ -126,7 +126,7 @@ pub async fn put_update_role(
#[utoipa::path(
delete,
path = "/v1/roles/delete/{id}",
path = "/v1/iam/roles/delete/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "Role ID")),
responses(
@@ -52,7 +52,7 @@ pub async fn get_user_list(
#[utoipa::path(
get,
path = "/v1/users/detail/{id}",
path = "/v1/iam/users/detail/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")),
responses(
@@ -80,7 +80,7 @@ pub async fn get_user_by_id(
#[utoipa::path(
get,
path = "/v1/users/me",
path = "/v1/iam/users/me",
security(("Bearer" = [])),
responses(
(status = 200, description = "[USER] Get current user", body = ResponseSuccessDto<UsersDetailItemDto>)
@@ -15,7 +15,7 @@ use uuid::Uuid;
#[utoipa::path(
post,
path = "/v1/users/create",
path = "/v1/iam/users/create",
security(("Bearer" = [])),
request_body = UsersCreateRequestDto,
responses(
@@ -54,7 +54,7 @@ pub async fn post_create_user(
#[utoipa::path(
put,
path = "/v1/users/update/{id}",
path = "/v1/iam/users/update/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")),
request_body = UsersUpdateRequestDto,
@@ -108,7 +108,7 @@ pub async fn put_update_user(
#[utoipa::path(
put,
path = "/v1/users/activate/{id}",
path = "/v1/iam/users/activate/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")),
request_body = UsersActiveInactiveRequestDto,
@@ -135,7 +135,7 @@ pub async fn patch_user_active_status(
#[utoipa::path(
delete,
path = "/v1/users/delete/{id}",
path = "/v1/iam/users/delete/{id}",
security(("Bearer" = [])),
params(("id" = String, Path, description = "User ID")),
responses(
@@ -16,7 +16,7 @@ use tracing::error;
#[utoipa::path(
put,
path = "/v1/users/update/me",
path = "/v1/iam/users/update/me",
security(("Bearer" = [])),
request_body = UsersUpdateRequestDto,
responses(
@@ -70,7 +70,7 @@ pub async fn put_update_user_me(
#[utoipa::path(
post,
path = "/v1/users/upload",
path = "/v1/iam/users/upload",
security(("Bearer" = [])),
request_body(
content = super::super::dto::FileUploadSchema,