hello/gin/router.go

26 lines
410 B
Go
Raw Normal View History

2024-07-10 08:07:44 +00:00
package gin
import (
"fmt"
"github.com/gin-gonic/gin"
2024-07-11 01:21:33 +00:00
"myschools.me/xixi.xv/hello/handler"
2024-07-10 08:07:44 +00:00
)
// 路由配置
func routerSetup(router *gin.Engine, rootpath *string) {
router.Use(gin.Recovery())
r := router.Group(fmt.Sprintf("/%s", *rootpath))
{
2024-07-11 01:21:33 +00:00
sch := r.Group(`/school`)
{
sch.GET(`/list`, handler.SchoolList)
}
usr := r.Group(`/user`)
{
usr.POST(`/login`, handler.UserLogin)
}
2024-07-10 08:07:44 +00:00
}
}