snippet/gin/router.go

29 lines
448 B
Go
Raw Normal View History

2021-12-03 03:36:40 +00:00
package gin
import (
2021-12-03 06:00:37 +00:00
"fmt"
2021-12-03 03:36:40 +00:00
"github.com/gin-gonic/gin"
)
//路由配置
2021-12-03 06:00:37 +00:00
func routerSetup(router *gin.Engine, rootpath *string) {
2021-12-03 03:36:40 +00:00
router.Use(gin.Recovery())
router.GET(`/health/check`)
2021-12-03 06:00:37 +00:00
r := router.Group(fmt.Sprintf("/%s", *rootpath))
2021-12-03 03:36:40 +00:00
{
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`)
}
}