| 123456789101112131415161718192021 |
- // Path: routes 注册路由
- package routes
- import (
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // RegisterAPIRoutes 注册路由
- func RegisterAPIRoutes(router *gin.Engine) {
- // v1 路由组,所有 v1 版本的路由都放在这里
- v1 := router.Group("/v1")
- {
- v1.GET("/", func(c *gin.Context) {
- c.JSON(http.StatusOK, gin.H{
- "Hello": "World",
- })
- })
- }
- }
|