Quellcode durchsuchen

added key:method:<response> on response
changes to null response for exception

Pat vor 7 Jahren
Ursprung
Commit
2b465ab6d6

+ 0 - 1
GabonTelMobicashMobileAppHelper/.gitignore

@@ -1,2 +1 @@
-/build/
 /target/

+ 5 - 1
GabonTelMobicashMobileAppHelper/src/main/java/com/psi/gabontel/mobileapp/thirdparty/helper/InitializerBean.java

@@ -74,7 +74,11 @@ public class InitializerBean {
             return auth.runCallable(new BeanCaller(prop,jndi,Arrays.asList(params)));
         } catch (Exception e) {
             log.error(key,e);
+            if(e.getCause().getClass().getSimpleName().equals("IllegalArgumentException")) {
+                return e.getCause().getMessage();
+            }
+            return "System busy. Please try again later.";
         }
-        return null;
+        //return null;
     }
 }

+ 7 - 5
GabonTelMobicashMobileAppHelper/src/main/java/com/psi/gabontel/mobileapp/thirdparty/helper/MobileAppThirdPartyHelper.java

@@ -24,19 +24,21 @@ public class MobileAppThirdPartyHelper  implements AppManagerFunction {
 	
 	@Override
 	public AppMessage manageTransaction(String refid, String msisdn, String message, Map<String, String> syntax) {
-		try {
-    		String method  =  syntax.get("method");
+	    String key  =  syntax.get("key");
+        String method  =  syntax.get("method");
+        String respmessage = key + ":" + method + ":";
+	    try {
     		if(InitializerBean.containsKey(method)) {
     			String[] paramarr = syntax.get("mparam").split("\\|");    			
-    			return new Message(0,0,new JsonResponse(0,InitializerBean.callUssd(method, paramarr)).toString());
+    			return new Message(0,0,respmessage + new JsonResponse(0,InitializerBean.callUssd(method, paramarr)).toString());
     		}else {
-    			return new Message(99,0,new JsonResponse(99,"System is busy").toString());
+    			return new Message(99,0,respmessage + new JsonResponse(99,"System is busy").toString());
     		}
 		
 		}catch(Exception e) {
 			log.error("Error: Refid:"+refid+"|" ,e);
 		}
-		return new Message(99,0,new JsonResponse(99,"System is busy").toString());
+		return new Message(99,0,respmessage + new JsonResponse(99,"System is busy").toString());
 		
 	}
 }

+ 1 - 1
GabonTelMobicashMobileAppHelper/src/main/java/com/psi/gabontel/mobileapp/thirdparty/helper/Test.java

@@ -21,7 +21,7 @@ import com.psi.ussd.interfaces.UssdReceiverFunction;
 public class Test {
     public static void main(String[] args) throws Exception {
         
-        appman();
+        //appman();
         //ussd();
         //test1();
     }