コード例 #1
0
ファイル: dashboard.go プロジェクト: pjherring/ggc
func addDashboardRoutes(router *pat.Router) {
	router.Get("/dashboard/progress", serve(
		dashboardAuth,
		getDashboardProgress,
		toJson,
	))

	router.Get("/dashboard/clues", serve(
		dashboardAuth,
		getDashboardClues,
		toJson,
	))

	router.Put("/dashboard/start_times", serve(
		parseRequest(new(setStartTimesReq)),
		dashboardAuth,
		setStartTimes,
		noResponse,
	))

	router.Put("/dashboard", serve(
		parseRequest(new(_DashboardAuthReq)),
		dashboardAuth,
	))

}
コード例 #2
0
ファイル: clue.go プロジェクト: pjherring/ggc
func addClueRoutes(router *pat.Router) {
	router.Get("/clue/{clue_id}/hint", serve(
		Authenticate(true),
		parseFromUrl(urlParams{
			"clue_id": parseParamToInt64,
			"lat":     parseParamToFloat64,
			"lng":     parseParamToFloat64,
		}),
		takeHint,
		toJson,
	))
	router.Get("/clue", serve(
		Authenticate(true),
		parseFromUrl(urlParams{"clue_id": parseParamToInt64}),
		currentClue,
		toJson,
	))
	router.Post("/clue/{clue_id}", serve(
		Authenticate(true),
		parseFromUrl(urlParams{
			"clue_id": parseParamToInt64,
		}),
		parseRequest(new(_SolveClueReq)),
		solveClue,
		toJson,
	))
	router.Put("/clue/{clue_id}", serve(
		dashboardAuth,
		parseRequest(new(record.Clue)),
		updateClue,
		toJson,
	))
}
コード例 #3
0
ファイル: track.go プロジェクト: pjherring/ggc
func addTrackRoutes(router *pat.Router) {
	router.Get("/tracks", serve(
		dashboardAuth,
		allTracks,
		toJson,
	))
	router.Put("/track/{track_id}/toggle", serve(
		dashboardAuth,
		parseFromUrl(urlParams{
			"track_id": parseParamToInt64,
		}),
		toggleTrackActivation,
		noResponse,
	))

}