From 0cf50b3bf9227bdb984bef493b3414291a29a711 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 18 Dec 2018 22:10:09 +0100 Subject: [PATCH] =?UTF-8?q?Dostosowywanie=20modeli=20do=20pracy=20z=20baz?= =?UTF-8?q?=C4=85=20danych?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basicModels.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/basicModels.go b/basicModels.go index bf095b5..5a16406 100644 --- a/basicModels.go +++ b/basicModels.go @@ -10,7 +10,7 @@ type patient struct { Name string Surname string BirthDate time.Time - PatientState patientStates + PatientState sql.NullString PatientSex sex PatientEmail string } @@ -37,7 +37,7 @@ type operation struct { Name string averageTime string operationType operationTypes - cost []uint8 + cost uint8 refoundation int64 } @@ -48,14 +48,14 @@ type room struct { } type admission struct { - AdmissionID int + AdmissionID int64 AdmissionDate time.Time EndDate time.Time PatientPesel string DiagnosisSymbol string - MainDoctor int - PlanedOperation int - RoomNumber int + MainDoctor int64 + PlanedOperation int64 + RoomNumber int64 IsPlanned bool } @@ -70,7 +70,10 @@ type admissions []admission type operations []operation type rooms []room -type iDatabaseModel interface{} +type iDatabaseModel interface { + getPrimaryKey() string + getPrimaryKeyName() string +} type iDatabaseModels []iDatabaseModel type iStoreModels interface { readModels(rows *sql.Rows) iDatabaseModels