aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/protocol
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-01 13:56:53 +0300
committerGravatar Vitaly Takmazov2016-12-01 13:56:53 +0300
commit3d7f60c1c0b48dad2f58bffe3352d1c5c1b93f00 (patch)
treeab311d5d6102b2c76c03b266fc1b794108cba0fc /juick-server/src/main/java/com/juick/server/protocol
parent92d6700919e87c81db4a42a4b286257f62566cbf (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.java5
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 1bac9fce..68c7c37c 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());
}