From acf8f81d6c1bcd5b499c8655556f95f63dfe3423 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Thu, 8 Apr 2021 17:52:33 +0800 Subject: [PATCH] =?UTF-8?q?adas=E8=AF=86=E5=88=AB=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BD=BF=E7=94=A8adas=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/intent/MockIntentHandler.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java index ce3af58d54..c2c3812f6b 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java @@ -841,23 +841,25 @@ public class MockIntentHandler implements IntentHandler { } } -// List< ADASRecognizedResult > allList = new ArrayList<>(); - JSONArray jsonArray = new JSONArray( ); + List< ADASRecognizedResult > allList = new ArrayList<>(); for ( BufferedReader reader : readers ) { String line = reader.readLine(); -// ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class ); - jsonArray.put( line ); -// if ( adasRecognizedResult != null ) { -// allList.add( adasRecognizedResult ); -// } + ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class ); + if ( adasRecognizedResult != null ) { + allList.add( adasRecognizedResult ); + } } - JSONObject object = new JSONObject(); - object.put( "action", "view" ); - object.put( "models", jsonArray ); + AdasRec adasRec = new AdasRec(); + adasRec.models = allList; - MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( object.toString() ); + MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( GsonUtil.jsonFromObject( adasRec ) ); Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" ); return true; } + + public static class AdasRec{ + public String action = "view"; + public List models; + } }