mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	Add code to grab parking lot locations from the server
Hindsight being what it is, this would have been just as easy to write client-side. May end up doing that.
This commit is contained in:
		@ -1,6 +1,8 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
import retrofit.RestAdapter;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
@ -41,4 +43,18 @@ public class ParkingClient {
 | 
			
		||||
	public void rateLot(ParkingRating rating) {
 | 
			
		||||
		gds.rateLot(rating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public Map<ParkingLot, ParkingLocation> listLotLocation(ParkingLot p){
 | 
			
		||||
		HashMap<ParkingLot, ParkingLocation> mMap = new HashMap<ParkingLot, ParkingLocation>();
 | 
			
		||||
		mMap.put(p, gds.listLotLocation(p.getLocation().getValue()));
 | 
			
		||||
		return mMap;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public Map<ParkingLot, ParkingLocation> listLotLocation(ParkingChoices c) {
 | 
			
		||||
		HashMap<ParkingLot, ParkingLocation> mMap = new HashMap<ParkingLot, ParkingLocation>();
 | 
			
		||||
		ParkingLot mParkingLot = new ParkingLot();
 | 
			
		||||
		mParkingLot.setLocation(c);
 | 
			
		||||
		mMap.put(mParkingLot, gds.listLotLocation(c.getValue()));
 | 
			
		||||
		return mMap;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										27
									
								
								src/com/uncc/gameday/parking/ParkingLocation.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/com/uncc/gameday/parking/ParkingLocation.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
public class ParkingLocation {
 | 
			
		||||
 | 
			
		||||
	private int latitude;
 | 
			
		||||
	private int longitude;
 | 
			
		||||
	private String label;
 | 
			
		||||
	
 | 
			
		||||
	public int getLatitude() {
 | 
			
		||||
		return latitude;
 | 
			
		||||
	}
 | 
			
		||||
	public void setLatitude(int latitude) {
 | 
			
		||||
		this.latitude = latitude;
 | 
			
		||||
	}
 | 
			
		||||
	public int getLongitude() {
 | 
			
		||||
		return longitude;
 | 
			
		||||
	}
 | 
			
		||||
	public void setLongitude(int longitude) {
 | 
			
		||||
		this.longitude = longitude;
 | 
			
		||||
	}
 | 
			
		||||
	public String getLabel() {
 | 
			
		||||
		return label;
 | 
			
		||||
	}
 | 
			
		||||
	public void setLabel(String label) {
 | 
			
		||||
		this.label = label;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -2,6 +2,7 @@ package com.uncc.gameday.rest;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.parking.ParkingLocation;
 | 
			
		||||
import com.uncc.gameday.parking.ParkingLot;
 | 
			
		||||
import com.uncc.gameday.parking.ParkingRating;
 | 
			
		||||
import com.uncc.gameday.registration.Attendee;
 | 
			
		||||
@ -20,6 +21,9 @@ public interface GamedayService {
 | 
			
		||||
	@POST("/lots/rate/")
 | 
			
		||||
	void rateLot(@Body ParkingRating p, Callback<ParkingLot> lot);
 | 
			
		||||
	
 | 
			
		||||
	@GET("/lots/{lot}/")
 | 
			
		||||
	ParkingLocation listLotLocation(@Path("lot") String lot);
 | 
			
		||||
	
 | 
			
		||||
	@GET("/register/{id}/")
 | 
			
		||||
	Attendee getUser(@Path("id") int id);
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user