diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/MessagesQueries.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/MessagesQueries.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/juick-server/src/main/java/com/juick/server/MessagesQueries.java b/juick-server/src/main/java/com/juick/server/MessagesQueries.java index fd1e5b51..36d311df 100644 --- a/juick-server/src/main/java/com/juick/server/MessagesQueries.java +++ b/juick-server/src/main/java/com/juick/server/MessagesQueries.java @@ -21,6 +21,7 @@ import com.juick.Message; import com.juick.Tag; import com.juick.User; import com.juick.server.helpers.PrivacyOpts; +import com.juick.server.helpers.TagStats; import com.juick.util.MessageUtils; import org.apache.commons.lang3.StringEscapeUtils; import org.springframework.dao.EmptyResultDataAccessException; @@ -308,16 +309,18 @@ public class MessagesQueries { } } - public static List<com.juick.Tag> getMessageTags(JdbcTemplate sql, int mid) { + public static List<TagStats> getMessageTags(JdbcTemplate sql, int mid) { return sql.query("SELECT tags.tag_id,synonym_id,name,stat_messages FROM tags " + "INNER JOIN messages_tags ON (messages_tags.message_id=? AND messages_tags.tag_id=tags.tag_id)", - new Object[]{mid}, (rs, num) -> { + (rs, num) -> { com.juick.Tag t = new com.juick.Tag(StringEscapeUtils.unescapeHtml4(rs.getString(3))); t.TID = rs.getInt(1); t.SynonymID = rs.getInt(2); - t.UsageCnt = rs.getInt(4); - return t; - }); + TagStats s = new TagStats(); + s.setTag(t); + s.setUsageCount(rs.getInt(4)); + return s; + }, mid); } public static List<Integer> getMessageTagsIDs(JdbcTemplate sql, int mid) { |