You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
857 B

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
}