Import Serverfunktionen angelegt

This commit is contained in:
2026-08-20 23:21:09 +02:00
parent 9de53394a3
commit 57faec71f8
106 changed files with 31891 additions and 7 deletions
+8
View File
@@ -29,16 +29,19 @@ func InitHttpServer(config *viper.Viper, dbHandler *sql.DB) HttpServer {
valueRepository := repositories.NewValueRepository(dbHandler)
productGroupRepository := repositories.NewProductGroupRepository(dbHandler, valueRepository)
productRepository := repositories.NewProductRepository(dbHandler, productGroupRepository, valueRepository)
importRepository := repositories.NewImportRepository(dbHandler, productGroupRepository, productRepository, valueRepository)
// service initialisation:
valueService := services.NewValueService(valueRepository)
productGroupService := services.NewProductGroupService(productGroupRepository)
productService := services.NewProductService(productRepository)
importService := services.NewImportService(importRepository)
// controller initialisation:
valueController := controller.NewValueController(valueService)
productGroupController := controller.NewProductGroupController(productGroupService, valueService)
productController := controller.NewProductController(productService, productGroupService, valueService)
importController := controller.NewImportController(importService)
// Service API
router := gin.Default()
@@ -89,6 +92,11 @@ func InitHttpServer(config *viper.Viper, dbHandler *sql.DB) HttpServer {
router.POST("/addPropertyToProductId/:productId", productController.AddPropertyToProductId) // add Property to Product by ID
router.DELETE("/deletePropertyFromProductId/:productId", productController.DeletePropertyFromProductId) // delete Property from Product by ID
// Import functionality
router.POST("/importPropertyTypeGroups", importController.ImportPropertyTypeGroups) // import PropertyTypeGroups
router.POST("/importProductGroups", importController.ImportProductGroups) // import ProductGroups
router.POST("/importProducts", importController.ImportProducts) // import Products
// server
return HttpServer{
config: config,