From eb321a1204c8f5e14973591e0be7651bee406d36 Mon Sep 17 00:00:00 2001 From: trydofor Date: Thu, 24 Aug 2023 09:22:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20R.OK()=20and=20R.NG()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wings/admin/controller/AdminController.java | 4 ++-- observe/docs | 2 +- observe/mirana | 2 +- .../warlock/controller/auth/LoginPageController.java | 2 +- .../warlock/controller/user/AuthedUserController.java | 8 ++++---- .../warlock/controller/other/TestOtherController.java | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java b/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java index 823d9b934..f221d52d7 100644 --- a/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java +++ b/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java @@ -22,9 +22,9 @@ public class AdminController { private WarlockUserAuthnService authnService; @PostMapping("/admin/disable-root.json") - public R rootNeverLogin() { + public R rootNeverLogin() { authnService.disable(DefaultUserId.Root, WarlockAuthType.USERNAME); log.info("disable root"); - return R.ok(); + return R.OK; } } diff --git a/observe/docs b/observe/docs index 6349b2449..0d29dde2e 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 6349b2449a07ef70875ceb397fc299ca095f3eda +Subproject commit 0d29dde2e8620ad35278f2210954a3fbcfa0a99e diff --git a/observe/mirana b/observe/mirana index 4cf8c9c34..e9215f349 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit 4cf8c9c34f13fbc24e73033baf15cc0e28157f5f +Subproject commit e9215f3499436a623dd08b8a22e48232234ad217 diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java index d6be2962d..f99f45086 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java @@ -143,7 +143,7 @@ public ResponseEntity> nonceCheck(@RequestHeader("token") String token, Htt if (sid == null) { return ResponseEntity .status(HttpStatus.UNAUTHORIZED) - .body(R.ng()); + .body(R.NG); } else { final R r; diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java index f561ddd5c..a0a19625c 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java @@ -81,7 +81,7 @@ public static class Dto { @PostMapping(value = "${" + WarlockUrlmapProp.Key$userAuthedUser + "}") public R authedUser(HttpServletRequest request) { final WingsUserDetails wd = SecurityContextUtil.getUserDetails(false); - if (wd == null) return R.ng(); + if (wd == null) return R.NG(); Dto dto = new Dto(); fillDetail(wd, dto); @@ -136,7 +136,7 @@ public static class Ins { @PostMapping(value = "${" + WarlockUrlmapProp.Key$userAuthedPerm + "}") public R> authedPerm(HttpServletRequest request, @RequestBody Ins ins) { final WingsUserDetails wd = SecurityContextUtil.getUserDetails(false); - if (wd == null) return R.ng(); + if (wd == null) return R.NG(); final Set ck = ins.getCheck(); final Set pm = wd.getAuthorities().stream() @@ -163,7 +163,7 @@ public R> authedPerm(HttpServletRequest request, @RequestBody Ins in if (alias == null) alias = Collections.emptyMap(); if (perms.isEmpty() && alias.isEmpty()) { - return R.ok(); + return R.OK(); } // alias over perms @@ -205,7 +205,7 @@ public static class Ses extends Dto { @PostMapping(value = "${" + WarlockUrlmapProp.Key$userListSession + "}") public R> listSession() { final WingsUserDetails details = SecurityContextUtil.getUserDetails(false); - if (details == null) return R.ng(); + if (details == null) return R.NG(); final List sessions = wingsSessionHelper.findByUserId(details.getUserId()); final List sess = sessions.stream().map(it -> { diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java index 53649448b..158d1a450 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java @@ -93,6 +93,6 @@ public R watching() throws InterruptedException { watchingService.asyncAwait(); watchingService.normalFetch(); watchingService.errorFetch(); - return R.ok(); + return R.OK; } }