From 3cfcb721e881ccd54e6d6d0e490d1468b3dcd427 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 6 Jan 2024 17:05:06 +0100 Subject: [PATCH] =?UTF-8?q?Reihenfolge=20innerhalb=20der=20structs=20so=20?= =?UTF-8?q?ver=C3=A4ndert,=20dass=20m=C3=B6glichst=20wenige=20Pointerbytes?= =?UTF-8?q?=20verwendet=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/data/dataStructs.go | 10 +++++----- packages/server/htmlStructs.go | 12 ++++++------ 2 files changed, 11 insertions(+), 11 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/htmlStructs.go b/packages/server/htmlStructs.go index c38c31d..4527b37 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 }