-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
72 lines (48 loc) · 1.71 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"github.com/gin-gonic/gin"
"github.com/tuckKome/fictionary/db"
"github.com/tuckKome/fictionary/handler"
)
func main() {
router := gin.Default()
router.LoadHTMLGlob("templates/*.html")
router.Static("/css", "./css")
router.Static("/js", "./js")
router.Static("/resources", "./resources")
db.Init()
bot := handler.LineConnect()
twitterClient := handler.TwitterConnect()
//はじめのページ:お題を入力:過去のお題
router.GET("/", handler.Index)
router.GET("/new-game", handler.GetNewGame)
router.POST("/new-game", handler.CreateGame(bot, twitterClient))
router.GET("/games/:id/new", handler.Switch1)
router.POST("/games/:id/new", handler.SwitchCreateKaitou)
//「回答受け付けました」ページを表示
router.GET("/games/:id/accepted", handler.GetAccepted)
//事前確認のための合言葉検証
router.POST("/games/:id/verify", handler.Verify)
//事前チェックページ
router.GET("/games/:id/check-in-adv", handler.GetListInAdv)
//回答受付終了
router.POST("/games/:id/to-playing", handler.UpdatePhaseToPlaying)
//「みんなの回答」ページを表示
router.GET("/games/:id", handler.Switch2)
//「投票」機能
router.POST("/games/:id", handler.Switch3)
//ゲームを閉じる
router.POST("/games/:id/done", handler.UpdatePhaseToArchive)
//LINE bot からのwebhookを受ける
router.POST("/line", handler.CreateLine(bot))
// エラーページ
router.GET("/error", handler.Error)
//Donation Page
router.GET("/donate", handler.GetDonation)
//Donation するページ
router.GET("/i-will-donate", handler.GetMakeDonation)
//Donation 作成
router.POST("/i-will-donate", handler.CreateDonation)
//起動
router.Run()
}