Exemplo n.º 1
0
func (this *TagsController) Show(c *gin.Context) {
	opts := *params(c, "tag")
	service := models.NewTagService(opts)
	if tag, err := service.Tag(); err == nil {
		c.JSON(200, &tag)
	} else {
		c.JSON(404, err)
	}
}
Exemplo n.º 2
0
func (this *TagsController) Index(c *gin.Context) {
	opts := *params(c)
	service := models.NewTagService(opts)
	if tags, err := service.Tags(); err == nil {
		c.JSON(200, &tags)
	} else {
		c.JSON(500, err)
	}
}