Add the initial Retrofit REST API code

Note: Completely untested, but it looks cool!
This commit is contained in:
bspeice 2013-10-16 14:39:43 -04:00
parent f65e57313a
commit 7cefd630d3
6 changed files with 60 additions and 36 deletions

View File

@ -0,0 +1,15 @@
package com.uncc.gameday.registration;
import java.util.List;
import retrofit.http.*;
public interface GamedayService {
@GET("/lots/")
List<ParkingLot> listLots();
@POST("/rating/")
void rateLot(@Body ParkingRating rating, @Body ParkingChoices parking_lot);
}

View File

@ -0,0 +1,19 @@
package com.uncc.gameday.registration;
public enum ParkingChoices {
GREEN ("GREEN"),
BLACK ("BLACK"),
RED ("RED"),
BLUE ("BLUE"),
SILVER ("SILVER"),
ORANGE ("ORANGE"),
YELLOW ("YELLOW"),
PURPLE ("PURPLE"),
PINK ("PINK"),
WHITE ("WHITE"),
GOLD ("GOLD");
String choice;
ParkingChoices(String choice) { this.choice = choice; }
public String getValue() { return choice; }
}

View File

@ -0,0 +1,8 @@
package com.uncc.gameday.registration;
public class ParkingLot {
ParkingChoices location;
int filled_pct;
}

View File

@ -0,0 +1,6 @@
package com.uncc.gameday.registration;
public class ParkingRating {
ParkingChoices parking_lot;
RatingChoices rating;
}

View File

@ -0,0 +1,12 @@
package com.uncc.gameday.registration;
public enum RatingChoices {
EMPTY ("EMP"),
SCATTERED ("SCT"),
BUSY ("BSY"),
FULL ("FLL");
String choice;
RatingChoices(String choice) { this.choice = choice; }
public String getValue() { return choice; }
}

View File

@ -1,36 +0,0 @@
package com.uncc.gameday.registration;
import java.util.List;
import com.uncc.gameday.GameDay;
import com.uncc.gameday.R;
/* Client used for interfacing with the server API */
public class RegistrationClient {
private String serverName = GameDay.getAppContext().getString(R.string.server_hostname);
public void registerAttendee(Attendee a) {
}
public List<Attendee> listAttendeeNames() {
// List all attendees to the game
return null;
}
public List<Attendee> listAttendeeNames(int begin, int end) {
// List attendees to the game supporting pagination
return null;
}
public Attendee getAttendee(int id) {
// Get the full information for a single attendee
return null;
}
}