aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-08-27 14:03:32 +0300
committerGravatar Vitaly Takmazov2018-08-27 14:03:32 +0300
commit24dc0eb58bb37f7989a0e334a50f7bfe689f1e03 (patch)
tree6286b94458ed1b755f6658b5e01a41d083060718 /juick-server
parentdfe75bb13736cb477cae97a5d336f6601a11113d (diff)
add more data to /me endpoint
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Users.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Users.java b/juick-server/src/main/java/com/juick/server/api/Users.java
index 1258e43c..c91581a0 100644
--- a/juick-server/src/main/java/com/juick/server/api/Users.java
+++ b/juick-server/src/main/java/com/juick/server/api/Users.java
@@ -18,9 +18,12 @@
package com.juick.server.api;
import com.juick.User;
+import com.juick.server.helpers.ApplicationStatus;
import com.juick.server.helpers.UserInfo;
import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.HttpNotFoundException;
+import com.juick.service.CrosspostService;
+import com.juick.service.EmailService;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
import com.juick.server.util.UserUtils;
@@ -43,6 +46,10 @@ public class Users {
private UserService userService;
@Inject
private MessagesService messagesService;
+ @Inject
+ private CrosspostService crosspostService;
+ @Inject
+ private EmailService emailService;
@ApiOperation(value = "This returns user token", notes = "Pass login and password using HTTP Basic")
@RequestMapping(value = "/auth", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@@ -150,5 +157,26 @@ public class Users {
public String getHash() {
return getAuthHash();
}
+ public UserInfo getUserInfo() {
+ return userService.getUserInfo(this);
+ }
+ public List<String> getJIDs() {
+ return userService.getAllJIDs(this);
+ }
+ public List<String> getEmails() {
+ return userService.getEmails(this);
+ }
+ public String getActiveEmail() {
+ return emailService.getNotificationsEmail(this.getUid());
+ }
+ public String getTwitterName() {
+ return crosspostService.getTwitterName(this.getUid());
+ }
+ public String getTelegramName() {
+ return crosspostService.getTelegramName(this.getUid());
+ }
+ public ApplicationStatus getFacebookStatus() {
+ return crosspostService.getFbCrossPostStatus(this.getUid());
+ }
}
}