Skip to content

Commit

Permalink
enable mandatory fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gsergiu committed May 28, 2024
1 parent 5aafd81 commit 102c120
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
public class ETranslationTranslationService extends AbstractTranslationService {

private static final Logger LOGGER = LogManager.getLogger(ETranslationTranslationService.class);

public static final String baseUrlTests="base-url-for-testing";
public static final String markupDelimiter="\ndeenPVsaOg\n";//base64 encoded string (as in generateRedisKey()) with new lines
public static final String markupDelimiterWithoutNewline="deenPVsaOg";
public static final String eTranslationErrorCallbackIndicator="eTranslationErrorCallback";
public static final String eTranslationCallbackRelativeUrl="/etranslation/callback";
public static final String eTranslationErrorCallbackRelativeUrl="/etranslation/error-callback";

private String serviceId;
private final String baseUrl;
private final String domain;
Expand All @@ -43,12 +49,6 @@ public class ETranslationTranslationService extends AbstractTranslationService {
private final String credentialPwd;
private final int maxWaitMillisec;
private final RedisMessageListenerContainer redisMessageListenerContainer;
public static final String baseUrlTests="base-url-for-testing";
public static final String markupDelimiter="\ndeenPVsaOg\n";//base64 encoded string (as in generateRedisKey()) with new lines
public static final String markupDelimiterWithoutNewline="deenPVsaOg";
public static final String eTranslationErrorCallbackIndicator="eTranslationErrorCallback";
public static final String eTranslationCallbackRelativeUrl="/etranslation/callback";
public static final String eTranslationErrorCallbackRelativeUrl="/etranslation/error-callback";

public ETranslationTranslationService(String etranslationServiceBaseUrl, String domain, String translationApiBaseUrl, int maxWaitMillisec,
String username, String password, RedisMessageListenerContainer redisMessageListenerContainer) throws TranslationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public ETranslationCallbackController(RedisTemplate<String, CachedTranslation> r
@PostMapping(value = ETranslationTranslationService.eTranslationCallbackRelativeUrl)
public void eTranslationCallbackPost(
@RequestParam(value = "target-language", required = false) String targetLanguage,
@RequestParam(value = "translated-text", required = false) String translatedTextSnippet,
@RequestParam(value = "request-id", required = false) String requestId,
@RequestParam(value = "external-reference", required = false) String externalReference,
@RequestParam(value = "translated-text", required = true) String translatedTextSnippet,
@RequestParam(value = "request-id", required = true) String requestId,
@RequestParam(value = "external-reference", required = true) String externalReference,
@RequestBody(required = false) String body) {
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("eTranslation callback has been received with the request-id: {}, and the"
Expand All @@ -47,9 +47,9 @@ public void eTranslationCallbackPost(
@GetMapping(value = ETranslationTranslationService.eTranslationCallbackRelativeUrl)
public void eTranslationCallbackGet(
@RequestParam(value = "target-language", required = false) String targetLanguage,
@RequestParam(value = "translated-text", required = false) String translatedTextSnippet,
@RequestParam(value = "request-id", required = false) String requestId,
@RequestParam(value = "external-reference", required = false) String externalReference) {
@RequestParam(value = "translated-text", required = true) String translatedTextSnippet,
@RequestParam(value = "request-id", required = true) String requestId,
@RequestParam(value = "external-reference", required = true) String externalReference) {
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("eTranslation callback has been received with the request-id: {}, and the"
+ " external-reference: {}", LoggingUtils.sanitizeUserInput(requestId), LoggingUtils.sanitizeUserInput(externalReference));
Expand Down

0 comments on commit 102c120

Please sign in to comment.