Skip to content
Snippets Groups Projects
Verified Commit a757527e authored by Réthelyi Bálint's avatar Réthelyi Bálint :no_mouth:
Browse files

some user story

parent edc621a4
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,6 @@ type Station struct { ...@@ -14,11 +14,6 @@ type Station struct {
Description string Description string
} }
type File struct {
Stations map[string]*Station
Stories []string
}
type User struct { type User struct {
Id uuid.UUID Id uuid.UUID
Name string Name string
...@@ -37,8 +32,13 @@ type Group struct { ...@@ -37,8 +32,13 @@ type Group struct {
Members []User Members []User
} }
type File struct {
Stations map[string]*Station
Stories map[int]string
}
var Stations map[string]*Station var Stations map[string]*Station
var Stories []string var Stories map[int]string
func ReadFile() { func ReadFile() {
b, err := ioutil.ReadFile("stations.yaml") b, err := ioutil.ReadFile("stations.yaml")
...@@ -59,6 +59,7 @@ func ReadFile() { ...@@ -59,6 +59,7 @@ func ReadFile() {
} }
Stories = file.Stories Stories = file.Stories
} }
func CreateNewRoute() []*Station { func CreateNewRoute() []*Station {
......
stations: stations:
first: first:
name: egy name: egy
description: "ez a leiras az elso allomase" description: "105 kornyeke"
9881300f-175b-4809-b8fb-d915b2c900ac: 9881300f-175b-4809-b8fb-d915b2c900ac:
name: rand1 name: rand1
description: "ez a leiras a masodik allomase" description: "18-on valahol"
2ab06fbd-0606-42a9-abc7-4163221d3f1f: 2ab06fbd-0606-42a9-abc7-4163221d3f1f:
name: rand2 name: rand2
description: "ez a leiras a harmadik allomase" description: "szauna"
7023030f-e22f-4c82-93ae-4c847b3ac964: 7023030f-e22f-4c82-93ae-4c847b3ac964:
name: rand3 name: rand3
description: "ez a leiras a negyedik allomase" description: "15-en, Feri szobajanal"
last: last:
name: uccso name: uccso
description: "ez a leiras az otodik allomase" description: "ez az AK-ban van"
stories: stories:
- "elso" 1: |
- "masodik" Előveszed a mobilod, hogy PéK-en megnézd Feri telefonszámát. Megdöbbenve konstatálod, a telefonod nem lát semmilyen wifi hálózatot 😱,
- "harmadik" sőőőt, látod, hogy 20%-on vagy csak, pedig felraktad töltőre mielőtt lefeküdtél (bár az hajnal 4-kor volt).
- "negyedik" 2: "masodik"
- "utolso" 3: "harmadik"
4: "negyedik"
5: "utolso"
...@@ -140,7 +140,7 @@ func routeChooser(c *gin.Context) { ...@@ -140,7 +140,7 @@ func routeChooser(c *gin.Context) {
break break
} }
if stat == station { if stat == station {
story = route.Stories[i] story = route.Stories[i+1]
if stat.Id == route.Stations["last"].Id { if stat.Id == route.Stations["last"].Id {
next = nil next = nil
} else { } else {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{{ .Story }} {{ .Story }}
{{- if .Next }} {{- if .Next }}
<p>A következő állomás leírása:</p> <p>A következő állomást itt keressétek:</p>
<p>{{ .Next.Description }}</p> <p>{{ .Next.Description }}</p>
<a href="/station/{{ .Next.Id }}">link debug celbol</a> <a href="/station/{{ .Next.Id }}">link debug celbol</a>
{{- end }} {{- end }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment