diff options
author | Vitaly Takmazov | 2023-01-28 18:24:32 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-28 19:07:28 +0300 |
commit | 906bf8ef21463f99820764807b656cb617b0aaa2 (patch) | |
tree | 542c02066866decfe50c7127578967b3b0b02537 /src/main/java/com/juick/www | |
parent | 5700d7c5dd1f578cd52451074ce316e192532ca6 (diff) |
Cleanup Tag model
Diffstat (limited to 'src/main/java/com/juick/www')
-rw-r--r-- | src/main/java/com/juick/www/api/Messages.java | 4 | ||||
-rw-r--r-- | src/main/java/com/juick/www/controllers/Site.java | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java index 7b54f126..06e3ac87 100644 --- a/src/main/java/com/juick/www/api/Messages.java +++ b/src/main/java/com/juick/www/api/Messages.java @@ -96,7 +96,7 @@ public class Messages { } else if (StringUtils.hasText(tag)) { Tag tagObject = tagService.getTag(tag, false); if (tagObject != null) { - mids = messagesService.getUserTag(user.getUid(), tagObject.TID, 0, before); + mids = messagesService.getUserTag(user.getUid(), tagObject.getId(), 0, before); } else { throw new HttpNotFoundException(); } @@ -121,7 +121,7 @@ public class Messages { } else if (StringUtils.hasText(tag)) { Tag tagObject = tagService.getTag(tag, false); if (tagObject != null) { - mids = messagesService.getTag(tagObject.TID, visitor.getUid(), before, 20); + mids = messagesService.getTag(tagObject.getId(), visitor.getUid(), before, 20); } else { throw new HttpNotFoundException(); } diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java index d0ea3dee..eb483ccc 100644 --- a/src/main/java/com/juick/www/controllers/Site.java +++ b/src/main/java/com/juick/www/controllers/Site.java @@ -267,7 +267,7 @@ public class Site { if (paramShow == null) { if (paramTag != null) { title = "Блог " + user.getName() + ": *" + StringEscapeUtils.escapeHtml4(paramTag.getName()); - mids = messagesService.getUserTag(user.getUid(), paramTag.TID, privacy, before); + mids = messagesService.getUserTag(user.getUid(), paramTag.getId(), privacy, before); } else if (paramSearch != null) { title = "Блог " + user.getName() + ": " + StringEscapeUtils.escapeHtml4(paramSearch); mids = messagesService.getUserSearch(visitor, user.getUid(), paramSearch, @@ -289,7 +289,7 @@ public class Site { String head = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"@" + user.getName() + "\" href=\"//rss.juick.com/" + user.getName() + "/blog\"/>"; head += "<meta name=\"Description\" content=\"" + title + "\" />\n"; - if (paramTag != null && tagService.getTagNoIndex(paramTag.TID)) { + if (paramTag != null && tagService.getTagNoIndex(paramTag.getId())) { head += "<meta name=\"robots\" content=\"noindex,nofollow\"/>"; } else if (before > 0 || paramShow != null) { head += "<meta name=\"robots\" content=\"noindex\"/>"; @@ -402,8 +402,8 @@ public class Site { Tag paramTag = tagService.getTag(paramTagStr, false); if (paramTag == null) { throw new HttpNotFoundException(); - } else if (paramTag.SynonymID > 0 && paramTag.TID != paramTag.SynonymID) { - Tag synTag = tagService.getTag(paramTag.SynonymID); + } else if (paramTag.getSynonymId() > 0 && paramTag.getId() != paramTag.getSynonymId()) { + Tag synTag = tagService.getTag(paramTag.getSynonymId()); String url = "/tag/" + URLEncoder.encode(StringEscapeUtils.escapeHtml4(synTag.getName()), StandardCharsets.UTF_8); if (request.getQueryString() != null) { @@ -421,7 +421,7 @@ public class Site { String title = "*" + StringEscapeUtils.escapeHtml4(paramTag.getName()); model.addAttribute("title", title); - List<Integer> mids = messagesService.getTag(paramTag.TID, visitor.getUid(), before, + List<Integer> mids = messagesService.getTag(paramTag.getId(), visitor.getUid(), before, (visitor.isAnonymous()) ? 40 : 20); List<Message> msgs = messagesService.getMessages(visitor.getUid(), mids); msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser()))); @@ -435,7 +435,7 @@ public class Site { } String head = StringUtils.EMPTY; - if (tagService.getTagNoIndex(paramTag.TID)) { + if (tagService.getTagNoIndex(paramTag.getId())) { head = "<meta name=\"robots\" content=\"noindex,nofollow\"/>"; } else if (before > 0 || mids.size() < 5) { head = "<meta name=\"robots\" content=\"noindex\"/>"; |