From 6b6886fdea01de21e4a368cbe4cb822b26cb250d Mon Sep 17 00:00:00 2001 From: golanguzb71 Date: Tue, 29 Oct 2024 23:46:06 +0500 Subject: [PATCH] exam_cr_sudo --- .../internal/routes/ielts_service_routes.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api-gateway/internal/routes/ielts_service_routes.go b/api-gateway/internal/routes/ielts_service_routes.go index 53f61ca..8683295 100755 --- a/api-gateway/internal/routes/ielts_service_routes.go +++ b/api-gateway/internal/routes/ielts_service_routes.go @@ -26,22 +26,22 @@ func IeltsServiceRoutes(api *gin.RouterGroup, authClient *client.AuthClient) { } exam := ielts.Group("/exam") { - exam.POST("/create", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.CreateExam) + exam.POST("/create", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.CreateExam) result := exam.Group("/result") { - result.GET("/:page/:size", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.GetExamResult) - result.GET("/user-answers/:examId", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.GetExamUserAnswers) + result.GET("/:page/:size", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.GetExamResult) + result.GET("/user-answers/:examId", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.GetExamUserAnswers) result.GET("/top-exam-result/:dataframe", handlers.GetTopExamResult) - result.GET("/get-results-inline/:sectionType/:examId", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.GetResultsInlineBySection) - result.GET("/get-results-outline-writing/:examId", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.GetResultsOutlineWriting) - result.GET("/get-results-outline-speaking/:examId/:partNumber", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.GetResultsOutlineSpeaking) + result.GET("/get-results-inline/:sectionType/:examId", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.GetResultsInlineBySection) + result.GET("/get-results-outline-writing/:examId", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.GetResultsOutlineWriting) + result.GET("/get-results-outline-speaking/:examId/:partNumber", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.GetResultsOutlineSpeaking) result.GET("/get-results-speaking-voice/:voiceName", handlers.GetVoiceRecord) } attempt := exam.Group("/attempt") { - attempt.POST("/create/inline", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.CreateInlineAttempt) - attempt.POST("/create/outline-writing", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.CreateOutlineAttemptWriting) - attempt.POST("/create/outline-speaking/:examId", middleware.AuthMiddleware([]string{"USER"}, authClient), handlers.CreateOutlineAttemptSpeaking) + attempt.POST("/create/inline", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.CreateInlineAttempt) + attempt.POST("/create/outline-writing", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.CreateOutlineAttemptWriting) + attempt.POST("/create/outline-speaking/:examId", middleware.AuthMiddleware([]string{"USER", "ADMIN"}, authClient), handlers.CreateOutlineAttemptSpeaking) } }