From 8c2527d61e0b6fd855c7b6109269537c32ed2801 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Tue, 7 Oct 2025 17:45:47 +0700 Subject: [PATCH] Add access level descriptions to API responses across multiple controllers - Updated event controller to specify public and admin access levels in response descriptions. - Modified testimonials controller to indicate public access for list and detail responses. - Enhanced mentors controller with admin access labels for various responses. - Adjusted gacha claims and items controllers to reflect admin access in response descriptions. - Updated hackathon controller to clarify public and admin access levels in response messages. - Revised authentication controller to specify public access for login and registration responses. - Enhanced admin teams controller with admin access labels for team-related responses. - Updated users controller to clarify admin and user access levels in response descriptions. --- .../v1/landing/events/events_controller.rs | 10 +- .../testimonials/testimonials_controller.rs | 10 +- .../src/v1/mentors/mentors_controller.rs | 68 +++++----- .../gacha_claims/gacha_claims_controller.rs | 4 +- .../v1/gacha_items/gacha_items_controller.rs | 10 +- .../v1/gacha_rolls/gacha_rolls_controller.rs | 8 +- .../src/v1/hackathon/hackathon_controller.rs | 120 +++++++++--------- imphnen-iam/src/v1/auth/auth_controller.rs | 34 ++--- .../src/v1/teams/admin_teams_controller.rs | 14 +- imphnen-iam/src/v1/users/users_controller.rs | 24 ++-- 10 files changed, 151 insertions(+), 151 deletions(-) diff --git a/imphnen-cms/src/v1/landing/events/events_controller.rs b/imphnen-cms/src/v1/landing/events/events_controller.rs index 499d831..d293eca 100644 --- a/imphnen-cms/src/v1/landing/events/events_controller.rs +++ b/imphnen-cms/src/v1/landing/events/events_controller.rs @@ -27,7 +27,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard}; ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Get event list", body = ResponseListSuccessDto>) + (status = 200, description = "[PUBLIC] Get event list", body = ResponseListSuccessDto>) ), tag = "Events" )] @@ -45,7 +45,7 @@ pub async fn get_event_list( ("id" = String, Path, description = "Event ID") ), responses( - (status = 200, description = "Get event by ID", body = ResponseSuccessDto) + (status = 200, description = "[PUBLIC] Get event by ID", body = ResponseSuccessDto) ), tag = "Events" )] @@ -64,7 +64,7 @@ pub async fn get_event_by_id( path = "/v1/cms/landing/events/create", request_body = EventsCreateRequestDto, responses( - (status = 201, description = "Create new event", body = MessageResponseDto) + (status = 201, description = "[ADMIN] Create new event", body = MessageResponseDto) ), tag = "Events" )] @@ -90,7 +90,7 @@ pub async fn post_create_event( ), request_body = EventsUpdateRequestDto, responses( - (status = 200, description = "Update event", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Update event", body = MessageResponseDto) ), tag = "Events" )] @@ -116,7 +116,7 @@ pub async fn patch_update_event( ("id" = String, Path, description = "Event ID") ), responses( - (status = 200, description = "Soft delete event", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Soft delete event", body = MessageResponseDto) ), tag = "Events" )] diff --git a/imphnen-cms/src/v1/landing/testimonials/testimonials_controller.rs b/imphnen-cms/src/v1/landing/testimonials/testimonials_controller.rs index c279b58..03181b8 100644 --- a/imphnen-cms/src/v1/landing/testimonials/testimonials_controller.rs +++ b/imphnen-cms/src/v1/landing/testimonials/testimonials_controller.rs @@ -28,7 +28,7 @@ use imphnen_iam::permissions_guard; ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Get testimonial list", body = ResponseListSuccessDto>) + (status = 200, description = "[PUBLIC] Get testimonial list", body = ResponseListSuccessDto>) ), tag = "Testimonials" )] @@ -46,7 +46,7 @@ pub async fn get_testimonial_list( ("id" = String, Path, description = "Testimonial ID") ), responses( - (status = 200, description = "Get testimonial by ID", body = ResponseSuccessDto) + (status = 200, description = "[PUBLIC] Get testimonial by ID", body = ResponseSuccessDto) ), tag = "Testimonials" )] @@ -65,7 +65,7 @@ pub async fn get_testimonial_by_id( path = "/v1/cms/landing/testimonials/create", request_body = TestimonialsCreateRequestDto, responses( - (status = 201, description = "Create new testimonial", body = MessageResponseDto) + (status = 201, description = "[USER] Create new testimonial", body = MessageResponseDto) ), tag = "Testimonials" )] @@ -92,7 +92,7 @@ pub async fn post_create_testimonial( ), request_body = TestimonialsUpdateRequestDto, responses( - (status = 200, description = "Update testimonial", body = MessageResponseDto) + (status = 200, description = "[USER] Update testimonial", body = MessageResponseDto) ), tag = "Testimonials" )] @@ -119,7 +119,7 @@ pub async fn patch_update_testimonial( ("id" = String, Path, description = "Testimonial ID") ), responses( - (status = 200, description = "Soft delete testimonial", body = MessageResponseDto) + (status = 200, description = "[USER] Soft delete testimonial", body = MessageResponseDto) ), tag = "Testimonials" )] diff --git a/imphnen-dimentorin/src/v1/mentors/mentors_controller.rs b/imphnen-dimentorin/src/v1/mentors/mentors_controller.rs index 5132941..da8c8bf 100644 --- a/imphnen-dimentorin/src/v1/mentors/mentors_controller.rs +++ b/imphnen-dimentorin/src/v1/mentors/mentors_controller.rs @@ -18,10 +18,10 @@ use imphnen_utils::extract_email; path = "/v1/mentors/register", request_body = MentorUserRegisterRequestDto, responses( - (status = 200, description = "Mentor registered successfully", body = MentorRegisterResponseDto), - (status = 400, description = "Bad request - validation error"), - (status = 409, description = "Conflict - user already has mentor profile"), - (status = 500, description = "Internal server error") + (status = 200, description = "[PUBLIC] Mentor registered successfully", body = MentorRegisterResponseDto), + (status = 400, description = "[PUBLIC] Bad request - validation error"), + (status = 409, description = "[PUBLIC] Conflict - user already has mentor profile"), + (status = 500, description = "[PUBLIC] Internal server error") ), tag = "Mentors" )] @@ -43,8 +43,8 @@ pub async fn post_register_mentor( ("order" = Option, Query, description = "Sort order (ASC/DESC)"), ), responses( - (status = 200, description = "Get list of mentors", body = Vec), - (status = 500, description = "Internal server error") + (status = 200, description = "[ADMIN] Get list of mentors", body = Vec), + (status = 500, description = "[ADMIN] Internal server error") ), tag = "Mentors", security( @@ -75,9 +75,9 @@ pub async fn get_mentor_list( ("id" = String, Path, description = "Mentor ID") ), responses( - (status = 200, description = "Get mentor by ID", body = MentorDetailResponseDto), - (status = 404, description = "Mentor not found"), - (status = 500, description = "Internal server error") + (status = 200, description = "[ADMIN] Get mentor by ID", body = MentorDetailResponseDto), + (status = 404, description = "[ADMIN] Mentor not found"), + (status = 500, description = "[ADMIN] Internal server error") ), tag = "Mentors", security( @@ -109,10 +109,10 @@ pub async fn get_mentor_by_id( ), request_body = MentorUpdateRequestDto, responses( - (status = 200, description = "Mentor updated successfully", body = MentorDetailResponseDto), - (status = 400, description = "Bad request - validation error"), - (status = 404, description = "Mentor not found"), - (status = 500, description = "Internal server error") + (status = 200, description = "[ADMIN] Mentor updated successfully", body = MentorDetailResponseDto), + (status = 400, description = "[ADMIN] Bad request - validation error"), + (status = 404, description = "[ADMIN] Mentor not found"), + (status = 500, description = "[ADMIN] Internal server error") ), tag = "Mentors - Admin", security( @@ -144,9 +144,9 @@ pub async fn put_update_mentor( ("id" = String, Path, description = "Mentor ID") ), responses( - (status = 200, description = "Mentor deleted successfully"), - (status = 404, description = "Mentor not found"), - (status = 500, description = "Internal server error") + (status = 200, description = "[ADMIN] Mentor deleted successfully"), + (status = 404, description = "[ADMIN] Mentor not found"), + (status = 500, description = "[ADMIN] Internal server error") ), tag = "Mentors - Admin", security( @@ -178,10 +178,10 @@ pub async fn delete_mentor( ), request_body = MentorVerifyRequestDto, responses( - (status = 200, description = "Mentor verified successfully", body = MentorDetailResponseDto), - (status = 400, description = "Bad request - validation error"), - (status = 404, description = "Mentor not found"), - (status = 500, description = "Internal server error") + (status = 200, description = "[ADMIN] Mentor verified successfully", body = MentorDetailResponseDto), + (status = 400, description = "[ADMIN] Bad request - validation error"), + (status = 404, description = "[ADMIN] Mentor not found"), + (status = 500, description = "[ADMIN] Internal server error") ), tag = "Mentors - Admin", security( @@ -210,10 +210,10 @@ pub async fn put_verify_mentor( get, path = "/v1/mentors/me", responses( - (status = 200, description = "Current user's mentor profile", body = MentorDetailResponseDto), - (status = 401, description = "Unauthorized - invalid token"), - (status = 403, description = "Mentor profile not found for current user"), - (status = 500, description = "Internal server error") + (status = 200, description = "[MENTOR] Current user's mentor profile", body = MentorDetailResponseDto), + (status = 401, description = "[MENTOR] Unauthorized - invalid token"), + (status = 403, description = "[MENTOR] Mentor profile not found for current user"), + (status = 500, description = "[MENTOR] Internal server error") ), tag = "Mentors", security( @@ -252,11 +252,11 @@ pub async fn get_mentor_me( path = "/v1/mentors/update/me", request_body = MentorUpdateRequestDto, responses( - (status = 200, description = "Mentor profile updated successfully", body = MentorDetailResponseDto), - (status = 400, description = "Bad request - validation error"), - (status = 401, description = "Unauthorized - invalid token"), - (status = 404, description = "Mentor profile not found"), - (status = 500, description = "Internal server error") + (status = 200, description = "[MENTOR] Mentor profile updated successfully", body = MentorDetailResponseDto), + (status = 400, description = "[MENTOR] Bad request - validation error"), + (status = 401, description = "[MENTOR] Unauthorized - invalid token"), + (status = 404, description = "[MENTOR] Mentor profile not found"), + (status = 500, description = "[MENTOR] Internal server error") ), tag = "Mentors", security( @@ -295,7 +295,7 @@ pub async fn put_update_mentor_me( path = "/v1/mentors/update", request_body = MentorUpdateRequestDto, responses( - (status = 400, description = "Bad request - Mentor ID is required for update"), + (status = 400, description = "[PUBLIC] Bad request - Mentor ID is required for update"), ), tag = "Mentors - Admin" )] @@ -310,10 +310,10 @@ pub async fn put_update_mentor_no_id() -> Response { get, path = "/v1/mentors/status", responses( - (status = 200, description = "Mentor application status", body = String), - (status = 401, description = "Unauthorized - invalid token"), - (status = 403, description = "No mentor application found for current user"), - (status = 500, description = "Internal server error") + (status = 200, description = "[MENTOR] Mentor application status", body = String), + (status = 401, description = "[MENTOR] Unauthorized - invalid token"), + (status = 403, description = "[MENTOR] No mentor application found for current user"), + (status = 500, description = "[MENTOR] Internal server error") ), tag = "Mentors", security( diff --git a/imphnen-gacha/src/v1/gacha_claims/gacha_claims_controller.rs b/imphnen-gacha/src/v1/gacha_claims/gacha_claims_controller.rs index 96c89dc..a287eb2 100644 --- a/imphnen-gacha/src/v1/gacha_claims/gacha_claims_controller.rs +++ b/imphnen-gacha/src/v1/gacha_claims/gacha_claims_controller.rs @@ -15,7 +15,7 @@ use crate::v1::gacha_claims::{GachaClaimItemDto, GachaClaimRequestDto, GachaClai ), params(("id" = String, Path, description = "Gacha Claim ID")), responses( - (status = 200, description = "Get Gacha Claim by ID", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Get Gacha Claim by ID", body = ResponseSuccessDto) ), tag = "Gacha" )] @@ -44,7 +44,7 @@ pub async fn get_detail_gacha_claim( path = "/v1/gacha/claims/create", request_body = GachaClaimRequestDto, responses( - (status = 201, description = "Create new gacha claim", body = MessageResponseDto) + (status = 201, description = "[ADMIN] Create new gacha claim", body = MessageResponseDto) ), tag = "Gacha" )] diff --git a/imphnen-gacha/src/v1/gacha_items/gacha_items_controller.rs b/imphnen-gacha/src/v1/gacha_items/gacha_items_controller.rs index 760bdd2..dc06e56 100644 --- a/imphnen-gacha/src/v1/gacha_items/gacha_items_controller.rs +++ b/imphnen-gacha/src/v1/gacha_items/gacha_items_controller.rs @@ -27,7 +27,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard}; ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Get gacha item list", body = ResponseListSuccessDto>) + (status = 200, description = "[ADMIN] Get gacha item list", body = ResponseListSuccessDto>) ), tag = "Gacha" )] @@ -56,7 +56,7 @@ pub async fn get_gacha_item_list( ), params(("id" = String, Path, description = "Gacha Item ID")), responses( - (status = 200, description = "Get gacha item by ID", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Get gacha item by ID", body = ResponseSuccessDto) ), tag = "Gacha" )] @@ -85,7 +85,7 @@ pub async fn get_gacha_item_by_id( ), request_body = GachaItemRequestDto, responses( - (status = 201, description = "Create gacha item", body = MessageResponseDto) + (status = 201, description = "[ADMIN] Create gacha item", body = MessageResponseDto) ), tag = "Gacha" )] @@ -114,7 +114,7 @@ pub async fn post_create_gacha_item( ), request_body = GachaItemUpdateRequestDto, responses( - (status = 200, description = "Update gacha item", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Update gacha item", body = MessageResponseDto) ), tag = "Gacha" )] @@ -143,7 +143,7 @@ pub async fn put_update_gacha_item( ("Bearer" = []) ), responses( - (status = 200, description = "Delete gacha item", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Delete gacha item", body = MessageResponseDto) ), tag = "Gacha" )] diff --git a/imphnen-gacha/src/v1/gacha_rolls/gacha_rolls_controller.rs b/imphnen-gacha/src/v1/gacha_rolls/gacha_rolls_controller.rs index 9485e25..f2fe24b 100644 --- a/imphnen-gacha/src/v1/gacha_rolls/gacha_rolls_controller.rs +++ b/imphnen-gacha/src/v1/gacha_rolls/gacha_rolls_controller.rs @@ -15,7 +15,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard}; ), params(("id" = String, Path, description = "Gacha Roll ID")), responses( - (status = 200, description = "Get Gacha Roll by ID", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Get Gacha Roll by ID", body = ResponseSuccessDto) ), tag = "Gacha" )] @@ -44,7 +44,7 @@ pub async fn get_detail_gacha_roll( ), request_body = GachaRollRequestDto, responses( - (status = 201, description = "Create new gacha roll", body = MessageResponseDto) + (status = 201, description = "[ADMIN] Create new gacha roll", body = MessageResponseDto) ), tag = "Gacha" )] @@ -72,7 +72,7 @@ pub async fn post_create_gacha_roll( ("Bearer" = []) ), responses( - (status = 200, description = "Execute and get 1 gacha result", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Execute and get 1 gacha result", body = ResponseSuccessDto) ), tag = "Gacha" )] @@ -100,7 +100,7 @@ pub async fn post_execute_gacha_roll( ), params(("id" = String, Path, description = "Gacha Roll ID")), responses( - (status = 200, description = "Delete Gacha Roll (soft delete)", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Delete Gacha Roll (soft delete)", body = MessageResponseDto) ), tag = "Gacha" )] diff --git a/imphnen-hackathon/src/v1/hackathon/hackathon_controller.rs b/imphnen-hackathon/src/v1/hackathon/hackathon_controller.rs index 4b1d039..afe1d99 100644 --- a/imphnen-hackathon/src/v1/hackathon/hackathon_controller.rs +++ b/imphnen-hackathon/src/v1/hackathon/hackathon_controller.rs @@ -26,9 +26,9 @@ use imphnen_iam::{PermissionsEnum, permissions_guard}; path = "/v1/hackathons", request_body = HackathonCreateRequestDto, responses( - (status = 201, description = "Hackathon created successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 201, description = "[ADMIN] Hackathon created successfully", body = ResponseSuccessDto), + (status = 400, description = "[ADMIN] Bad request", body = ErrorDto), + (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto) ), tag = "Hackathons" )] @@ -53,9 +53,9 @@ pub async fn create_hackathon( ("id" = String, Path, description = "Hackathon ID") ), responses( - (status = 200, description = "Hackathon retrieved successfully", body = ResponseSuccessDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Hackathon retrieved successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathons" )] @@ -82,8 +82,8 @@ pub async fn get_hackathon( ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Hackathons retrieved successfully", body = ResponseListSuccessDto>), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Hackathons retrieved successfully", body = ResponseListSuccessDto>), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathons" )] @@ -108,10 +108,10 @@ pub async fn list_hackathons( ), request_body = HackathonUpdateRequestDto, responses( - (status = 200, description = "Hackathon updated successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[ADMIN] Hackathon updated successfully", body = ResponseSuccessDto), + (status = 400, description = "[ADMIN] Bad request", body = ErrorDto), + (status = 404, description = "[ADMIN] Hackathon not found", body = ErrorDto), + (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto) ), tag = "Hackathons" )] @@ -140,9 +140,9 @@ pub async fn update_hackathon( ("id" = String, Path, description = "Hackathon ID") ), responses( - (status = 200, description = "Hackathon deleted successfully", body = ResponseSuccessDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[ADMIN] Hackathon deleted successfully", body = ResponseSuccessDto), + (status = 404, description = "[ADMIN] Hackathon not found", body = ErrorDto), + (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto) ), tag = "Hackathons" )] @@ -169,10 +169,10 @@ pub async fn delete_hackathon( ), request_body = HackathonEventCreateRequestDto, responses( - (status = 201, description = "Event created successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 201, description = "[PUBLIC] Event created successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Events" )] @@ -201,8 +201,8 @@ pub async fn create_hackathon_event( ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Events retrieved successfully", body = ResponseListSuccessDto>), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Events retrieved successfully", body = ResponseListSuccessDto>), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Events" )] @@ -225,10 +225,10 @@ pub async fn list_hackathon_events( ), request_body = HackathonEventUpdateRequestDto, responses( - (status = 200, description = "Event updated successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Event not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Event updated successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Event not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Events" )] @@ -250,9 +250,9 @@ pub async fn update_hackathon_event( ("id" = String, Path, description = "Event ID") ), responses( - (status = 200, description = "Event deleted successfully", body = ResponseSuccessDto), - (status = 404, description = "Event not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Event deleted successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Event not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Events" )] @@ -275,10 +275,10 @@ pub async fn delete_hackathon_event( ), request_body = HackathonTimelineCreateRequestDto, responses( - (status = 201, description = "Timeline created successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 201, description = "[PUBLIC] Timeline created successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Timeline" )] @@ -307,8 +307,8 @@ pub async fn create_hackathon_timeline( ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Timeline retrieved successfully", body = ResponseListSuccessDto>), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Timeline retrieved successfully", body = ResponseListSuccessDto>), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Timeline" )] @@ -331,10 +331,10 @@ pub async fn list_hackathon_timeline( ), request_body = HackathonTimelineUpdateRequestDto, responses( - (status = 200, description = "Timeline updated successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Timeline not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Timeline updated successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Timeline not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Timeline" )] @@ -356,9 +356,9 @@ pub async fn update_hackathon_timeline( ("id" = String, Path, description = "Timeline ID") ), responses( - (status = 200, description = "Timeline deleted successfully", body = ResponseSuccessDto), - (status = 404, description = "Timeline not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Timeline deleted successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Timeline not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Timeline" )] @@ -382,10 +382,10 @@ pub async fn delete_hackathon_timeline( ), request_body = HackathonSubmissionCreateRequestDto, responses( - (status = 201, description = "Submission created successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Hackathon not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 201, description = "[PUBLIC] Submission created successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] @@ -414,8 +414,8 @@ pub async fn create_hackathon_submission( ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Submissions retrieved successfully", body = ResponseListSuccessDto>), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Submissions retrieved successfully", body = ResponseListSuccessDto>), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] @@ -437,9 +437,9 @@ pub async fn list_hackathon_submissions( ("id" = String, Path, description = "Submission ID") ), responses( - (status = 200, description = "Submission retrieved successfully", body = ResponseSuccessDto), - (status = 404, description = "Submission not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Submission retrieved successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] @@ -461,10 +461,10 @@ pub async fn get_hackathon_submission( ), request_body = HackathonSubmissionUpdateRequestDto, responses( - (status = 200, description = "Submission updated successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request", body = ErrorDto), - (status = 404, description = "Submission not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Submission updated successfully", body = ResponseSuccessDto), + (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto), + (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] @@ -486,9 +486,9 @@ pub async fn update_hackathon_submission( ("id" = String, Path, description = "Submission ID") ), responses( - (status = 200, description = "Submission submitted successfully", body = ResponseSuccessDto), - (status = 404, description = "Submission not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Submission submitted successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] @@ -509,9 +509,9 @@ pub async fn submit_hackathon_submission( ("id" = String, Path, description = "Submission ID") ), responses( - (status = 200, description = "Submission deleted successfully", body = ResponseSuccessDto), - (status = 404, description = "Submission not found", body = ErrorDto), - (status = 500, description = "Internal server error", body = ErrorDto) + (status = 200, description = "[PUBLIC] Submission deleted successfully", body = ResponseSuccessDto), + (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto), + (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto) ), tag = "Hackathon Submissions" )] diff --git a/imphnen-iam/src/v1/auth/auth_controller.rs b/imphnen-iam/src/v1/auth/auth_controller.rs index fced3be..fd123e5 100644 --- a/imphnen-iam/src/v1/auth/auth_controller.rs +++ b/imphnen-iam/src/v1/auth/auth_controller.rs @@ -13,8 +13,8 @@ use crate::v1::auth::auth_service::AuthService; path = "/v1/auth/login", request_body = AuthLoginRequestDto, responses( - (status = 200, description = "Login successful", body = ResponseSuccessDto), - (status = 401, description = "Login failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Login successful", body = ResponseSuccessDto), + (status = 401, description = "[PUBLIC] Login failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -30,9 +30,9 @@ pub async fn post_login( path = "/v1/auth/login-mentor", request_body = AuthLoginRequestDto, responses( - (status = 200, description = "Mentor login successful", body = ResponseSuccessDto), - (status = 401, description = "Mentor login failed", body = MessageResponseDto), - (status = 403, description = "Forbidden - Not a mentor", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Mentor login successful", body = ResponseSuccessDto), + (status = 401, description = "[PUBLIC] Mentor login failed", body = MessageResponseDto), + (status = 403, description = "[PUBLIC] Forbidden - Not a mentor", body = MessageResponseDto) ), tag = "Authentication" )] @@ -48,8 +48,8 @@ pub async fn post_login_mentor( path = "/v1/auth/register", request_body = AuthRegisterRequestDto, responses( - (status = 200, description = "Register successful", body = MessageResponseDto), - (status = 401, description = "Register failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Register successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] Register failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -65,8 +65,8 @@ pub async fn post_register( path = "/v1/auth/verify-email", request_body = AuthVerifyEmailRequestDto, responses( - (status = 200, description = "Verify email successful", body = MessageResponseDto), - (status = 401, description = "Verify email failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Verify email successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] Verify email failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -82,8 +82,8 @@ pub async fn post_verify_email( path = "/v1/auth/send-otp", request_body = AuthResendOtpRequestDto, responses( - (status = 200, description = "Resend otp successful", body = MessageResponseDto), - (status = 401, description = "Resend otp failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Resend otp successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] Resend otp failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -99,8 +99,8 @@ pub async fn post_resend_otp( path = "/v1/auth/forgot", request_body = AuthResendOtpRequestDto, responses( - (status = 200, description = "Forgot password request successful", body = MessageResponseDto), - (status = 401, description = "Forgot password request failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Forgot password request successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] Forgot password request failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -116,8 +116,8 @@ pub async fn post_forgot_password( path = "/v1/auth/new-password", request_body = AuthNewPasswordRequestDto, responses( - (status = 200, description = "New password request successful", body = MessageResponseDto), - (status = 401, description = "New password request failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] New password request successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] New password request failed", body = MessageResponseDto) ), tag = "Authentication" )] @@ -133,8 +133,8 @@ pub async fn post_new_password( path = "/v1/auth/refresh", request_body = AuthRefreshTokenRequestDto, responses( - (status = 200, description = "Refresh token request successful", body = MessageResponseDto), - (status = 401, description = "Refresh token request failed", body = MessageResponseDto) + (status = 200, description = "[PUBLIC] Refresh token request successful", body = MessageResponseDto), + (status = 401, description = "[PUBLIC] Refresh token request failed", body = MessageResponseDto) ), tag = "Authentication" )] diff --git a/imphnen-iam/src/v1/teams/admin_teams_controller.rs b/imphnen-iam/src/v1/teams/admin_teams_controller.rs index 750beee..5c76ee9 100644 --- a/imphnen-iam/src/v1/teams/admin_teams_controller.rs +++ b/imphnen-iam/src/v1/teams/admin_teams_controller.rs @@ -44,7 +44,7 @@ where ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Get all teams (admin)", body = ResponseListSuccessDto>) + (status = 200, description = "[ADMIN] Get all teams (admin)", body = ResponseListSuccessDto>) ), tag = "Admin - Teams" )] @@ -68,7 +68,7 @@ pub async fn get_all_teams( ("id" = String, Path, description = "Team ID") ), responses( - (status = 200, description = "Get team by ID (admin)", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Get team by ID (admin)", body = ResponseSuccessDto) ), tag = "Admin - Teams" )] @@ -92,7 +92,7 @@ pub async fn get_team_by_id( ("id" = String, Path, description = "Team ID") ), responses( - (status = 200, description = "Get team members (admin)", body = ResponseSuccessDto>) + (status = 200, description = "[ADMIN] Get team members (admin)", body = ResponseSuccessDto>) ), tag = "Admin - Teams" )] @@ -114,7 +114,7 @@ pub async fn get_team_members( path = "/", request_body = TeamsCreateRequestDto, responses( - (status = 200, description = "Create team (admin)", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Create team (admin)", body = ResponseSuccessDto) ), tag = "Admin - Teams" )] @@ -139,7 +139,7 @@ pub async fn create_team( ), request_body = TeamsUpdateRequestDto, responses( - (status = 200, description = "Update team (admin)", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Update team (admin)", body = MessageResponseDto) ), tag = "Admin - Teams" )] @@ -164,7 +164,7 @@ pub async fn update_team( ("id" = String, Path, description = "Team ID") ), responses( - (status = 200, description = "Delete team (admin)", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Delete team (admin)", body = MessageResponseDto) ), tag = "Admin - Teams" )] @@ -189,7 +189,7 @@ pub async fn delete_team( ), request_body = TeamInviteRequestDto, responses( - (status = 200, description = "Invite team members (admin)", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Invite team members (admin)", body = ResponseSuccessDto) ), tag = "Admin - Teams" )] diff --git a/imphnen-iam/src/v1/users/users_controller.rs b/imphnen-iam/src/v1/users/users_controller.rs index f224965..1061fb6 100644 --- a/imphnen-iam/src/v1/users/users_controller.rs +++ b/imphnen-iam/src/v1/users/users_controller.rs @@ -39,7 +39,7 @@ pub struct FileUploadSchema { ("filter_by" = Option, Query, description = "Field to filter by"), ), responses( - (status = 200, description = "Get user list", body = ResponseListSuccessDto>) + (status = 200, description = "[ADMIN] Get user list", body = ResponseListSuccessDto>) ), tag = "Users" )] @@ -70,7 +70,7 @@ params( ("id" = String, Path, description = "User ID") ), responses( - (status = 200, description = "Get user by ID", body = ResponseSuccessDto) + (status = 200, description = "[USER] Get user by ID", body = ResponseSuccessDto) ), tag = "Users" )] @@ -98,7 +98,7 @@ security( ), path = "/v1/users/me", responses( - (status = 200, description = "Get user by ID", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Get user by ID", body = ResponseSuccessDto) ), tag = "Users" )] @@ -120,7 +120,7 @@ pub async fn get_user_me( path = "/v1/users/create", request_body = UsersCreateRequestDto, responses( - (status = 200, description = "Create new user", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Create new user", body = ResponseSuccessDto) ), tag = "Users" )] @@ -152,7 +152,7 @@ pub async fn post_create_user( ), request_body = UsersUpdateRequestDto, responses( - (status = 200, description = "Update user", body = ResponseSuccessDto) + (status = 200, description = "[ADMIN] Update user", body = ResponseSuccessDto) ), tag = "Users" )] @@ -182,7 +182,7 @@ pub async fn put_update_user( path = "/v1/users/update/me", request_body = UsersUpdateRequestDto, responses( - (status = 200, description = "Update current user", body = ResponseSuccessDto) + (status = 200, description = "[USER] Update current user", body = ResponseSuccessDto) ), tag = "Users" )] @@ -208,7 +208,7 @@ pub async fn put_update_user_me( ), request_body = UsersActiveInactiveRequestDto, responses( - (status = 200, description = "Set user active status", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Set user active status", body = MessageResponseDto) ), tag = "Users" )] @@ -237,7 +237,7 @@ pub async fn patch_user_active_status( ), path = "/v1/users/delete/{id}", responses( - (status = 200, description = "Soft delete user", body = MessageResponseDto) + (status = 200, description = "[ADMIN] Soft delete user", body = MessageResponseDto) ), tag = "Users" )] @@ -270,10 +270,10 @@ pub async fn delete_user( content_type = "multipart/form-data" ), responses( - (status = 200, description = "Upload file successfully", body = ResponseSuccessDto), - (status = 400, description = "Bad request"), - (status = 401, description = "Unauthorized"), - (status = 500, description = "Internal server error") + (status = 200, description = "[USER] Upload file successfully", body = ResponseSuccessDto), + (status = 400, description = "[USER] Bad request"), + (status = 401, description = "[USER] Unauthorized"), + (status = 500, description = "[USER] Internal server error") ), tag = "Users" )]