← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21189: SmsController, restful style fixes

 

Merge authors:
  Zubair (rajazubair-asghar)
------------------------------------------------------------
revno: 21189 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-11-24 17:58:49 +0100
message:
  SmsController, restful style fixes
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsController.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsController.java	2015-11-24 13:14:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsController.java	2015-11-24 16:58:49 +0000
@@ -51,17 +51,9 @@
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
+@RequestMapping( value = "/sms" )
 public class SmsController
 {
-    public static final String SENDSMS = "/sendSMS";
-    public static final String SENDSMSTOALL = "/sendSMSToAll";
-    public static final String GETAALLINBOUNDSMS = "/getAllInboundSMS";
-    public static final String GETALLOUTBOUNDSMS = "/getAllOutboundSMS";
-    public static final String RECEIVESMS = "/receiveSMS";
-    public static final String GETSMSSTATUS = "/getSMSStatus";
-    public static final String DELETESMS = "/deleteSMS";
-    public static final String DELETEALLSMS = "/deleteAllSMS";
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -80,7 +72,7 @@
     // -------------------------------------------------------------------------
 
     @PreAuthorize( "hasRole('ALL') or hasRole(' F_MOBILE_SENDSMS')" )
-    @RequestMapping( value = SENDSMS, method = RequestMethod.POST )
+    @RequestMapping( value = "/outbound", method = RequestMethod.POST )
     public void sendSMSMessage( @RequestParam String recipient, @RequestParam String message,
         HttpServletResponse response, HttpServletRequest request )
             throws WebMessageException
@@ -108,7 +100,7 @@
     }
 
     @PreAuthorize( "hasRole('ALL') or hasRole(' F_MOBILE_SENDSMS')" )
-    @RequestMapping( value = SENDSMS, method = RequestMethod.POST, consumes = "application/json" )
+    @RequestMapping( value = "/outbound", method = RequestMethod.POST, consumes = "application/json" )
     public void sendSMSMessage( @RequestBody Map<String, Object> jsonMessage, HttpServletResponse response,
         HttpServletRequest request )
             throws WebMessageException
@@ -131,7 +123,7 @@
         }
     }
 
-    @RequestMapping( value = RECEIVESMS, method = RequestMethod.POST )
+    @RequestMapping( value = "/inbound", method = RequestMethod.POST )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_MOBILE_SETTINGS')" )
     public void receiveSMSMessage( @RequestParam String originator,
         @RequestParam( required = false ) String received_time, @RequestParam String message,
@@ -154,7 +146,7 @@
         webMessageService.send( WebMessageUtils.ok( "Received" ), response, request );
     }
 
-    @RequestMapping( value = RECEIVESMS, method = RequestMethod.POST, consumes = "application/json" )
+    @RequestMapping( value = "/inbound", method = RequestMethod.POST, consumes = "application/json" )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_MOBILE_SETTINGS')" )
     public void receiveSMSMessage( @RequestBody Map<String, Object> jsonMassage, HttpServletRequest request,
         HttpServletResponse response )