diff --git a/cmd/web/bootstrap/bootstrap.go b/cmd/web/bootstrap/bootstrap.go index 0c1d866..c42c98c 100644 --- a/cmd/web/bootstrap/bootstrap.go +++ b/cmd/web/bootstrap/bootstrap.go @@ -124,7 +124,7 @@ func InitHTTPServer(conf Config, log logger.Logger) *echo.Echo { e.GET("/admin/v1/health", healthHandler) // Add Swagger documentation endpoint - e.GET("/swagger/*", echoSwagger.WrapHandler) + e.GET("/swagger*", echoSwagger.WrapHandler) log.Info("HTTP server initialized successfully", map[string]interface{}{ "middleware": []string{"recover", "request_id", "logger", "cors", "custom_logging"}, diff --git a/cmd/web/docs/docs.go b/cmd/web/docs/docs.go index 45ee7a4..bab062f 100644 --- a/cmd/web/docs/docs.go +++ b/cmd/web/docs/docs.go @@ -9,11 +9,11 @@ const docTemplate = `{ "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", - "termsOfService": "https://tender-management.com/terms", + "termsOfService": "https://opplens.com/terms", "contact": { - "name": "Tender Management API Support", - "url": "https://tender-management.com/support", - "email": "api-support@tender-management.com" + "name": "Opplens API Support", + "url": "https://opplens.com", + "email": "info@opplens.com" }, "license": { "name": "MIT", @@ -8952,18 +8952,22 @@ const docTemplate = `{ { "description": "Public flag management operations for mobile application including flag retrieval and listing", "name": "Flags" + }, + { + "description": "Public notification management operations for mobile application including notification listing and detailed notification information", + "name": "Notification" } ] }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "2.0.0", - Host: "localhost:8082", - BasePath: "/", + Version: "1.0.0", + Host: "", + BasePath: "", Schemes: []string{}, - Title: "Tender Management API", - Description: "This is a comprehensive API for the Tender Management System built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access.", + Title: "Opplens API", + Description: "This is a comprehensive API for the Opplens built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", diff --git a/cmd/web/docs/swagger.json b/cmd/web/docs/swagger.json index db31896..70ee5da 100644 --- a/cmd/web/docs/swagger.json +++ b/cmd/web/docs/swagger.json @@ -1,22 +1,20 @@ { "swagger": "2.0", "info": { - "description": "This is a comprehensive API for the Tender Management System built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access.", - "title": "Tender Management API", - "termsOfService": "https://tender-management.com/terms", + "description": "This is a comprehensive API for the Opplens built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access.", + "title": "Opplens API", + "termsOfService": "https://opplens.com/terms", "contact": { - "name": "Tender Management API Support", - "url": "https://tender-management.com/support", - "email": "api-support@tender-management.com" + "name": "Opplens API Support", + "url": "https://opplens.com", + "email": "info@opplens.com" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, - "version": "2.0.0" + "version": "1.0.0" }, - "host": "localhost:8082", - "basePath": "/", "paths": { "/admin/v1/companies": { "get": { @@ -8946,6 +8944,10 @@ { "description": "Public flag management operations for mobile application including flag retrieval and listing", "name": "Flags" + }, + { + "description": "Public notification management operations for mobile application including notification listing and detailed notification information", + "name": "Notification" } ] } \ No newline at end of file diff --git a/cmd/web/docs/swagger.yaml b/cmd/web/docs/swagger.yaml index 440ab52..78c7f3a 100644 --- a/cmd/web/docs/swagger.yaml +++ b/cmd/web/docs/swagger.yaml @@ -1,4 +1,3 @@ -basePath: / definitions: bootstrap.HealthResponse: properties: @@ -1329,22 +1328,21 @@ definitions: username: type: string type: object -host: localhost:8082 info: contact: - email: api-support@tender-management.com - name: Tender Management API Support - url: https://tender-management.com/support - description: This is a comprehensive API for the Tender Management System built - with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The - API provides endpoints for user management, customer management, company management, - and authentication for both web panel administration and mobile application access. + email: info@opplens.com + name: Opplens API Support + url: https://opplens.com + description: This is a comprehensive API for the Opplens built with Clean Architecture + principles and Domain-Driven Design (DDD) patterns. The API provides endpoints + for user management, customer management, company management, and authentication + for both web panel administration and mobile application access. license: name: MIT url: https://opensource.org/licenses/MIT - termsOfService: https://tender-management.com/terms - title: Tender Management API - version: 2.0.0 + termsOfService: https://opplens.com/terms + title: Opplens API + version: 1.0.0 paths: /admin/v1/companies: get: @@ -5736,3 +5734,6 @@ tags: - description: Public flag management operations for mobile application including flag retrieval and listing name: Flags +- description: Public notification management operations for mobile application including + notification listing and detailed notification information + name: Notification diff --git a/cmd/web/main.go b/cmd/web/main.go index 1da7d91..c03f5ab 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -1,20 +1,17 @@ package main -// @title Tender Management API -// @version 2.0.0 -// @description This is a comprehensive API for the Tender Management System built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access. -// @termsOfService https://tender-management.com/terms +// @title Opplens API +// @version 1.0.0 +// @description This is a comprehensive API for the Opplens built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access. +// @termsOfService https://opplens.com/terms -// @contact.name Tender Management API Support -// @contact.url https://tender-management.com/support -// @contact.email api-support@tender-management.com +// @contact.name Opplens API Support +// @contact.url https://opplens.com +// @contact.email info@opplens.com // @license.name MIT // @license.url https://opensource.org/licenses/MIT -// @host localhost:8082 -// @BasePath / - // @securityDefinitions.apikey BearerAuth // @in header // @name Authorization @@ -77,6 +74,9 @@ package main // @tag.name Flags // @tag.description Public flag management operations for mobile application including flag retrieval and listing +// @tag.name Notification +// @tag.description Public notification management operations for mobile application including notification listing and detailed notification information + import ( "context" "fmt" diff --git a/internal/notification/handler.go b/internal/notification/handler.go index d2f2f78..ba173a2 100644 --- a/internal/notification/handler.go +++ b/internal/notification/handler.go @@ -96,7 +96,7 @@ func (h *NotificationHandler) GetNotifications(c echo.Context) error { return response.InternalServerError(c, "Failed to get notifications") } - return response.Success(c, notifications, "Notifications retrieved successfully") + return response.SuccessWithMeta(c, notifications.Notifications, notifications.Meta, "Notifications retrieved successfully") } // MyAdminNotifications gets notifications for the admin @@ -150,7 +150,7 @@ func (h *NotificationHandler) AdminNotifications(c echo.Context) error { return response.InternalServerError(c, "Failed to get notifications") } - return response.Success(c, notifications, "Notifications retrieved successfully") + return response.SuccessWithMeta(c, notifications.Notifications, notifications.Meta, "Notifications retrieved successfully") } // MarkSeen marks a notification as seen @@ -263,7 +263,7 @@ func (h *NotificationHandler) CustomerNotifications(c echo.Context) error { return response.InternalServerError(c, "Failed to get notifications") } - return response.Success(c, notifications, "Notifications retrieved successfully") + return response.SuccessWithMeta(c, notifications.Notifications, notifications.Meta, "Notifications retrieved successfully") } // MarkSeen marks a notification as seen