From 299d0512d3e5e33ff87a7f6e892e32803dca54cf Mon Sep 17 00:00:00 2001 From: shankaragoudab <140387294+shankaragoudab@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:35:57 +0530 Subject: [PATCH] recommend content api changes for the gyan karmayogi (#534) changes made in the construction of url --- .../org/sunbird/common/util/CbExtServerProperties.java | 8 ++++++++ src/main/java/org/sunbird/common/util/Constants.java | 1 + .../org/sunbird/user/service/UserUtilityServiceImpl.java | 9 +++++++-- src/main/resources/application.properties | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sunbird/common/util/CbExtServerProperties.java b/src/main/java/org/sunbird/common/util/CbExtServerProperties.java index 9ae2bf218..1f88f9dd0 100644 --- a/src/main/java/org/sunbird/common/util/CbExtServerProperties.java +++ b/src/main/java/org/sunbird/common/util/CbExtServerProperties.java @@ -714,6 +714,9 @@ public void setRedisWheeboxKey(String redisWheeboxKey) { @Value("${sector.framework.name}") private String sectorFrameworkName; + @Value("${domain.url}") + private String domainUrl; + public boolean qListFromCacheEnabled() { return qListFromCacheEnabled; } @@ -2523,4 +2526,9 @@ public String getSectorFrameworkName() { public void setSectorFrameworkName(String sectorFrameworkName) { this.sectorFrameworkName = sectorFrameworkName; } + + public void setDomainUrl(String domainUrl) {this.domainUrl = domainUrl;} + + public String getDomainUrl() {return domainUrl;} + } \ No newline at end of file diff --git a/src/main/java/org/sunbird/common/util/Constants.java b/src/main/java/org/sunbird/common/util/Constants.java index 5f1bc1fbe..87c7dd62b 100644 --- a/src/main/java/org/sunbird/common/util/Constants.java +++ b/src/main/java/org/sunbird/common/util/Constants.java @@ -1023,6 +1023,7 @@ public class Constants { public static final String CODE = "code"; public static final String PARENTS = "parents"; public static final String SUB_SECTORS = "subsectors"; + public static final String COURSE_LINK = "courseLink"; private Constants() { throw new IllegalStateException("Utility class"); diff --git a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java index 12a112856..54b078b3a 100644 --- a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java +++ b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java @@ -827,10 +827,15 @@ public SBApiResponse recommendContent(String authUserToken, Map emailResponseList.add(email); } } + logger.info("emailist : " + emailResponseList); + StringBuilder link = new StringBuilder(); + if(requestData.containsKey(Constants.COURSE_LINK) && StringUtils.isNotEmpty((String)requestData.get(Constants.COURSE_LINK))){ + link.append(serverConfig.getDomainUrl()).append((String)requestData.get(Constants.COURSE_LINK)); + }else { + link.append(serverConfig.getCourseLinkUrl()).append(requestData.get(Constants.COURSE_ID)).append("/").append(Constants.OVERVIEW); + } if (!emailResponseList.isEmpty()) { - StringBuilder link = new StringBuilder(); - link.append(serverConfig.getCourseLinkUrl()).append(requestData.get(Constants.COURSE_ID)).append("/").append(Constants.OVERVIEW); Map mailNotificationDetails = new HashMap<>(); mailNotificationDetails.put(Constants.RECIPIENT_EMAILS, emailResponseList); mailNotificationDetails.put(Constants.COURSE_NAME, requestData.get(Constants.COURSE_NAME)); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 649fc44c8..c18af70f3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -403,3 +403,4 @@ operational.report.folder.name=zipReports/mount/data/analytics/reports/zip operational.report.file.name=zipReports2.zip pdf-generator-service-host=http://pdf-generator-service:3000 pdf-generator-svg-to-pdf-url=/public/v8/course/batch/cert/download/mobile +domain.url =https://igot-dev.in/