Mobile Networking operations. - HunYahiko/smart-parking-system GitHub Wiki

Networking operations

Authentication

@POST("auth/sing-in") Single<Response<AuthenticationResponse>> singIn(@Body LoginDTO loginDTO);

  • is used to sing in an user into the system and retrieve a token.

@POST("users") Single<Response<Void>> singUp(@Body UserDTO userDTO);

  • is used to sign up a new user.

Parking

@GET("parkings/locations") Single<Response<List<ParkingLocationDTO>>> getParkingsLocations();

  • is used to retrieve information about parking's location, which will be displayed as markers on the map.

@GET("parkings/{id}/info/quick") Single<Response<QuickParkingInfoDTO>> getQuickParkingInfo(@Path("id") UUID parkingId);

  • is used to retrieve some basic information about each parking like name, total parking spots, and free parking spots.

Booking

@POST("booking/") Completable bookASpot(@Body ParkingDTO parkingDTO);

  • is used to book a parking spot in a selected parking.

@GET("booking/") Single<List<BookRequestDto>> getAllBookRequests();

  • is used to retrieve all open book requests of logged in user.

@POST("booking/confirm/{id}") Completable confirmArrival(@Path("id")UUID bookRequestId);

  • is used to confirm the arrival to a booked parking spot.

All the networking operations were performed in an async way, thus the usage of classes from reactive IO.

To actually perform the requests, Retrofit 2 library was used.

⚠️ **GitHub.com Fallback** ⚠️