goodsGroup := r.Group("/goods")
{
goodsGroup.GET("/lists",goodlist) // r.GET("/goods/lists",goodlist)
}
获取商品id为1的详细信息
r.GET("/:id",getGood)
// getGood
func getGood(c *Context) {
id := c.Param("id")
c.JSON(http.StatusOK,gin.H{
"id": id,
})
}
网友评论