nitsshukla-zz / AgodaBooking

0 stars 0 forks source link

this can be more springy way #3

Open amit5881 opened 3 years ago

amit5881 commented 3 years ago

https://github.com/nitsshukla/AgodaBooking/blob/24095baf0c394ba4ae17d8e56d237e8eaaa461ff/src/main/java/com/agoda/booking/tracker/controller/BookingController.java#L48

public @interface BulkBookingRequest { String inputType; }

And use a factory Method: Map<String, BookingService> factory = Map.of("csv", BookingCSVServiceImpl.class);

Entry Point:

@BulkBookingRequest(inputType = "csv")
public void swallowBulkBookingRequest() {
   factory.get(inputType)
}
nitsshukla-zz commented 3 years ago

I'm planning to take CSV as cli argument, if user wants to operate with CSV. Will push it in next commit