コード例 #1
0
ファイル: main.go プロジェクト: rajjan/qstn
func entriesNew(c *app.Context) {
	s, entry := api.EntryPost(c)

	if s != 201 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}
コード例 #2
0
ファイル: main.go プロジェクト: rajjan/qstn
func entriesRandom(c *app.Context) {
	s, entry := api.EntryRand(c)

	if s != 200 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}
コード例 #3
0
ファイル: main.go プロジェクト: rajjan/qstn
func entriesGet(c *app.Context) {
	id := c.Seg(2)

	s, entry := api.EntryGet(c, id)

	if s != 200 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}