@@ -38,23 +38,28 @@ public PropertyManagementRestVerticle(PropertyManagementService service){
3838 this .service = service ;
3939 }
4040
41-
4241 @ Override
4342 public void start (Promise <Void > startPromise ) throws Exception {
4443 super .start ();
4544
4645 final Router router = enableRouteLoggingSupport (Router .router (vertx ));
4746
4847 // api route handler
49- /*
50- router.post(API_ADD).handler(this::apiAddUser);
51- router.get(API_RETRIEVE).handler(this::apiRetrieveUser);
52- router.get(API_RETRIEVE_ALL).handler(this::apiRetrieveAll);
53- router.patch(API_UPDATE).handler(this::apiUpdateUser);
54- router.delete(API_DELETE).handler(this::apiDeleteUser);
55- */
5648
5749 router .post (API_PROFILE_ADD ).handler (this ::addPropProfile );
50+ router .get (API_PROFILE_RETRIEVE ).handler (this ::fetcPropProfile );
51+ router .get (API_PROFILE_UPDATE ).handler (this ::editPropProfile );
52+ router .get (API_PROFILE_DELETE ).handler (this ::deletePropProfile );
53+
54+ router .get (API_AMENITY_ADD ).handler (this ::addPropAmenity );
55+ router .get (API_AMENITY_RETRIEVE_ALL ).handler (this ::fetchPropAmenities );
56+ router .get (API_AMENITY_DELETE ).handler (this ::deletePropAmenity );
57+
58+ router .get (API_ACCOM_ADD ).handler (this ::addAccommodation );
59+ router .get (API_ACCOM_RETRIEVE ).handler (this ::fetchAccommodation );
60+ router .get (API_ACCOM_RETRIEVE_ALL ).handler (this ::fetchAccommodations );
61+ router .get (API_ACCOM_UPDATE ).handler (this ::editPropAccommodation );
62+ router .get (API_ACCOM_DELETE ).handler (this ::deleteAccommodation );
5863
5964 String host = config ().getString ("property.http.address" , "0.0.0.0" );
6065 int port = config ().getInteger ("property.http.port" , 8085 );
@@ -79,7 +84,7 @@ private void fetcPropProfile(RoutingContext context){
7984 }
8085
8186 private void deletePropProfile (RoutingContext context ){
82- String serialNo = context .request ().getParam ("Id " );
87+ String serialNo = context .request ().getParam ("id " );
8388 service .deleteProfile (serialNo , deleteResultHandler (context ));
8489 }
8590
@@ -96,9 +101,8 @@ private void fetchPropAmenities(RoutingContext context){
96101 service .retrieveAmenities (resultHandlerNonEmpty (context ));
97102 }
98103
99-
100104 private void deletePropAmenity (RoutingContext context ){
101- String serialNo = context .request ().getParam ("Id " );
105+ String serialNo = context .request ().getParam ("id " );
102106 service .deleteAmenity (serialNo , deleteResultHandler (context ));
103107 }
104108
@@ -107,7 +111,6 @@ private void addAccommodation(RoutingContext context){
107111 service .createAccommodation (accommodation , resultHandler (context , 201 ));
108112 }
109113
110-
111114 private void fetchAccommodations (RoutingContext context ){
112115 service .retrieveAllAccommodations (resultHandlerNonEmpty (context ));
113116 }
@@ -117,12 +120,15 @@ private void fetchAccommodation(RoutingContext context){
117120 service .retrieveAccommodation (id , resultHandlerNonEmpty (context ));
118121 }
119122
120-
121123 private void deleteAccommodation (RoutingContext context ){
122- String serialNo = context .request ().getParam ("Id " );
124+ String serialNo = context .request ().getParam ("id " );
123125 service .deleteAccommodation (serialNo , deleteResultHandler (context ));
124126 }
125127
128+ private void editPropAccommodation (RoutingContext context ){
129+ notImplemented (context );
130+ }
131+
126132}
127133
128134
0 commit comments