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
+17 -17
View File
@@ -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<AuthLoginResponsetDto>),
(status = 401, description = "Login failed", body = MessageResponseDto)
(status = 200, description = "[PUBLIC] Login successful", body = ResponseSuccessDto<AuthLoginResponsetDto>),
(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<AuthLoginResponsetDto>),
(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<AuthLoginResponsetDto>),
(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"
)]
@@ -44,7 +44,7 @@ where
("filter_by" = Option<String>, Query, description = "Field to filter by"),
),
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"
)]
@@ -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<AdminTeamsDetailItemDto>)
(status = 200, description = "[ADMIN] Get team by ID (admin)", body = ResponseSuccessDto<AdminTeamsDetailItemDto>)
),
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<Vec<TeamMemberDto>>)
(status = 200, description = "[ADMIN] Get team members (admin)", body = ResponseSuccessDto<Vec<TeamMemberDto>>)
),
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<serde_json::Value>)
(status = 200, description = "[ADMIN] Create team (admin)", body = ResponseSuccessDto<serde_json::Value>)
),
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<serde_json::Value>)
(status = 200, description = "[ADMIN] Invite team members (admin)", body = ResponseSuccessDto<serde_json::Value>)
),
tag = "Admin - Teams"
)]
+12 -12
View File
@@ -39,7 +39,7 @@ pub struct FileUploadSchema {
("filter_by" = Option<String>, Query, description = "Field to filter by"),
),
responses(
(status = 200, description = "Get user list", body = ResponseListSuccessDto<Vec<UsersListItemDto>>)
(status = 200, description = "[ADMIN] Get user list", body = ResponseListSuccessDto<Vec<UsersListItemDto>>)
),
tag = "Users"
)]
@@ -70,7 +70,7 @@ params(
("id" = String, Path, description = "User ID")
),
responses(
(status = 200, description = "Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
(status = 200, description = "[USER] Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
),
tag = "Users"
)]
@@ -98,7 +98,7 @@ security(
),
path = "/v1/users/me",
responses(
(status = 200, description = "Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
(status = 200, description = "[ADMIN] Get user by ID", body = ResponseSuccessDto<UsersDetailItemDto>)
),
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<UsersDetailItemDto>)
(status = 200, description = "[ADMIN] Create new user", body = ResponseSuccessDto<UsersDetailItemDto>)
),
tag = "Users"
)]
@@ -152,7 +152,7 @@ pub async fn post_create_user(
),
request_body = UsersUpdateRequestDto,
responses(
(status = 200, description = "Update user", body = ResponseSuccessDto<UsersDetailItemDto>)
(status = 200, description = "[ADMIN] Update user", body = ResponseSuccessDto<UsersDetailItemDto>)
),
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<UsersDetailItemDto>)
(status = 200, description = "[USER] Update current user", body = ResponseSuccessDto<UsersDetailItemDto>)
),
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<serde_json::Value>),
(status = 400, description = "Bad request"),
(status = 401, description = "Unauthorized"),
(status = 500, description = "Internal server error")
(status = 200, description = "[USER] Upload file successfully", body = ResponseSuccessDto<serde_json::Value>),
(status = 400, description = "[USER] Bad request"),
(status = 401, description = "[USER] Unauthorized"),
(status = 500, description = "[USER] Internal server error")
),
tag = "Users"
)]