add: contactController,tests & refactored tests

This commit is contained in:
$(pass /github/name)
2024-08-18 14:17:17 +02:00
parent 6441ad3ef9
commit ae0ec8bf88
17 changed files with 886 additions and 320 deletions

View File

@@ -30,7 +30,7 @@ func Run() {
logger.Error.Fatalf("Couldn't init database: %v", err)
}
emailService := services.NewEmailService(config.SMTP.Host, config.SMTP.Port, config.SMTP.User, config.SMTP.Password, config.SMTP.AdminEmail)
emailService := services.NewEmailService(config.SMTP.Host, config.SMTP.Port, config.SMTP.User, config.SMTP.Password)
var consentRepo repositories.ConsentRepositoryInterface = &repositories.ConsentRepository{}
consentService := &services.ConsentService{Repo: consentRepo}
@@ -47,6 +47,7 @@ func Run() {
userController := &controllers.UserController{Service: userService, EmailService: emailService, ConsentService: consentService, BankAccountService: bankAccountService, MembershipService: membershipService}
membershipController := &controllers.MembershipController{Service: *membershipService}
contactController := &controllers.ContactController{EmailService: emailService}
router := gin.Default()
// gin.SetMode(gin.ReleaseMode)
router.Static(config.Templates.StaticPath, "./style")
@@ -55,7 +56,7 @@ func Run() {
router.Use(gin.Logger())
// router.Use(middlewares.LoggerMiddleware())
routes.RegisterRoutes(router, userController, membershipController)
routes.RegisterRoutes(router, userController, membershipController, contactController)
// create subrouter for teh authenticated area /account
// also pthprefix matches everything below /account
// accountRouter := router.PathPrefix("/account").Subrouter()