diff options
author | Vitaly Takmazov | 2016-12-01 13:56:53 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-01 13:56:53 +0300 |
commit | 3d7f60c1c0b48dad2f58bffe3352d1c5c1b93f00 (patch) | |
tree | ab311d5d6102b2c76c03b266fc1b794108cba0fc /juick-server/src/main/java/com/juick/server/protocol | |
parent | 92d6700919e87c81db4a42a4b286257f62566cbf (diff) |
juick-api: Tags controller from perl, refactoring
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/protocol')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java index 1bac9fcec..68c7c37c7 100644 --- a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java +++ b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java @@ -8,6 +8,7 @@ import com.juick.Tag; import com.juick.User; import com.juick.formatters.PlainTextFormatter; import com.juick.server.*; +import com.juick.server.helpers.TagStats; import com.juick.server.protocol.annotation.UserCommand; import com.juick.util.TagUtils; import org.springframework.jdbc.core.JdbcTemplate; @@ -179,10 +180,10 @@ public class JuickProtocol { @UserCommand(pattern = "\\*", help = "* - Show your tags") public ProtocolReply commandTags(User currentUser, String... args) { - List<Tag> tags = TagQueries.getUserTagsAll(sql, currentUser.getUid()); + List<TagStats> tags = TagQueries.getTagsStats(sql, currentUser.getUid()); String msg = "Your tags: (tag - messages)\n" + tags.stream() - .map(t -> String.format("\n*%s - %d", t.getName(), t.UsageCnt)).collect(Collectors.joining()); + .map(t -> String.format("\n*%s - %d", t.getTag().getName(), t.getUsageCount())).collect(Collectors.joining()); return new ProtocolReply(msg, Optional.empty()); } |