Skip to content

Commit

Permalink
add link on profile
Browse files Browse the repository at this point in the history
  • Loading branch information
fpellet committed Jan 11, 2025
1 parent b0d148f commit d28fe3f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/erudika/scoold/core/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d28fe3f

Please sign in to comment.