26 lines
410 B
Go
26 lines
410 B
Go
package gin
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"myschools.me/xixi.xv/hello/handler"
|
|
)
|
|
|
|
// 路由配置
|
|
func routerSetup(router *gin.Engine, rootpath *string) {
|
|
router.Use(gin.Recovery())
|
|
|
|
r := router.Group(fmt.Sprintf("/%s", *rootpath))
|
|
{
|
|
sch := r.Group(`/school`)
|
|
{
|
|
sch.GET(`/list`, handler.SchoolList)
|
|
}
|
|
usr := r.Group(`/user`)
|
|
{
|
|
usr.POST(`/login`, handler.UserLogin)
|
|
}
|
|
}
|
|
}
|