@@ -204,24 +204,43 @@ public static void insertDigitalDoubleData(MultipartFile image, MultipartFile vi
204
204
System .out .println ("ORDSCalls.insertDigitalDoubleData insert complete" );
205
205
}
206
206
207
+
207
208
public static @ Nullable String getDigitalDoubleData (String email ) throws JsonProcessingException {
208
- System .out .println ("DigitalDoubles.downloaddigitaldouble lookup email:" + email );
209
- String url = AIApplication .ORDS_OMLOPSENDPOINT_URL + "modelurls/geturls/" + email ;
209
+ System .out .println ("DigitalDoubles.downloaddigitaldouble lookup email: " + email );
210
+
211
+ // Use POST instead of GET
212
+ String url = AIApplication .ORDS_OMLOPSENDPOINT_URL + "modelurls/geturls" ;
213
+
214
+ // Prepare headers
210
215
HttpHeaders headers = new HttpHeaders ();
211
216
headers .setContentType (MediaType .APPLICATION_JSON );
212
- HttpEntity <String > entity = new HttpEntity <>(headers );
217
+
218
+ // Prepare the request body (email passed in the request body)
219
+ Map <String , String > requestBody = new HashMap <>();
220
+ requestBody .put ("p_participant_email" , email );
221
+
222
+ // Wrap the request body and headers into an HttpEntity
223
+ HttpEntity <Map <String , String >> entity = new HttpEntity <>(requestBody , headers );
224
+
225
+ // Execute the POST request using RestTemplate
213
226
ResponseEntity <String > response = new RestTemplate ().exchange (url , HttpMethod .POST , entity , String .class );
227
+
228
+ // Parse the JSON response using Jackson ObjectMapper
214
229
ObjectMapper objectMapper = new ObjectMapper ();
215
230
JsonNode rootNode = objectMapper .readTree (response .getBody ());
231
+
232
+ // Extract the fields
216
233
String modelGlbUrl = rootNode .path ("MODELGLBURL_OUT" ).asText ();
217
234
String modelFbxUrl = rootNode .path ("MODELFBXURL_OUT" ).asText ();
218
235
String modelUsdzUrl = rootNode .path ("MODELUSDZURL_OUT" ).asText ();
219
236
String thumbnailUrl = rootNode .path ("THUMBNAILURL_OUT" ).asText ();
220
237
238
+ // Print extracted URLs
221
239
System .out .println ("MODELGLBURL_OUT: " + modelGlbUrl );
222
240
System .out .println ("MODELFBXURL_OUT: " + modelFbxUrl );
223
241
System .out .println ("MODELUSDZURL_OUT: " + modelUsdzUrl );
224
242
System .out .println ("THUMBNAILURL_OUT: " + thumbnailUrl );
243
+
225
244
return modelFbxUrl ;
226
245
}
227
246
}
0 commit comments