Beispiel #1
0
func dbAPI(api *gin.RouterGroup) {
	api.POST("/rekt", func(c *gin.Context) {
		models.Rekt()
	})

	api.POST("/init", func(c *gin.Context) {
		models.InitDbData()
	})
}
Beispiel #2
0
func api(r *gin.RouterGroup) {
	partyAPI(r)
	answerAPI(r)
	questionAPI(r)
	dbAPI(r.Group("/db"))
}
Beispiel #3
0
func partyAPI(api *gin.RouterGroup) {
	api.GET("/party", func(c *gin.Context) {
		c.JSON(http.StatusOK, models.RetreiveAllParties())
	})
}
Beispiel #4
0
func questionAPI(api *gin.RouterGroup) {
	api.GET("/question", func(c *gin.Context) {
		c.JSON(http.StatusOK, models.RetreiveAllQuestions(c.Query("area")))
	})
}
Beispiel #5
0
func answerAPI(api *gin.RouterGroup) {
	api.GET("/answer", func(c *gin.Context) {
		c.JSON(http.StatusOK, models.RetreiveAllAnswers(c.Query("question")))
	})
}