diff options
author | Vitaly Takmazov | 2023-01-13 17:38:06 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 18:11:56 +0300 |
commit | 35d25bbc9d261e7b5585d0fd1d398dff3ab4a176 (patch) | |
tree | 68a4d0b0190635615438343f6f6c52cacc213179 /src/main/java/com/juick/www/controllers/Settings.java | |
parent | 8b70eded6c9cc3b9cf634356239701fe65779791 (diff) |
Fix OpenAPI generation
* Use HandlerMethodArgumentResolver to pass visitor
* Hide visitor from OpenAPI definitions
* Drop unused AsciiDoc template
Diffstat (limited to 'src/main/java/com/juick/www/controllers/Settings.java')
-rw-r--r-- | src/main/java/com/juick/www/controllers/Settings.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java index f2cd4aa9..bc6b6614 100644 --- a/src/main/java/com/juick/www/controllers/Settings.java +++ b/src/main/java/com/juick/www/controllers/Settings.java @@ -38,6 +38,7 @@ import com.juick.util.HttpBadRequestException; import com.juick.util.HttpUtils; import com.juick.www.WebApp; +import io.swagger.v3.oas.annotations.Parameter; import jakarta.mail.Message; import jakarta.mail.MessagingException; import jakarta.mail.Session; @@ -88,7 +89,7 @@ public class Settings { @GetMapping("/settings") protected String doGet( - @ModelAttribute User visitor, + @Parameter(hidden = true) User visitor, Locale locale, @RequestParam(required = false, defaultValue = "main") String page, @RequestParam(required = false) String code, ModelMap model) { @@ -125,7 +126,7 @@ public class Settings { @PostMapping("/settings") protected String doPost( - @ModelAttribute User visitor, + @Parameter(hidden = true) User visitor, HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) MultipartFile newAvatar, ModelMap model) @@ -271,7 +272,7 @@ public class Settings { } @PostMapping("/settings/unsubscribe") public String unsubscribeOneClick( - @ModelAttribute User user, + User user, @RequestParam(name = "List-Unsubscribe") String unsubscribe, ModelMap model) { if (!user.isAnonymous()) { |