@@ -2890,32 +2890,34 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTFusion)) || cl
28902890 tl (4 , i18nGlobale .getString (I18n .var_rechercher ), classeApiClasseNomSimple , i18nGlobale .getString (I18n .var_Liste ), "(" , i18nGlobale .getString (I18n .var_requeteSite ), ", false, true, true).onSuccess(" , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , " -> {" );
28912891 tl (5 , "try {" );
28922892 tl (6 , classeNomSimple , " o = " , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".first();" );
2893- tl (6 , "if(o != null && " , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".getResponse().getResponse().getNumFound() == 1) {" );
2894- tl (7 , classePartsRequeteApi .nomSimple (classeLangueNom ), " " , i18nGlobale .getString (I18n .var_requeteApi ), " = new " , classePartsRequeteApi .nomSimple (classeLangueNom ), "();" );
2895- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".setRows(1L);" );
2896- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".setNumFound(1L);" );
2897- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".setNumPATCH(0L);" );
2898- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), "." , i18nGlobale .getString (I18n .var_initLoin ), classePartsRequeteApi .nomSimple (classeLangueNom ), "(" , i18nGlobale .getString (I18n .var_requeteSite ), ");" );
2899- tl (7 , i18nGlobale .getString (I18n .var_requeteSite ), ".set" , i18nGlobale .getString (I18n .var_RequeteApi ), "_(" , i18nGlobale .getString (I18n .var_requeteApi ), ");" );
2900- tl (7 , "if(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_requeteService ), ".getParams()).map(p -> p.getJsonObject(\" query\" )).map( q -> q.getJsonArray(\" var\" )).orElse(new JsonArray()).stream().filter(s -> \" " , i18nGlobale .getString (I18n .var_recharger ), ":false\" .equals(s)).count() > 0L) {" );
2901- tl (8 , i18nGlobale .getString (I18n .var_requeteSite ), ".get" , i18nGlobale .getString (I18n .var_Requete ), "Vars().put( \" " , i18nGlobale .getString (I18n .var_recharger ), "\" , \" false\" );" );
2902- tl (7 , "}" );
2893+ tl (6 , classePartsRequeteApi .nomSimple (classeLangueNom ), " " , i18nGlobale .getString (I18n .var_requeteApi ), " = new " , classePartsRequeteApi .nomSimple (classeLangueNom ), "();" );
2894+ tl (6 , i18nGlobale .getString (I18n .var_requeteApi ), ".setRows(1L);" );
2895+ tl (6 , i18nGlobale .getString (I18n .var_requeteApi ), ".setNumFound(1L);" );
2896+ tl (6 , i18nGlobale .getString (I18n .var_requeteApi ), ".setNumPATCH(0L);" );
2897+ tl (6 , i18nGlobale .getString (I18n .var_requeteApi ), "." , i18nGlobale .getString (I18n .var_initLoin ), classePartsRequeteApi .nomSimple (classeLangueNom ), "(" , i18nGlobale .getString (I18n .var_requeteSite ), ");" );
2898+ tl (6 , i18nGlobale .getString (I18n .var_requeteSite ), ".set" , i18nGlobale .getString (I18n .var_RequeteApi ), "_(" , i18nGlobale .getString (I18n .var_requeteApi ), ");" );
2899+ tl (6 , "if(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_requeteService ), ".getParams()).map(p -> p.getJsonObject(\" query\" )).map( q -> q.getJsonArray(\" var\" )).orElse(new JsonArray()).stream().filter(s -> \" " , i18nGlobale .getString (I18n .var_recharger ), ":false\" .equals(s)).count() > 0L) {" );
2900+ tl (7 , i18nGlobale .getString (I18n .var_requeteSite ), ".get" , i18nGlobale .getString (I18n .var_Requete ), "Vars().put( \" " , i18nGlobale .getString (I18n .var_recharger ), "\" , \" false\" );" );
2901+ tl (6 , "}" );
2902+ tl (6 , classeNomSimple , " o2;" );
2903+ tl (6 , "if(o != null) {" );
29032904 tl (7 , "if(" , i18nGlobale .getString (I18n .var_requeteApi ), ".getNumFound() == 1L)" );
29042905 tl (8 , i18nGlobale .getString (I18n .var_requeteApi ), ".setOriginal(o);" );
2905- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".setId(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".first()).map(o2 -> o2 .get" , StringUtils .capitalize (classeVarId ), "().toString()).orElse(null));" );
2906+ tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".setId(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".first()).map(o3 -> o3 .get" , StringUtils .capitalize (classeVarId ), "().toString()).orElse(null));" );
29062907 if (classeModele )
2907- tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".set" , i18nGlobale .getString (I18n .var_SolrId ), "(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".first()).map(o2 -> o2 .get" , solrIdCapitalise , "()).orElse(null));" );
2908+ tl (7 , i18nGlobale .getString (I18n .var_requeteApi ), ".set" , i18nGlobale .getString (I18n .var_SolrId ), "(Optional.ofNullable(" , i18nGlobale .getString (I18n .var_liste ), classeNomSimple , ".first()).map(o3 -> o3 .get" , solrIdCapitalise , "()).orElse(null));" );
29082909 tl (7 , "JsonObject jsonObject = JsonObject.mapFrom(o);" );
2909- tl (7 , classeNomSimple , " o2 = jsonObject.mapTo(" , classeNomSimple , ".class);" );
2910+ tl (7 , " o2 = jsonObject.mapTo(" , classeNomSimple , ".class);" );
29102911 tl (7 , "o2.set" , i18nGlobale .getString (I18n .var_RequeteSite ), "_(" , i18nGlobale .getString (I18n .var_requeteSite ), ");" );
2911- tl (7 , classeApiOperationIdMethode , "Future(o2, false).onSuccess(o3 -> {" );
2912- tl (8 , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));" );
2913- tl (7 , "}).onFailure(ex -> {" );
2914- tl (8 , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ".handle(Future.failedFuture(ex));" );
2915- tl (7 , "});" );
29162912 tl (6 , "} else {" );
2917- tl (7 , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));" );
2913+ tl (7 , "o2 = body.mapTo(" , classeNomSimple , ".class);" );
2914+ tl (7 , "o2.set" , i18nGlobale .getString (I18n .var_RequeteSite ), "_(" , i18nGlobale .getString (I18n .var_requeteSite ), ");" );
29182915 tl (6 , "}" );
2916+ tl (6 , classeApiOperationIdMethode , "Future(o2, false).onSuccess(o3 -> {" );
2917+ tl (7 , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));" );
2918+ tl (6 , "}).onFailure(ex -> {" );
2919+ tl (7 , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ".handle(Future.failedFuture(ex));" );
2920+ tl (6 , "});" );
29192921 tl (5 , "} catch(Exception ex) {" );
29202922 tl (6 , "LOG.error(String.format(\" " , classeApiOperationIdMethode , " " , i18nGlobale .getString (I18n .str_a_échoué ), ". \" ), ex);" );
29212923 tl (6 , i18nGlobale .getString (I18n .var_erreur ), "(" , i18nGlobale .getString (I18n .var_requeteSite ), ", " , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ", ex);" );
0 commit comments