// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package route import ( "net/http" "github.com/gin-gonic/gin" "access-control-monitor/controller/v1" _ "access-control-monitor/docs" ) func SetupRoute(engine *gin.Engine) { // 404页面 engine.NoRoute(func(c *gin.Context) { c.String(http.StatusNotFound, "Not Found") }) c := v1.NewController() // 服务健康检查 engine.PUT("/ping", c.Ping) // version 1 apiv1 := engine.Group("/api/v1") { apiv1.PUT("/auth", c.Auth) apiv1.POST("/register", c.Register) apiv1.PUT("/delete", c.StaffDelete) apiv1.PUT("/attendance", c.Attendance) //apiv1.GET("/batch_download", c.BatchDownload) //apiv1.PUT("/feedback", c.FeedBack) } }