35 lines
579 B
Go
35 lines
579 B
Go
package gin
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"myschools.me/campus/demo-1/handler"
|
|
)
|
|
|
|
// 路由配置
|
|
func routerSetup(router *gin.Engine, rootpath *string) {
|
|
router.Use(gin.Recovery())
|
|
router.GET(`/health/check`, handler.HealthCheck)
|
|
|
|
r := router.Group(fmt.Sprintf("/%s", *rootpath))
|
|
{
|
|
r.POST(`/register`)
|
|
r.GET(`/accountcheck/:accname`)
|
|
r.POST(`/login`)
|
|
r.POST(`/forgot`)
|
|
}
|
|
|
|
ug := r.Group(`/user`)
|
|
{
|
|
ug.GET(`/choose/:orgid`)
|
|
ug.GET(`/detail`)
|
|
ug.POST(`/update`)
|
|
}
|
|
hell := r.Group("/token")
|
|
{
|
|
hell.GET("verify", handler.TokenVerify)
|
|
|
|
}
|
|
}
|