Refactor customer domain by removing obsolete files and updating main application structure
- Deleted customer domain files including entities, services, handlers, and forms to streamline the codebase. - Removed customer-related routes and service initializations from the main application. - Updated Swagger documentation to reflect the removal of customer endpoints and definitions. - Cleaned up the project structure to enhance maintainability and focus on user management functionality.
This commit is contained in:
+1
-5
@@ -56,7 +56,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
"tm/internal/customer"
|
||||
"tm/internal/user"
|
||||
|
||||
_ "tm/cmd/web/docs" // This is generated by swag
|
||||
@@ -92,8 +91,8 @@ func main() {
|
||||
|
||||
// Initialize authorization service
|
||||
authService := initAuthorizationService(conf.Auth.JWT, redisClient, logger)
|
||||
|
||||
// Initialize repositories with MongoDB connection manager
|
||||
customerRepository := customer.NewCustomerRepository(mongoManager, logger)
|
||||
userRepository := user.NewUserRepository(mongoManager, logger)
|
||||
|
||||
logger.Info("Repositories initialized successfully", map[string]interface{}{
|
||||
@@ -104,7 +103,6 @@ func main() {
|
||||
userValidator := user.NewValidationService()
|
||||
|
||||
// Initialize services with repositories
|
||||
customerService := customer.NewCustomerService(customerRepository, logger)
|
||||
userService := user.NewUserService(userRepository, logger, authService, userValidator)
|
||||
|
||||
logger.Info("Services initialized successfully", map[string]interface{}{
|
||||
@@ -112,7 +110,6 @@ func main() {
|
||||
})
|
||||
|
||||
// Initialize handlers with services
|
||||
customerHandler := customer.NewHandler(customerService)
|
||||
userHandler := user.NewUserHandler(userService, logger, userValidator, authService)
|
||||
|
||||
logger.Info("Handlers initialized successfully", map[string]interface{}{
|
||||
@@ -123,7 +120,6 @@ func main() {
|
||||
e := initHTTPServer(conf, logger)
|
||||
|
||||
// Register routes
|
||||
customerHandler.RegisterRoutes(e)
|
||||
userHandler.RegisterRoutes(e)
|
||||
|
||||
// Start server
|
||||
|
||||
Reference in New Issue
Block a user