aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/Notifications.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/api/Notifications.java')
-rw-r--r--src/main/java/com/juick/www/api/Notifications.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/com/juick/www/api/Notifications.java b/src/main/java/com/juick/www/api/Notifications.java
index 32ba3dc1..e5e85eb7 100644
--- a/src/main/java/com/juick/www/api/Notifications.java
+++ b/src/main/java/com/juick/www/api/Notifications.java
@@ -22,6 +22,7 @@ import com.juick.service.*;
import com.juick.util.HttpBadRequestException;
import com.juick.util.HttpForbiddenException;
import io.swagger.v3.oas.annotations.Hidden;
+import io.swagger.v3.oas.annotations.Parameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
@@ -71,7 +72,7 @@ public class Notifications {
@Hidden
@RequestMapping(value = "/api/notifications", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public List<User> doGet(
- @ModelAttribute(binding = false) User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestParam(required = false, defaultValue = "0") int uid,
@RequestParam(required = false, defaultValue = "0") int mid,
@RequestParam(required = false, defaultValue = "0") int rid) {
@@ -110,7 +111,7 @@ public class Notifications {
@Hidden
@RequestMapping(value = "/api/notifications", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public Status doDelete(
- @ModelAttribute User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestBody List<ExternalToken> list) {
if (!visitor.equals(serviceUser)) {
throw new HttpForbiddenException();
@@ -129,7 +130,7 @@ public class Notifications {
@Hidden
@RequestMapping(value = "/api/notifications/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public Status doDeleteTokens(
- @ModelAttribute User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestBody List<ExternalToken> list) {
if (!visitor.equals(serviceUser)) {
throw new HttpForbiddenException();
@@ -149,7 +150,7 @@ public class Notifications {
@Hidden
@RequestMapping(value = "/api/notifications", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public Status doPut(
- @ModelAttribute User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestBody List<ExternalToken> list) {
list.forEach(t -> {
switch (t.type()) {
@@ -165,7 +166,7 @@ public class Notifications {
@Deprecated
@RequestMapping(value = "/api/android/register", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public Status doAndroidRegister(
- @ModelAttribute User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestParam(name = "regid") String regId) {
pushQueriesService.addGCMToken(visitor.getUid(), regId);
return Status.OK;
@@ -174,7 +175,7 @@ public class Notifications {
@Deprecated
@RequestMapping(value = "/api/winphone/register", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public Status doWinphoneRegister(
- @ModelAttribute User visitor,
+ @Parameter(hidden = true) User visitor,
@RequestParam(name = "url") String regId) {
pushQueriesService.addMPNSToken(visitor.getUid(), regId);
return Status.OK;