标签:tom src route 路由 play ref pac content top
package main
import (
"github.com/gin-gonic/gin"
"topic.jtthink.com/src"
)
func main() {
router := gin.Default()
v1 := router.Group("/v1/topics")
{
v1.GET("", src.GetTopicList)
v1.GET("/:topic_id", src.GetTopicDetail)
v1.Use(src.MustLogin()) //当使用了mustlogin,在下方定义的一切路由都需要先经过他验证
v1.POST("", src.NewTopic)
v1.DELETE("/:topic_id", src.DelTopic)
router.Run()
}
}
标签:tom src route 路由 play ref pac content top
原文地址:https://www.cnblogs.com/hualou/p/12071046.html