Refactor API documentation and update endpoint tags for clarity
- Updated README.md to reflect changes in endpoint categories, renaming "Customers-Admin" to "Admin-Customers" and "Companies-Admin" to "Admin-Companies" for consistency. - Modified health check endpoint tags from "Health" to "Admin-Health" to align with the new naming convention. - Adjusted Swagger documentation to replace outdated tags and ensure accurate representation of the API structure. - Enhanced user and customer handler documentation to reflect the new "Admin-Authorization" and "Admin-Users" tags, improving clarity in the API documentation.
This commit is contained in:
+16
-16
@@ -31,7 +31,7 @@ func NewUserHandler(service Service, logger logger.Logger, validator ValidationS
|
||||
// Login handles user login
|
||||
// @Summary Authenticate user login
|
||||
// @Description Authenticate user with username/email and password to obtain access and refresh tokens for web panel administration. This endpoint validates credentials and returns JWT tokens for subsequent API calls.
|
||||
// @Tags Authorization
|
||||
// @Tags Admin-Authorization
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param login body LoginForm true "User login credentials including username/email and password"
|
||||
@@ -60,7 +60,7 @@ func (h *Handler) Login(c echo.Context) error {
|
||||
// RefreshToken handles token refresh
|
||||
// @Summary Refresh access token
|
||||
// @Description Generate a new access token using a valid refresh token. This endpoint allows clients to obtain fresh access tokens without re-authentication, maintaining session continuity.
|
||||
// @Tags Authorization
|
||||
// @Tags Admin-Authorization
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param refresh body RefreshTokenForm true "Refresh token for generating new access token"
|
||||
@@ -87,7 +87,7 @@ func (h *Handler) RefreshToken(c echo.Context) error {
|
||||
// ResetPassword handles password reset request
|
||||
// @Summary Initiate password reset process
|
||||
// @Description Send password reset email to user with reset token. This endpoint validates the email address and sends a secure reset link to the user's registered email address.
|
||||
// @Tags Authorization
|
||||
// @Tags Admin-Authorization
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param reset body ResetPasswordForm true "Email address for password reset request"
|
||||
@@ -117,7 +117,7 @@ func (h *Handler) ResetPassword(c echo.Context) error {
|
||||
// GetProfile gets current user profile
|
||||
// @Summary Get authenticated user profile
|
||||
// @Description Retrieve complete profile information for the currently authenticated user including personal details, role information, permissions, and account status. This endpoint requires valid authentication token.
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -144,7 +144,7 @@ func (h *Handler) GetProfile(c echo.Context) error {
|
||||
// UpdateProfile updates current user profile
|
||||
// @Summary Update authenticated user profile
|
||||
// @Description Update profile information for the currently authenticated user including personal details, contact information, and preferences. Only the authenticated user can update their own profile.
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -179,7 +179,7 @@ func (h *Handler) UpdateProfile(c echo.Context) error {
|
||||
// ChangePassword changes current user password
|
||||
// @Summary Change user password
|
||||
// @Description Change password for the currently authenticated user. Requires current password verification and enforces password policy. This operation invalidates all existing sessions and requires re-authentication.
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -214,7 +214,7 @@ func (h *Handler) ChangePassword(c echo.Context) error {
|
||||
// Logout handles user logout
|
||||
// @Summary Logout authenticated user
|
||||
// @Description Logout the currently authenticated user by invalidating their access and refresh tokens. This endpoint ensures secure session termination and prevents further use of the user's tokens.
|
||||
// @Tags Authorization
|
||||
// @Tags Admin-Authorization
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -247,7 +247,7 @@ func (h *Handler) Logout(c echo.Context) error {
|
||||
// CreateUser creates a new user (admin only)
|
||||
// @Summary Create new user account
|
||||
// @Description Create a new user account with specified role and permissions. This endpoint is restricted to administrators only and allows creation of various user types including admins, managers, and operators with appropriate access levels.
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -289,7 +289,7 @@ func (h *Handler) CreateUser(c echo.Context) error {
|
||||
// ListUsers lists users with search and filters (admin only)
|
||||
// @Summary List users
|
||||
// @Description List users with search and filters (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -330,7 +330,7 @@ func (h *Handler) ListUsers(c echo.Context) error {
|
||||
// GetUserByID gets a user by ID (admin only)
|
||||
// @Summary Get user by ID
|
||||
// @Description Get user details by ID (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -356,7 +356,7 @@ func (h *Handler) GetUserByID(c echo.Context) error {
|
||||
// UpdateUser updates a user (admin only)
|
||||
// @Summary Update user
|
||||
// @Description Update user information (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -400,7 +400,7 @@ func (h *Handler) UpdateUser(c echo.Context) error {
|
||||
// DeleteUser deletes a user (admin only)
|
||||
// @Summary Delete user
|
||||
// @Description Delete a user (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -434,7 +434,7 @@ func (h *Handler) DeleteUser(c echo.Context) error {
|
||||
// UpdateUserStatus updates user status (admin only)
|
||||
// @Summary Update user status
|
||||
// @Description Update user account status (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -479,7 +479,7 @@ func (h *Handler) UpdateUserStatus(c echo.Context) error {
|
||||
// UpdateUserRole updates user role (admin only)
|
||||
// @Summary Update user role
|
||||
// @Description Update user role (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -525,7 +525,7 @@ func (h *Handler) UpdateUserRole(c echo.Context) error {
|
||||
// GetUsersByCompanyID gets users by company ID (admin only)
|
||||
// @Summary Get users by company ID
|
||||
// @Description Get users belonging to a specific company (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
@@ -585,7 +585,7 @@ func (h *Handler) GetUsersByCompanyID(c echo.Context) error {
|
||||
// GetUsersByRole gets users by role (admin only)
|
||||
// @Summary Get users by role
|
||||
// @Description Get users with a specific role (admin only)
|
||||
// @Tags Users
|
||||
// @Tags Admin-Users
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
|
||||
Reference in New Issue
Block a user