feat: added exercises handler/service/repo
This commit is contained in:
@@ -26,11 +26,13 @@ func NewMux(cfg Config) http.Handler {
|
||||
userService := domain.NewUserService(store.User)
|
||||
registrationService := domain.NewRegistrationService(store, userService, inviteService)
|
||||
listService := domain.NewListService(store, store.List)
|
||||
exerciseService := domain.NewExerciseService(store.Exercise)
|
||||
|
||||
authHandler := handler.NewAuthHandler(authService)
|
||||
inviteHandler := handler.NewInviteHandler(inviteService)
|
||||
userHandler := handler.NewUserHandler(userService, authService, registrationService)
|
||||
listHandler := handler.NewListHandler(listService, userService)
|
||||
exerciseHandler := handler.NewExerciseHandler(exerciseService)
|
||||
|
||||
protected := middleware.WithJWT(authService)
|
||||
|
||||
@@ -70,6 +72,9 @@ func NewMux(cfg Config) http.Handler {
|
||||
apiMux.Handle("POST /lists/items/{id}/complete", protected(listHandler.SetListItemCompleted))
|
||||
apiMux.Handle("GET /lists/{id}", protected(listHandler.GetListItems))
|
||||
|
||||
// Exercises
|
||||
apiMux.Handle("GET /exercises", protected(exerciseHandler.GetExercises))
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/api/v1/", http.StripPrefix("/api/v1", apiMux))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user