Skip to content

Commit

Permalink
fli-iam#2388-automatic executions - front
Browse files Browse the repository at this point in the history
  • Loading branch information
jcomedouteau committed Oct 11, 2024
1 parent 1a40f78 commit 5d0a661
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.shanoir.ng.vip.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.PostConstruct;
import org.keycloak.representations.AccessTokenResponse;
import org.shanoir.ng.shared.exception.ErrorModel;
Expand Down Expand Up @@ -42,6 +44,9 @@ public void init() {
this.webClient = WebClient.create(vipUrl);
}

@Autowired
ObjectMapper mapper;

/**
*
* Get execution from <a href="https://app.swaggerhub.com/apis/CARMIN/carmin-common_api_for_research_medical_imaging_network/0.3.1#/default/getExecution">VIP API</a>
Expand Down Expand Up @@ -104,7 +109,11 @@ public Mono<VipExecutionDTO> getExecutionAsServiceAccount(int attempts, String i
* @return ExecutionDTO
*/
public Mono<VipExecutionDTO> createExecution(VipExecutionDTO execution) {

try {
LOG.error("Created execution: " + mapper.writeValueAsString(execution));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return webClient.post()
.uri(vipExecutionUri)
.headers(headers -> headers.addAll(this.getUserHttpHeaders()))
Expand Down

0 comments on commit 5d0a661

Please sign in to comment.