Skip to content

Commit

Permalink
recommend content api changes for the gyan karmayogi (#534)
Browse files Browse the repository at this point in the history
changes made in the construction of url
  • Loading branch information
shankaragoudab authored Apr 19, 2024
1 parent 6572446 commit 299d051
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;}

}
1 change: 1 addition & 0 deletions src/main/java/org/sunbird/common/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,15 @@ public SBApiResponse recommendContent(String authUserToken, Map<String, Object>
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<String, Object> mailNotificationDetails = new HashMap<>();
mailNotificationDetails.put(Constants.RECIPIENT_EMAILS, emailResponseList);
mailNotificationDetails.put(Constants.COURSE_NAME, requestData.get(Constants.COURSE_NAME));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 299d051

Please sign in to comment.