Пример #1
0
func (this *ConferencesController) Show(c *gin.Context) {
	params := *params(c, "conference")
	service := models.NewConferenceService(params)
	if conference, err := service.Conference(); err == nil {
		c.JSON(200, &conference)
	} else {
		c.JSON(404, err)
	}
}
Пример #2
0
func (this *ConferencesController) Index(c *gin.Context) {
	params := *params(c, "shuffle")
	service := models.NewConferenceService(params)
	if conferences, err := service.Conferences(); err == nil {
		c.JSON(200, &conferences)
	} else {
		c.JSON(500, err)
	}
}