From b4d453b108bdac6e535cf9c2a63d1187420ea1f3 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 6 Jan 2024 16:18:19 +0100 Subject: [PATCH] =?UTF-8?q?Reihenfolge=20innerhalb=20aller=20structs=20so?= =?UTF-8?q?=20ver=C3=A4ndert,=20dass=20m=C3=B6glichst=20wenige=20Pointerby?= =?UTF-8?q?tes=20verwendet=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/data/dataStructs.go | 10 +++++----- packages/server/briefing.go | 2 +- packages/server/htmlStructs.go | 12 ++++++------ packages/server/session.go | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/data/dataStructs.go b/packages/data/dataStructs.go index 5eb8768..6f35ec6 100644 --- a/packages/data/dataStructs.go +++ b/packages/data/dataStructs.go @@ -18,38 +18,38 @@ type DB struct { } type Person struct { - ID int64 FirstName string LastName string + ID int64 } type Instructor Person type Participant struct { - Person Company string + Person } type Briefing struct { - ID int64 DateTime string Location string Document string AsOf string InstructorID int64 + ID int64 } type Answer struct { - ID int64 Text string IsImage bool // TODO: relocate to sessionStructs if possible + ID int64 } type Question struct { - ID int64 Text string Answers []Answer Correct int + ID int64 } type GivenAnswer struct { diff --git a/packages/server/briefing.go b/packages/server/briefing.go index cc1e679..6e03c75 100644 --- a/packages/server/briefing.go +++ b/packages/server/briefing.go @@ -26,9 +26,9 @@ import ( type briefing struct { *data.Briefing - uuid uuid.UUID participants []*participant questions []data.Question + uuid uuid.UUID } func generateLogin() (string, error) { diff --git a/packages/server/htmlStructs.go b/packages/server/htmlStructs.go index 8cff19b..5c1136d 100644 --- a/packages/server/htmlStructs.go +++ b/packages/server/htmlStructs.go @@ -17,27 +17,27 @@ import ( ) type tableHTMLData struct { - sessionID uuid.UUID otd []data.OverviewTableData + sessionID uuid.UUID } type participantHTMLData struct { - briefingID uuid.UUID participant + briefingID uuid.UUID } type questionHTMLData struct { + question data.Question participantHTMLData questionID int64 - question data.Question } type resultAnswer struct { - id int64 text string correct bool chosen bool isImage bool // TODO: relocate to sessionStructs if possible + id int64 } type resultQuestion struct { @@ -46,12 +46,12 @@ type resultQuestion struct { } type resultHTMLData struct { - participantHTMLData questions []resultQuestion + participantHTMLData } type summaryHTMLData struct { + participantsData []participantHTMLData sessionID uuid.UUID briefingID uuid.UUID - participantsData []participantHTMLData } diff --git a/packages/server/session.go b/packages/server/session.go index 46e79e6..eeab4c3 100644 --- a/packages/server/session.go +++ b/packages/server/session.go @@ -21,9 +21,9 @@ import ( ) type Session struct { - uuid uuid.UUID instructor data.Instructor briefings []*briefing + uuid uuid.UUID } func (s *Session) handleSearch(db *data.DB) http.HandlerFunc {