package routes import ( "main/controllers" "main/logger" "main/middlewares" "net/http" "github.com/gin-gonic/gin" ) func Setup() *gin.Engine { r := gin.New() r.Use(logger.GinLogger(), logger.GinRecovery(true)) r.Use(middlewares.Cors()) r.GET("/", func(c *gin.Context) { c.String(http.StatusOK, "hello") }) r.POST("/upload", controllers.ImportStudentInfoHandler) r.POST("/change-score", controllers.ChangeStuScoreHandler) r.POST("/get-target-info", controllers.GetTargetStudentInfoHandler) r.POST("/get-all", controllers.GetAllStudentInfoHandler) r.POST("/get-N-accord-score", controllers.GetNStudentInfoAccordScoreHandler) r.GET("/save-info", controllers.WriteIntoExcelHandler) r.GET("/get-random", controllers.GetOneRandomStudentInfoHandler) r.GET("/get-accord-score", controllers.GetOneStudentInfoAccordScoreHandler) return r }