BACKLOG-14: add static context root

This commit is contained in:
Vasil Khramov 2021-12-24 14:44:15 +03:00
parent 3f64a9ee56
commit d1f27406cf
No known key found for this signature in database
GPG Key ID: 1B6B98F47B5EC1C1
3 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import com.rbkmoney.proxy.mocketbank.mpi.handler.mpi20.CardHandler;
import com.rbkmoney.proxy.mocketbank.mpi.model.mpi20.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -17,6 +18,9 @@ public class Mpi20Controller {
private final List<CardHandler> cardHandlers;
@Value("${static.context.root}")
private String staticContextRoot;
@PostMapping(value = "/prepare")
public PreparationResponse prepare(@RequestBody PreparationRequest preparationRequest) {
return cardHandlers.stream()
@ -52,6 +56,7 @@ public class Mpi20Controller {
model.setViewName("threeDsMethod_2.0_form");
model.addObject("action", termUrl);
model.addObject("threeDSMethodData", threeDSMethodData);
model.addObject("staticContextRoot", staticContextRoot);
log.info("Form threeDsMethod 2.0 show the form");
return model;
}

View File

@ -42,7 +42,10 @@ mpi20:
callbackUrl: http://127.0.0.1:8018
pathThreeDsMethodUrl: "/mpi20/three_ds_method"
pathAcsUrl: "/mpi20/acs"
---
static:
context:
root: /mocketbank-mpi
---
fixture:
cards: classpath:fixture/cards.csv

View File

@ -11,6 +11,9 @@
</form>
</body>
<script type="text/javascript" charset="utf-8" th:src="@{/js/submit.js}" th:inline="javascript"></script>
<script type="text/javascript"
charset="utf-8"
th:src="@{{context}/js/submit.js(context=${staticContextRoot})}"
th:inline="javascript"></script>
</html>