Dostosowywanie modeli do pracy z bazą danych
This commit is contained in:
parent
3977c3e9fe
commit
0cf50b3bf9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user