From d28fe3faec53cce21621da6df623c0f445c7c535 Mon Sep 17 00:00:00 2001 From: fpellet Date: Sat, 11 Jan 2025 11:22:38 +0100 Subject: [PATCH] add link on profile --- src/main/java/com/erudika/scoold/core/Profile.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/erudika/scoold/core/Profile.java b/src/main/java/com/erudika/scoold/core/Profile.java index c91c3958..16b61cd5 100755 --- a/src/main/java/com/erudika/scoold/core/Profile.java +++ b/src/main/java/com/erudika/scoold/core/Profile.java @@ -22,6 +22,7 @@ import com.erudika.para.core.annotations.Stored; import com.erudika.para.core.utils.Para; import com.erudika.para.core.utils.Utils; +import com.erudika.scoold.ScooldServer; import com.erudika.scoold.utils.ScooldUtils; import com.fasterxml.jackson.annotation.JsonIgnore; import java.time.Instant; @@ -752,6 +753,13 @@ public int countNewReports() { return newreports; } + public String getProfileLink() { + String name = StringUtils.stripAccents(Utils.noSpaces(Utils.stripAndTrim(this.getName()), "-")); + String seoName = StringUtils.isBlank(name) ? "" : ("/" + name); + String pid = "/" + Utils.urlEncode(this.getCreatorid()) + seoName; + return ScooldServer.PROFILELINK + pid; + } + public boolean equals(Object obj) { if (obj == null || getClass() != obj.getClass()) { return false;