Merge branch 'feat/toggle-negative-usgae' into 'development'

fix: missing useAuth

See merge request mbugroup/lti-api!487
This commit is contained in:
Adnan Zahir
2026-04-28 12:07:54 +07:00
2 changed files with 11 additions and 3 deletions
+6 -1
View File
@@ -7,12 +7,17 @@ import (
repository "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/repositories" repository "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/repositories"
service "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/services" service "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/services"
rUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/repositories"
sUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
) )
type SystemSettingsModule struct{} type SystemSettingsModule struct{}
func (SystemSettingsModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) { func (SystemSettingsModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
userRepo := rUser.NewUserRepository(db)
userSvc := sUser.NewUserService(userRepo, validate)
repo := repository.NewSystemSettingRepository(db) repo := repository.NewSystemSettingRepository(db)
svc := service.NewSystemSettingService(repo) svc := service.NewSystemSettingService(repo)
SystemSettingRoutes(router, svc) SystemSettingRoutes(router, userSvc, svc)
} }
+5 -2
View File
@@ -2,15 +2,18 @@ package systemsettings
import ( import (
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
controller "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/controllers" controller "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/controllers"
service "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/services" service "gitlab.com/mbugroup/lti-api.git/internal/modules/system-settings/services"
m "gitlab.com/mbugroup/lti-api.git/internal/middleware" userService "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
) )
func SystemSettingRoutes(v1 fiber.Router, svc service.SystemSettingService) { func SystemSettingRoutes(v1 fiber.Router, u userService.UserService, svc service.SystemSettingService) {
ctrl := controller.NewSystemSettingController(svc) ctrl := controller.NewSystemSettingController(svc)
route := v1.Group("/system-settings") route := v1.Group("/system-settings")
route.Use(m.Auth(u))
route.Get("/", ctrl.GetAll) route.Get("/", ctrl.GetAll)
route.Patch("/allow-negative-pakan-ovk", m.RequirePermissions(m.P_SystemSettingUpdate), ctrl.SetAllowNegativePakanOVK) route.Patch("/allow-negative-pakan-ovk", m.RequirePermissions(m.P_SystemSettingUpdate), ctrl.SetAllowNegativePakanOVK)
} }