snippet/gin/router.go

29 lines
448 B
Go

package gin
import (
"fmt"
"github.com/gin-gonic/gin"
)
//路由配置
func routerSetup(router *gin.Engine, rootpath *string) {
router.Use(gin.Recovery())
router.GET(`/health/check`)
r := router.Group(fmt.Sprintf("/%s", *rootpath))
{
r.POST(`/register`)
r.GET(`/accountcheck/:accname`)
r.POST(`/login`)
r.POST(`/forgot`)
}
ug := router.Group(`/user`)
{
ug.GET(`/choose/:orgid`)
ug.GET(`/detail`)
ug.POST(`/update`)
}
}