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.
This commit is contained in:
MythEclipse
2025-10-07 17:45:47 +07:00
parent 018124f7b3
commit 8c2527d61e
10 changed files with 151 additions and 151 deletions
@@ -27,7 +27,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard};
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Get event list", body = ResponseListSuccessDto<Vec<EventsListItemDto>>) (status = 200, description = "[PUBLIC] Get event list", body = ResponseListSuccessDto<Vec<EventsListItemDto>>)
), ),
tag = "Events" tag = "Events"
)] )]
@@ -45,7 +45,7 @@ pub async fn get_event_list(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
responses( responses(
(status = 200, description = "Get event by ID", body = ResponseSuccessDto<EventsDetailItemDto>) (status = 200, description = "[PUBLIC] Get event by ID", body = ResponseSuccessDto<EventsDetailItemDto>)
), ),
tag = "Events" tag = "Events"
)] )]
@@ -64,7 +64,7 @@ pub async fn get_event_by_id(
path = "/v1/cms/landing/events/create", path = "/v1/cms/landing/events/create",
request_body = EventsCreateRequestDto, request_body = EventsCreateRequestDto,
responses( responses(
(status = 201, description = "Create new event", body = MessageResponseDto) (status = 201, description = "[ADMIN] Create new event", body = MessageResponseDto)
), ),
tag = "Events" tag = "Events"
)] )]
@@ -90,7 +90,7 @@ pub async fn post_create_event(
), ),
request_body = EventsUpdateRequestDto, request_body = EventsUpdateRequestDto,
responses( responses(
(status = 200, description = "Update event", body = MessageResponseDto) (status = 200, description = "[ADMIN] Update event", body = MessageResponseDto)
), ),
tag = "Events" tag = "Events"
)] )]
@@ -116,7 +116,7 @@ pub async fn patch_update_event(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
responses( responses(
(status = 200, description = "Soft delete event", body = MessageResponseDto) (status = 200, description = "[ADMIN] Soft delete event", body = MessageResponseDto)
), ),
tag = "Events" tag = "Events"
)] )]
@@ -28,7 +28,7 @@ use imphnen_iam::permissions_guard;
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Get testimonial list", body = ResponseListSuccessDto<Vec<TestimonialsListItemDto>>) (status = 200, description = "[PUBLIC] Get testimonial list", body = ResponseListSuccessDto<Vec<TestimonialsListItemDto>>)
), ),
tag = "Testimonials" tag = "Testimonials"
)] )]
@@ -46,7 +46,7 @@ pub async fn get_testimonial_list(
("id" = String, Path, description = "Testimonial ID") ("id" = String, Path, description = "Testimonial ID")
), ),
responses( responses(
(status = 200, description = "Get testimonial by ID", body = ResponseSuccessDto<TestimonialsDetailItemDto>) (status = 200, description = "[PUBLIC] Get testimonial by ID", body = ResponseSuccessDto<TestimonialsDetailItemDto>)
), ),
tag = "Testimonials" tag = "Testimonials"
)] )]
@@ -65,7 +65,7 @@ pub async fn get_testimonial_by_id(
path = "/v1/cms/landing/testimonials/create", path = "/v1/cms/landing/testimonials/create",
request_body = TestimonialsCreateRequestDto, request_body = TestimonialsCreateRequestDto,
responses( responses(
(status = 201, description = "Create new testimonial", body = MessageResponseDto) (status = 201, description = "[USER] Create new testimonial", body = MessageResponseDto)
), ),
tag = "Testimonials" tag = "Testimonials"
)] )]
@@ -92,7 +92,7 @@ pub async fn post_create_testimonial(
), ),
request_body = TestimonialsUpdateRequestDto, request_body = TestimonialsUpdateRequestDto,
responses( responses(
(status = 200, description = "Update testimonial", body = MessageResponseDto) (status = 200, description = "[USER] Update testimonial", body = MessageResponseDto)
), ),
tag = "Testimonials" tag = "Testimonials"
)] )]
@@ -119,7 +119,7 @@ pub async fn patch_update_testimonial(
("id" = String, Path, description = "Testimonial ID") ("id" = String, Path, description = "Testimonial ID")
), ),
responses( responses(
(status = 200, description = "Soft delete testimonial", body = MessageResponseDto) (status = 200, description = "[USER] Soft delete testimonial", body = MessageResponseDto)
), ),
tag = "Testimonials" tag = "Testimonials"
)] )]
@@ -18,10 +18,10 @@ use imphnen_utils::extract_email;
path = "/v1/mentors/register", path = "/v1/mentors/register",
request_body = MentorUserRegisterRequestDto, request_body = MentorUserRegisterRequestDto,
responses( responses(
(status = 200, description = "Mentor registered successfully", body = MentorRegisterResponseDto), (status = 200, description = "[PUBLIC] Mentor registered successfully", body = MentorRegisterResponseDto),
(status = 400, description = "Bad request - validation error"), (status = 400, description = "[PUBLIC] Bad request - validation error"),
(status = 409, description = "Conflict - user already has mentor profile"), (status = 409, description = "[PUBLIC] Conflict - user already has mentor profile"),
(status = 500, description = "Internal server error") (status = 500, description = "[PUBLIC] Internal server error")
), ),
tag = "Mentors" tag = "Mentors"
)] )]
@@ -43,8 +43,8 @@ pub async fn post_register_mentor(
("order" = Option<String>, Query, description = "Sort order (ASC/DESC)"), ("order" = Option<String>, Query, description = "Sort order (ASC/DESC)"),
), ),
responses( responses(
(status = 200, description = "Get list of mentors", body = Vec<MentorListResponseDto>), (status = 200, description = "[ADMIN] Get list of mentors", body = Vec<MentorListResponseDto>),
(status = 500, description = "Internal server error") (status = 500, description = "[ADMIN] Internal server error")
), ),
tag = "Mentors", tag = "Mentors",
security( security(
@@ -75,9 +75,9 @@ pub async fn get_mentor_list(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
responses( responses(
(status = 200, description = "Get mentor by ID", body = MentorDetailResponseDto), (status = 200, description = "[ADMIN] Get mentor by ID", body = MentorDetailResponseDto),
(status = 404, description = "Mentor not found"), (status = 404, description = "[ADMIN] Mentor not found"),
(status = 500, description = "Internal server error") (status = 500, description = "[ADMIN] Internal server error")
), ),
tag = "Mentors", tag = "Mentors",
security( security(
@@ -109,10 +109,10 @@ pub async fn get_mentor_by_id(
), ),
request_body = MentorUpdateRequestDto, request_body = MentorUpdateRequestDto,
responses( responses(
(status = 200, description = "Mentor updated successfully", body = MentorDetailResponseDto), (status = 200, description = "[ADMIN] Mentor updated successfully", body = MentorDetailResponseDto),
(status = 400, description = "Bad request - validation error"), (status = 400, description = "[ADMIN] Bad request - validation error"),
(status = 404, description = "Mentor not found"), (status = 404, description = "[ADMIN] Mentor not found"),
(status = 500, description = "Internal server error") (status = 500, description = "[ADMIN] Internal server error")
), ),
tag = "Mentors - Admin", tag = "Mentors - Admin",
security( security(
@@ -144,9 +144,9 @@ pub async fn put_update_mentor(
("id" = String, Path, description = "Mentor ID") ("id" = String, Path, description = "Mentor ID")
), ),
responses( responses(
(status = 200, description = "Mentor deleted successfully"), (status = 200, description = "[ADMIN] Mentor deleted successfully"),
(status = 404, description = "Mentor not found"), (status = 404, description = "[ADMIN] Mentor not found"),
(status = 500, description = "Internal server error") (status = 500, description = "[ADMIN] Internal server error")
), ),
tag = "Mentors - Admin", tag = "Mentors - Admin",
security( security(
@@ -178,10 +178,10 @@ pub async fn delete_mentor(
), ),
request_body = MentorVerifyRequestDto, request_body = MentorVerifyRequestDto,
responses( responses(
(status = 200, description = "Mentor verified successfully", body = MentorDetailResponseDto), (status = 200, description = "[ADMIN] Mentor verified successfully", body = MentorDetailResponseDto),
(status = 400, description = "Bad request - validation error"), (status = 400, description = "[ADMIN] Bad request - validation error"),
(status = 404, description = "Mentor not found"), (status = 404, description = "[ADMIN] Mentor not found"),
(status = 500, description = "Internal server error") (status = 500, description = "[ADMIN] Internal server error")
), ),
tag = "Mentors - Admin", tag = "Mentors - Admin",
security( security(
@@ -210,10 +210,10 @@ pub async fn put_verify_mentor(
get, get,
path = "/v1/mentors/me", path = "/v1/mentors/me",
responses( responses(
(status = 200, description = "Current user's mentor profile", body = MentorDetailResponseDto), (status = 200, description = "[MENTOR] Current user's mentor profile", body = MentorDetailResponseDto),
(status = 401, description = "Unauthorized - invalid token"), (status = 401, description = "[MENTOR] Unauthorized - invalid token"),
(status = 403, description = "Mentor profile not found for current user"), (status = 403, description = "[MENTOR] Mentor profile not found for current user"),
(status = 500, description = "Internal server error") (status = 500, description = "[MENTOR] Internal server error")
), ),
tag = "Mentors", tag = "Mentors",
security( security(
@@ -252,11 +252,11 @@ pub async fn get_mentor_me(
path = "/v1/mentors/update/me", path = "/v1/mentors/update/me",
request_body = MentorUpdateRequestDto, request_body = MentorUpdateRequestDto,
responses( responses(
(status = 200, description = "Mentor profile updated successfully", body = MentorDetailResponseDto), (status = 200, description = "[MENTOR] Mentor profile updated successfully", body = MentorDetailResponseDto),
(status = 400, description = "Bad request - validation error"), (status = 400, description = "[MENTOR] Bad request - validation error"),
(status = 401, description = "Unauthorized - invalid token"), (status = 401, description = "[MENTOR] Unauthorized - invalid token"),
(status = 404, description = "Mentor profile not found"), (status = 404, description = "[MENTOR] Mentor profile not found"),
(status = 500, description = "Internal server error") (status = 500, description = "[MENTOR] Internal server error")
), ),
tag = "Mentors", tag = "Mentors",
security( security(
@@ -295,7 +295,7 @@ pub async fn put_update_mentor_me(
path = "/v1/mentors/update", path = "/v1/mentors/update",
request_body = MentorUpdateRequestDto, request_body = MentorUpdateRequestDto,
responses( 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" tag = "Mentors - Admin"
)] )]
@@ -310,10 +310,10 @@ pub async fn put_update_mentor_no_id() -> Response {
get, get,
path = "/v1/mentors/status", path = "/v1/mentors/status",
responses( responses(
(status = 200, description = "Mentor application status", body = String), (status = 200, description = "[MENTOR] Mentor application status", body = String),
(status = 401, description = "Unauthorized - invalid token"), (status = 401, description = "[MENTOR] Unauthorized - invalid token"),
(status = 403, description = "No mentor application found for current user"), (status = 403, description = "[MENTOR] No mentor application found for current user"),
(status = 500, description = "Internal server error") (status = 500, description = "[MENTOR] Internal server error")
), ),
tag = "Mentors", tag = "Mentors",
security( security(
@@ -15,7 +15,7 @@ use crate::v1::gacha_claims::{GachaClaimItemDto, GachaClaimRequestDto, GachaClai
), ),
params(("id" = String, Path, description = "Gacha Claim ID")), params(("id" = String, Path, description = "Gacha Claim ID")),
responses( responses(
(status = 200, description = "Get Gacha Claim by ID", body = ResponseSuccessDto<GachaClaimItemDto>) (status = 200, description = "[ADMIN] Get Gacha Claim by ID", body = ResponseSuccessDto<GachaClaimItemDto>)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -44,7 +44,7 @@ pub async fn get_detail_gacha_claim(
path = "/v1/gacha/claims/create", path = "/v1/gacha/claims/create",
request_body = GachaClaimRequestDto, request_body = GachaClaimRequestDto,
responses( responses(
(status = 201, description = "Create new gacha claim", body = MessageResponseDto) (status = 201, description = "[ADMIN] Create new gacha claim", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -27,7 +27,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard};
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Get gacha item list", body = ResponseListSuccessDto<Vec<GachaItemDto>>) (status = 200, description = "[ADMIN] Get gacha item list", body = ResponseListSuccessDto<Vec<GachaItemDto>>)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -56,7 +56,7 @@ pub async fn get_gacha_item_list(
), ),
params(("id" = String, Path, description = "Gacha Item ID")), params(("id" = String, Path, description = "Gacha Item ID")),
responses( responses(
(status = 200, description = "Get gacha item by ID", body = ResponseSuccessDto<GachaItemDto>) (status = 200, description = "[ADMIN] Get gacha item by ID", body = ResponseSuccessDto<GachaItemDto>)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -85,7 +85,7 @@ pub async fn get_gacha_item_by_id(
), ),
request_body = GachaItemRequestDto, request_body = GachaItemRequestDto,
responses( responses(
(status = 201, description = "Create gacha item", body = MessageResponseDto) (status = 201, description = "[ADMIN] Create gacha item", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -114,7 +114,7 @@ pub async fn post_create_gacha_item(
), ),
request_body = GachaItemUpdateRequestDto, request_body = GachaItemUpdateRequestDto,
responses( responses(
(status = 200, description = "Update gacha item", body = MessageResponseDto) (status = 200, description = "[ADMIN] Update gacha item", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -143,7 +143,7 @@ pub async fn put_update_gacha_item(
("Bearer" = []) ("Bearer" = [])
), ),
responses( responses(
(status = 200, description = "Delete gacha item", body = MessageResponseDto) (status = 200, description = "[ADMIN] Delete gacha item", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -15,7 +15,7 @@ use imphnen_iam::{PermissionsEnum, permissions_guard};
), ),
params(("id" = String, Path, description = "Gacha Roll ID")), params(("id" = String, Path, description = "Gacha Roll ID")),
responses( responses(
(status = 200, description = "Get Gacha Roll by ID", body = ResponseSuccessDto<GachaRollItemDto>) (status = 200, description = "[ADMIN] Get Gacha Roll by ID", body = ResponseSuccessDto<GachaRollItemDto>)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -44,7 +44,7 @@ pub async fn get_detail_gacha_roll(
), ),
request_body = GachaRollRequestDto, request_body = GachaRollRequestDto,
responses( responses(
(status = 201, description = "Create new gacha roll", body = MessageResponseDto) (status = 201, description = "[ADMIN] Create new gacha roll", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -72,7 +72,7 @@ pub async fn post_create_gacha_roll(
("Bearer" = []) ("Bearer" = [])
), ),
responses( responses(
(status = 200, description = "Execute and get 1 gacha result", body = ResponseSuccessDto<GachaRollItemDto>) (status = 200, description = "[ADMIN] Execute and get 1 gacha result", body = ResponseSuccessDto<GachaRollItemDto>)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -100,7 +100,7 @@ pub async fn post_execute_gacha_roll(
), ),
params(("id" = String, Path, description = "Gacha Roll ID")), params(("id" = String, Path, description = "Gacha Roll ID")),
responses( responses(
(status = 200, description = "Delete Gacha Roll (soft delete)", body = MessageResponseDto) (status = 200, description = "[ADMIN] Delete Gacha Roll (soft delete)", body = MessageResponseDto)
), ),
tag = "Gacha" tag = "Gacha"
)] )]
@@ -26,9 +26,9 @@ use imphnen_iam::{PermissionsEnum, permissions_guard};
path = "/v1/hackathons", path = "/v1/hackathons",
request_body = HackathonCreateRequestDto, request_body = HackathonCreateRequestDto,
responses( responses(
(status = 201, description = "Hackathon created successfully", body = ResponseSuccessDto<HackathonDto>), (status = 201, description = "[ADMIN] Hackathon created successfully", body = ResponseSuccessDto<HackathonDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[ADMIN] Bad request", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto)
), ),
tag = "Hackathons" tag = "Hackathons"
)] )]
@@ -53,9 +53,9 @@ pub async fn create_hackathon(
("id" = String, Path, description = "Hackathon ID") ("id" = String, Path, description = "Hackathon ID")
), ),
responses( responses(
(status = 200, description = "Hackathon retrieved successfully", body = ResponseSuccessDto<HackathonDto>), (status = 200, description = "[PUBLIC] Hackathon retrieved successfully", body = ResponseSuccessDto<HackathonDto>),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathons" tag = "Hackathons"
)] )]
@@ -82,8 +82,8 @@ pub async fn get_hackathon(
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Hackathons retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonDto>>), (status = 200, description = "[PUBLIC] Hackathons retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonDto>>),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathons" tag = "Hackathons"
)] )]
@@ -108,10 +108,10 @@ pub async fn list_hackathons(
), ),
request_body = HackathonUpdateRequestDto, request_body = HackathonUpdateRequestDto,
responses( responses(
(status = 200, description = "Hackathon updated successfully", body = ResponseSuccessDto<HackathonDto>), (status = 200, description = "[ADMIN] Hackathon updated successfully", body = ResponseSuccessDto<HackathonDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[ADMIN] Bad request", body = ErrorDto),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[ADMIN] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto)
), ),
tag = "Hackathons" tag = "Hackathons"
)] )]
@@ -140,9 +140,9 @@ pub async fn update_hackathon(
("id" = String, Path, description = "Hackathon ID") ("id" = String, Path, description = "Hackathon ID")
), ),
responses( responses(
(status = 200, description = "Hackathon deleted successfully", body = ResponseSuccessDto<String>), (status = 200, description = "[ADMIN] Hackathon deleted successfully", body = ResponseSuccessDto<String>),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[ADMIN] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[ADMIN] Internal server error", body = ErrorDto)
), ),
tag = "Hackathons" tag = "Hackathons"
)] )]
@@ -169,10 +169,10 @@ pub async fn delete_hackathon(
), ),
request_body = HackathonEventCreateRequestDto, request_body = HackathonEventCreateRequestDto,
responses( responses(
(status = 201, description = "Event created successfully", body = ResponseSuccessDto<HackathonEventDto>), (status = 201, description = "[PUBLIC] Event created successfully", body = ResponseSuccessDto<HackathonEventDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Events" tag = "Hackathon Events"
)] )]
@@ -201,8 +201,8 @@ pub async fn create_hackathon_event(
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Events retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonEventDto>>), (status = 200, description = "[PUBLIC] Events retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonEventDto>>),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Events" tag = "Hackathon Events"
)] )]
@@ -225,10 +225,10 @@ pub async fn list_hackathon_events(
), ),
request_body = HackathonEventUpdateRequestDto, request_body = HackathonEventUpdateRequestDto,
responses( responses(
(status = 200, description = "Event updated successfully", body = ResponseSuccessDto<HackathonEventDto>), (status = 200, description = "[PUBLIC] Event updated successfully", body = ResponseSuccessDto<HackathonEventDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Event not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Event not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Events" tag = "Hackathon Events"
)] )]
@@ -250,9 +250,9 @@ pub async fn update_hackathon_event(
("id" = String, Path, description = "Event ID") ("id" = String, Path, description = "Event ID")
), ),
responses( responses(
(status = 200, description = "Event deleted successfully", body = ResponseSuccessDto<String>), (status = 200, description = "[PUBLIC] Event deleted successfully", body = ResponseSuccessDto<String>),
(status = 404, description = "Event not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Event not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Events" tag = "Hackathon Events"
)] )]
@@ -275,10 +275,10 @@ pub async fn delete_hackathon_event(
), ),
request_body = HackathonTimelineCreateRequestDto, request_body = HackathonTimelineCreateRequestDto,
responses( responses(
(status = 201, description = "Timeline created successfully", body = ResponseSuccessDto<HackathonTimelineDto>), (status = 201, description = "[PUBLIC] Timeline created successfully", body = ResponseSuccessDto<HackathonTimelineDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Timeline" tag = "Hackathon Timeline"
)] )]
@@ -307,8 +307,8 @@ pub async fn create_hackathon_timeline(
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Timeline retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonTimelineDto>>), (status = 200, description = "[PUBLIC] Timeline retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonTimelineDto>>),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Timeline" tag = "Hackathon Timeline"
)] )]
@@ -331,10 +331,10 @@ pub async fn list_hackathon_timeline(
), ),
request_body = HackathonTimelineUpdateRequestDto, request_body = HackathonTimelineUpdateRequestDto,
responses( responses(
(status = 200, description = "Timeline updated successfully", body = ResponseSuccessDto<HackathonTimelineDto>), (status = 200, description = "[PUBLIC] Timeline updated successfully", body = ResponseSuccessDto<HackathonTimelineDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Timeline not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Timeline not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Timeline" tag = "Hackathon Timeline"
)] )]
@@ -356,9 +356,9 @@ pub async fn update_hackathon_timeline(
("id" = String, Path, description = "Timeline ID") ("id" = String, Path, description = "Timeline ID")
), ),
responses( responses(
(status = 200, description = "Timeline deleted successfully", body = ResponseSuccessDto<String>), (status = 200, description = "[PUBLIC] Timeline deleted successfully", body = ResponseSuccessDto<String>),
(status = 404, description = "Timeline not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Timeline not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Timeline" tag = "Hackathon Timeline"
)] )]
@@ -382,10 +382,10 @@ pub async fn delete_hackathon_timeline(
), ),
request_body = HackathonSubmissionCreateRequestDto, request_body = HackathonSubmissionCreateRequestDto,
responses( responses(
(status = 201, description = "Submission created successfully", body = ResponseSuccessDto<HackathonSubmissionDto>), (status = 201, description = "[PUBLIC] Submission created successfully", body = ResponseSuccessDto<HackathonSubmissionDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Hackathon not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Hackathon not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
@@ -414,8 +414,8 @@ pub async fn create_hackathon_submission(
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Submissions retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonSubmissionDto>>), (status = 200, description = "[PUBLIC] Submissions retrieved successfully", body = ResponseListSuccessDto<Vec<HackathonSubmissionDto>>),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
@@ -437,9 +437,9 @@ pub async fn list_hackathon_submissions(
("id" = String, Path, description = "Submission ID") ("id" = String, Path, description = "Submission ID")
), ),
responses( responses(
(status = 200, description = "Submission retrieved successfully", body = ResponseSuccessDto<HackathonSubmissionDto>), (status = 200, description = "[PUBLIC] Submission retrieved successfully", body = ResponseSuccessDto<HackathonSubmissionDto>),
(status = 404, description = "Submission not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
@@ -461,10 +461,10 @@ pub async fn get_hackathon_submission(
), ),
request_body = HackathonSubmissionUpdateRequestDto, request_body = HackathonSubmissionUpdateRequestDto,
responses( responses(
(status = 200, description = "Submission updated successfully", body = ResponseSuccessDto<HackathonSubmissionDto>), (status = 200, description = "[PUBLIC] Submission updated successfully", body = ResponseSuccessDto<HackathonSubmissionDto>),
(status = 400, description = "Bad request", body = ErrorDto), (status = 400, description = "[PUBLIC] Bad request", body = ErrorDto),
(status = 404, description = "Submission not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
@@ -486,9 +486,9 @@ pub async fn update_hackathon_submission(
("id" = String, Path, description = "Submission ID") ("id" = String, Path, description = "Submission ID")
), ),
responses( responses(
(status = 200, description = "Submission submitted successfully", body = ResponseSuccessDto<HackathonSubmissionDto>), (status = 200, description = "[PUBLIC] Submission submitted successfully", body = ResponseSuccessDto<HackathonSubmissionDto>),
(status = 404, description = "Submission not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
@@ -509,9 +509,9 @@ pub async fn submit_hackathon_submission(
("id" = String, Path, description = "Submission ID") ("id" = String, Path, description = "Submission ID")
), ),
responses( responses(
(status = 200, description = "Submission deleted successfully", body = ResponseSuccessDto<String>), (status = 200, description = "[PUBLIC] Submission deleted successfully", body = ResponseSuccessDto<String>),
(status = 404, description = "Submission not found", body = ErrorDto), (status = 404, description = "[PUBLIC] Submission not found", body = ErrorDto),
(status = 500, description = "Internal server error", body = ErrorDto) (status = 500, description = "[PUBLIC] Internal server error", body = ErrorDto)
), ),
tag = "Hackathon Submissions" tag = "Hackathon Submissions"
)] )]
+17 -17
View File
@@ -13,8 +13,8 @@ use crate::v1::auth::auth_service::AuthService;
path = "/v1/auth/login", path = "/v1/auth/login",
request_body = AuthLoginRequestDto, request_body = AuthLoginRequestDto,
responses( responses(
(status = 200, description = "Login successful", body = ResponseSuccessDto<AuthLoginResponsetDto>), (status = 200, description = "[PUBLIC] Login successful", body = ResponseSuccessDto<AuthLoginResponsetDto>),
(status = 401, description = "Login failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Login failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -30,9 +30,9 @@ pub async fn post_login(
path = "/v1/auth/login-mentor", path = "/v1/auth/login-mentor",
request_body = AuthLoginRequestDto, request_body = AuthLoginRequestDto,
responses( responses(
(status = 200, description = "Mentor login successful", body = ResponseSuccessDto<AuthLoginResponsetDto>), (status = 200, description = "[PUBLIC] Mentor login successful", body = ResponseSuccessDto<AuthLoginResponsetDto>),
(status = 401, description = "Mentor login failed", body = MessageResponseDto), (status = 401, description = "[PUBLIC] Mentor login failed", body = MessageResponseDto),
(status = 403, description = "Forbidden - Not a mentor", body = MessageResponseDto) (status = 403, description = "[PUBLIC] Forbidden - Not a mentor", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -48,8 +48,8 @@ pub async fn post_login_mentor(
path = "/v1/auth/register", path = "/v1/auth/register",
request_body = AuthRegisterRequestDto, request_body = AuthRegisterRequestDto,
responses( responses(
(status = 200, description = "Register successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] Register successful", body = MessageResponseDto),
(status = 401, description = "Register failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Register failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -65,8 +65,8 @@ pub async fn post_register(
path = "/v1/auth/verify-email", path = "/v1/auth/verify-email",
request_body = AuthVerifyEmailRequestDto, request_body = AuthVerifyEmailRequestDto,
responses( responses(
(status = 200, description = "Verify email successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] Verify email successful", body = MessageResponseDto),
(status = 401, description = "Verify email failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Verify email failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -82,8 +82,8 @@ pub async fn post_verify_email(
path = "/v1/auth/send-otp", path = "/v1/auth/send-otp",
request_body = AuthResendOtpRequestDto, request_body = AuthResendOtpRequestDto,
responses( responses(
(status = 200, description = "Resend otp successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] Resend otp successful", body = MessageResponseDto),
(status = 401, description = "Resend otp failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Resend otp failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -99,8 +99,8 @@ pub async fn post_resend_otp(
path = "/v1/auth/forgot", path = "/v1/auth/forgot",
request_body = AuthResendOtpRequestDto, request_body = AuthResendOtpRequestDto,
responses( responses(
(status = 200, description = "Forgot password request successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] Forgot password request successful", body = MessageResponseDto),
(status = 401, description = "Forgot password request failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Forgot password request failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -116,8 +116,8 @@ pub async fn post_forgot_password(
path = "/v1/auth/new-password", path = "/v1/auth/new-password",
request_body = AuthNewPasswordRequestDto, request_body = AuthNewPasswordRequestDto,
responses( responses(
(status = 200, description = "New password request successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] New password request successful", body = MessageResponseDto),
(status = 401, description = "New password request failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] New password request failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -133,8 +133,8 @@ pub async fn post_new_password(
path = "/v1/auth/refresh", path = "/v1/auth/refresh",
request_body = AuthRefreshTokenRequestDto, request_body = AuthRefreshTokenRequestDto,
responses( responses(
(status = 200, description = "Refresh token request successful", body = MessageResponseDto), (status = 200, description = "[PUBLIC] Refresh token request successful", body = MessageResponseDto),
(status = 401, description = "Refresh token request failed", body = MessageResponseDto) (status = 401, description = "[PUBLIC] Refresh token request failed", body = MessageResponseDto)
), ),
tag = "Authentication" tag = "Authentication"
)] )]
@@ -44,7 +44,7 @@ where
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Get all teams (admin)", body = ResponseListSuccessDto<Vec<AdminTeamsListItemDto>>) (status = 200, description = "[ADMIN] Get all teams (admin)", body = ResponseListSuccessDto<Vec<AdminTeamsListItemDto>>)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -68,7 +68,7 @@ pub async fn get_all_teams(
("id" = String, Path, description = "Team ID") ("id" = String, Path, description = "Team ID")
), ),
responses( responses(
(status = 200, description = "Get team by ID (admin)", body = ResponseSuccessDto<AdminTeamsDetailItemDto>) (status = 200, description = "[ADMIN] Get team by ID (admin)", body = ResponseSuccessDto<AdminTeamsDetailItemDto>)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -92,7 +92,7 @@ pub async fn get_team_by_id(
("id" = String, Path, description = "Team ID") ("id" = String, Path, description = "Team ID")
), ),
responses( responses(
(status = 200, description = "Get team members (admin)", body = ResponseSuccessDto<Vec<TeamMemberDto>>) (status = 200, description = "[ADMIN] Get team members (admin)", body = ResponseSuccessDto<Vec<TeamMemberDto>>)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -114,7 +114,7 @@ pub async fn get_team_members(
path = "/", path = "/",
request_body = TeamsCreateRequestDto, request_body = TeamsCreateRequestDto,
responses( responses(
(status = 200, description = "Create team (admin)", body = ResponseSuccessDto<serde_json::Value>) (status = 200, description = "[ADMIN] Create team (admin)", body = ResponseSuccessDto<serde_json::Value>)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -139,7 +139,7 @@ pub async fn create_team(
), ),
request_body = TeamsUpdateRequestDto, request_body = TeamsUpdateRequestDto,
responses( responses(
(status = 200, description = "Update team (admin)", body = MessageResponseDto) (status = 200, description = "[ADMIN] Update team (admin)", body = MessageResponseDto)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -164,7 +164,7 @@ pub async fn update_team(
("id" = String, Path, description = "Team ID") ("id" = String, Path, description = "Team ID")
), ),
responses( responses(
(status = 200, description = "Delete team (admin)", body = MessageResponseDto) (status = 200, description = "[ADMIN] Delete team (admin)", body = MessageResponseDto)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
@@ -189,7 +189,7 @@ pub async fn delete_team(
), ),
request_body = TeamInviteRequestDto, request_body = TeamInviteRequestDto,
responses( responses(
(status = 200, description = "Invite team members (admin)", body = ResponseSuccessDto<serde_json::Value>) (status = 200, description = "[ADMIN] Invite team members (admin)", body = ResponseSuccessDto<serde_json::Value>)
), ),
tag = "Admin - Teams" tag = "Admin - Teams"
)] )]
+12 -12
View File
@@ -39,7 +39,7 @@ pub struct FileUploadSchema {
("filter_by" = Option<String>, Query, description = "Field to filter by"), ("filter_by" = Option<String>, Query, description = "Field to filter by"),
), ),
responses( responses(
(status = 200, description = "Get user list", body = ResponseListSuccessDto<Vec<UsersListItemDto>>) (status = 200, description = "[ADMIN] Get user list", body = ResponseListSuccessDto<Vec<UsersListItemDto>>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -70,7 +70,7 @@ params(
("id" = String, Path, description = "User ID") ("id" = String, Path, description = "User ID")
), ),
responses( responses(
(status = 200, description = "Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[USER] Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -98,7 +98,7 @@ security(
), ),
path = "/v1/users/me", path = "/v1/users/me",
responses( responses(
(status = 200, description = "Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[ADMIN] Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -120,7 +120,7 @@ pub async fn get_user_me(
path = "/v1/users/create", path = "/v1/users/create",
request_body = UsersCreateRequestDto, request_body = UsersCreateRequestDto,
responses( responses(
(status = 200, description = "Create new user", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[ADMIN] Create new user", body = ResponseSuccessDto<UsersDetailItemDto>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -152,7 +152,7 @@ pub async fn post_create_user(
), ),
request_body = UsersUpdateRequestDto, request_body = UsersUpdateRequestDto,
responses( responses(
(status = 200, description = "Update user", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[ADMIN] Update user", body = ResponseSuccessDto<UsersDetailItemDto>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -182,7 +182,7 @@ pub async fn put_update_user(
path = "/v1/users/update/me", path = "/v1/users/update/me",
request_body = UsersUpdateRequestDto, request_body = UsersUpdateRequestDto,
responses( responses(
(status = 200, description = "Update current user", body = ResponseSuccessDto<UsersDetailItemDto>) (status = 200, description = "[USER] Update current user", body = ResponseSuccessDto<UsersDetailItemDto>)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -208,7 +208,7 @@ pub async fn put_update_user_me(
), ),
request_body = UsersActiveInactiveRequestDto, request_body = UsersActiveInactiveRequestDto,
responses( responses(
(status = 200, description = "Set user active status", body = MessageResponseDto) (status = 200, description = "[ADMIN] Set user active status", body = MessageResponseDto)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -237,7 +237,7 @@ pub async fn patch_user_active_status(
), ),
path = "/v1/users/delete/{id}", path = "/v1/users/delete/{id}",
responses( responses(
(status = 200, description = "Soft delete user", body = MessageResponseDto) (status = 200, description = "[ADMIN] Soft delete user", body = MessageResponseDto)
), ),
tag = "Users" tag = "Users"
)] )]
@@ -270,10 +270,10 @@ pub async fn delete_user(
content_type = "multipart/form-data" content_type = "multipart/form-data"
), ),
responses( responses(
(status = 200, description = "Upload file successfully", body = ResponseSuccessDto<serde_json::Value>), (status = 200, description = "[USER] Upload file successfully", body = ResponseSuccessDto<serde_json::Value>),
(status = 400, description = "Bad request"), (status = 400, description = "[USER] Bad request"),
(status = 401, description = "Unauthorized"), (status = 401, description = "[USER] Unauthorized"),
(status = 500, description = "Internal server error") (status = 500, description = "[USER] Internal server error")
), ),
tag = "Users" tag = "Users"
)] )]