frontend: dedicate a field in JSON to file hint
This commit is contained in:
parent
b772a22705
commit
21e4b04c19
3 changed files with 28 additions and 28 deletions
|
@ -14,11 +14,11 @@ type myTeamFile struct {
|
|||
Size int64 `json:"size"`
|
||||
}
|
||||
type myTeamHint struct {
|
||||
HintId int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Cost int64 `json:"cost"`
|
||||
Unlocked bool `json:"unlocked"`
|
||||
HintId int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content *string `json:"content"`
|
||||
File *string `json:"file"`
|
||||
Cost int64 `json:"cost"`
|
||||
}
|
||||
type myTeamExercice struct {
|
||||
ThemeId int `json:"theme_id"`
|
||||
|
@ -99,9 +99,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
} else {
|
||||
for _, h := range hints {
|
||||
if t == nil || t.HasHint(h) {
|
||||
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, h.Content, h.Cost, true})
|
||||
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, &h.Content, &h.File, h.Cost})
|
||||
} else {
|
||||
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, "", h.Cost, false})
|
||||
exercice.Hints = append(exercice.Hints, myTeamHint{h.Id, h.Title, nil, nil, h.Cost})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue