func (service *telOFunService) createStation(soapStation SoapStation) station.Station { stationObject := station.Station{} stationObject.StationId = soapStation.Id stationObject.StationName = soapStation.EnglishName stationObject.Location = location.NewLocationFromString(soapStation.Latitude, soapStation.Longitude, soapStation.EnglishDescription) stationObject.Status = station.Status{soapStation.AvailableBike, soapStation.AvailableDocks} return stationObject }
func (service *bicingService) createStation(bicingJsonStation bicingJsonStation) station.Station { stationObject := station.Station{} stationObject.StationId = bicingJsonStation.StationID stationObject.StationName = bicingJsonStation.StationName availableBikes, _ := strconv.ParseInt(bicingJsonStation.StationAvailableBikes, 10, 0) availableDocks, _ := strconv.ParseInt(bicingJsonStation.StationFreeSlot, 10, 0) stationObject.Status = station.Status{ availableBikes, availableDocks, } stationObject.Location = location.NewLocationFromString(bicingJsonStation.Latitue, bicingJsonStation.Longitude, bicingJsonStation.StationName) return stationObject }