Add CMS Management Functionality

- Introduced a new CMS management feature, including the ability to create, retrieve, update, search, and delete CMS entries.
- Implemented the CMS entity, repository, service, and handler layers following Clean Architecture principles.
- Added API endpoints for CMS operations in Swagger documentation, ensuring comprehensive API specifications.
- Enhanced error handling and validation for CMS data, improving robustness and user experience.
- Updated the main application to initialize the CMS repository and service, integrating them into the existing system.
This commit is contained in:
n.nakhostin
2025-11-03 13:20:58 +03:30
parent 875447ac58
commit 9a444a1e7d
9 changed files with 1021 additions and 13 deletions
+6 -6
View File
@@ -21,7 +21,7 @@ func NewHandler(service Service) *Handler {
// Create handles creating a new contact message
// @Summary Create a new contact message
// @Description Create a new contact message from a user
// @Tags contacts
// @Tags Contacts
// @Accept json
// @Produce json
// @Param contact body CreateContactForm true "Contact information"
@@ -52,7 +52,7 @@ func (h *Handler) Create(c echo.Context) error {
// GetByID handles retrieving a contact by ID (admin only)
// @Summary Get contact by ID
// @Description Retrieve a contact message by its ID (admin only)
// @Tags contacts
// @Tags Admin-Contacts
// @Accept json
// @Produce json
// @Param id path string true "Contact ID"
@@ -78,7 +78,7 @@ func (h *Handler) GetByID(c echo.Context) error {
// Search handles searching contacts with filters (admin only)
// @Summary Search contacts
// @Description Search contacts with filters and pagination (admin only)
// @Tags contacts
// @Tags Admin-Contacts
// @Accept json
// @Produce json
// @Param q query string false "Search query"
@@ -112,7 +112,7 @@ func (h *Handler) Search(c echo.Context) error {
// UpdateStatus handles updating contact status (admin only)
// @Summary Update contact status
// @Description Update the status of a contact message (admin only)
// @Tags contacts
// @Tags Admin-Contacts
// @Accept json
// @Produce json
// @Param id path string true "Contact ID"
@@ -152,7 +152,7 @@ func (h *Handler) UpdateStatus(c echo.Context) error {
// GetStats handles retrieving contact statistics (admin only)
// @Summary Get contact statistics
// @Description Get contact statistics by status (admin only)
// @Tags contacts
// @Tags Admin-Contacts
// @Accept json
// @Produce json
// @Success 200 {object} response.APIResponse{data=ContactStats}
@@ -170,7 +170,7 @@ func (h *Handler) GetStats(c echo.Context) error {
// Delete handles deleting a contact (admin only)
// @Summary Delete contact
// @Description Delete a contact message by ID (admin only)
// @Tags contacts
// @Tags Admin-Contacts
// @Accept json
// @Produce json
// @Param id path string true "Contact ID"