Skip to content

Commit

Permalink
added mentor roles (#93)
Browse files Browse the repository at this point in the history
* user search facets patch (#70)

* 4.8.15 dev v1 (#71)

* user search facets patch

* user search facets patch

* 4.8.15 dev v1 (#72)

* user search facets patch

* user search facets patch

* user search facets patch

* user search facets patch

* 4.8.15 dev v1 (#73)

* user search facets patch

* user search facets patch

* user search facets patch

* user search facets patch

* user search facets patch

* user search facets patch

* kafka topic after user profile update

* logger added

* mentoring topic data updated

* mentor roels added in user private read

* added constants

---------

Co-authored-by: anilkumarkammalapalli <[email protected]>
  • Loading branch information
shankaragoudab and anilkumarkammalapalli authored Jul 25, 2024
1 parent 773b67e commit 9f4e088
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ public final class JsonKey {
public static final String FIRST_NAME_LOWER_CASE = "firstname";
public static final String PHONE_CAPS = "Phone";
public static final String EMAIL_CAPS = "Email";

public static final String MENTORING_ROLES = "mentoring.roles";
public static final String MENTORING = "mentoring";
private JsonKey() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ kafka_user_first_login_event_topic= dev.user.first.login
otpValidationSecretKey=secretKey
otpExpirationTimeToken=300000
kafka_mentorship_user_update_topic=dev.mentorship.user.update
mentoring.roles= MENTOR

Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ public Response getUserProfileData(Request actorMessage) {
result.put(JsonKey.IDENTIFIER, userId);

mapUserRoles(result);
if(result.containsKey(JsonKey.ROLES) && CollectionUtils.isNotEmpty((Collection) result.get(JsonKey.ROLES))){
List<String> mentoringRoles = new ArrayList<>();
List<String> roles = (List<String>) result.get(JsonKey.ROLES);
List<String> mentorRoles = List.of(ProjectUtil.getConfigValue(JsonKey.MENTORING_ROLES).split(","));
for (String element : roles) {
if (mentorRoles.contains(element)) {
mentoringRoles.add(element);
}
}
if (!mentorRoles.isEmpty()){
result.put("mentoring",mentoringRoles);
}
}

// Record the start time for measuring the execution time.
long startTime = System.currentTimeMillis();
Expand Down

0 comments on commit 9f4e088

Please sign in to comment.