diff --git a/basicModels.go b/basicModels.go index 2d09a9a..39043e5 100644 --- a/basicModels.go +++ b/basicModels.go @@ -12,7 +12,7 @@ type patient struct { BirthDate time.Time PatientState nullString PatientSex sex - PatientEmail string + PatientEmail nullString } type diagnosis struct { diff --git a/databaseConnection.go b/databaseConnection.go index 8461abb..eb63e69 100644 --- a/databaseConnection.go +++ b/databaseConnection.go @@ -10,7 +10,7 @@ import ( _ "github.com/denisenkom/go-mssqldb" ) -var connectionString = "server=192.168.1.2;Port=1433;database=DB_s439397;trusted_connection=yes;encrypt=disable" +var connectionString = "server=127.0.0.1;Port=1433;database=DB_s439397;trusted_connection=yes;encrypt=disable" var db *sql.DB var err error diff --git a/databaseRead.go b/databaseRead.go index cc759ec..8cc07a0 100644 --- a/databaseRead.go +++ b/databaseRead.go @@ -25,7 +25,7 @@ func (pat patients) readModels(rows *sql.Rows) iDatabaseModels { for rows.Next() { pati = patient{} rows.Scan(&pati.Pesel, &pati.Name, &pati.Surname, &pati.BirthDate, &pati.PatientState, - &pati.PatientSex) + &pati.PatientSex, &pati.PatientEmail) models = append(models, pati) } return models diff --git a/handlers.go b/handlers.go index f38cadd..be82935 100644 --- a/handlers.go +++ b/handlers.go @@ -21,7 +21,6 @@ func getAll(w http.ResponseWriter, r *http.Request) { x, _ := json.Marshal(patientsList) fmt.Fprintf(w, string(x), html.EscapeString(r.URL.Path)) - //json.NewEncoder(w).Encode(x) fmt.Println("POBRANO DANE" + table) } func sort(w http.ResponseWriter, r *http.Request) { @@ -96,7 +95,6 @@ func columnNames(w http.ResponseWriter, r *http.Request) { args := mux.Vars(r) table := args["tableName"] colNames, _ := getColumnNames(table) - //fmt.Fprint(w, colNames) json.NewEncoder(w).Encode(colNames) fmt.Println("POBRANO COLUMN NAMES " + table) } @@ -104,7 +102,6 @@ func columnTypes(w http.ResponseWriter, r *http.Request) { args := mux.Vars(r) table := args["tableName"] colNames, _ := getColumnTypes(table) - //fmt.Fprint(w, colNames) json.NewEncoder(w).Encode(colNames) fmt.Println("POBRANO COLUMN TYPES " + table) }