From c3c1f64c7fe9d6dcefdccc18c691bf013465b492 Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期六, 02 七月 2022 16:52:24 +0800
Subject: [PATCH] 调整
---
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java | 8 ++++----
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java | 5 +++--
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java | 1 -
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java | 26 ++++++++++++++++++++++++++
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java | 8 ++++----
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java | 5 +++--
6 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java
index d50e075..86be956 100644
--- a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java
+++ b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java
@@ -1,6 +1,7 @@
package com.gkhy.safePlatform.emergency.controller;
-import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,7 +13,7 @@
public class Test {
@DubboReference(check = false)
- private UserAccountService userAccountService;
+ private AccountAuthService accountAuthService;
// @Autowired
// private DemoService demoService;
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java
index 608b319..d139e52 100644
--- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java
+++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java
@@ -1,7 +1,7 @@
package com.gkhy.safePlatform.accountController;
import com.alibaba.fastjson.JSONObject;
-import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuRPCRespDTO;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.UserLoginRPCRespDTO;
import com.gkhy.safePlatform.commons.vo.ResultVO;
@@ -20,18 +20,18 @@
public class LoginController {
@DubboReference(check = false)
- private UserAccountService userAccountService;
+ private AccountAuthService accountAuthService;
@RequestMapping("/login")
public ResultVO<UserLoginRPCRespDTO> authLogin(@RequestBody JSONObject loginForm){
String username = loginForm.getString("username");
String password = loginForm.getString("password");
- return userAccountService.authLogin(username, password);
+ return accountAuthService.authLogin(username, password);
}
@RequestMapping("/menu")
public ResultVO<List<MenuRPCRespDTO>> getMenu(Principal principal, Long projectId){
String userId = principal.getName();
- return userAccountService.getMenu(Long.valueOf(userId), projectId);
+ return accountAuthService.getMenu(Long.valueOf(userId), projectId);
}
}
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java
index 6bd9dd2..07fc726 100644
--- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java
+++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java
@@ -1,6 +1,6 @@
package com.gkhy.safePlatform.accountController;
-import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountMenuService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.req.MenuAddRPCReqDTO;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuModRPCReqDTO;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
@@ -18,7 +18,7 @@
public class MenuController {
@DubboReference(check = false)
- private UserAccountService userAccountService;
+ private AccountMenuService accountMenuService;
/**
@@ -27,7 +27,7 @@
@RequestMapping(value = "/add",method = RequestMethod.POST)
public ResultVO<String> addMenu(Principal principal, @RequestBody MenuAddRPCReqDTO menuAddDto) {
String userId = principal.getName();
- return userAccountService.addMenu(Long.valueOf(userId), menuAddDto);
+ return accountMenuService.addMenu(Long.valueOf(userId), menuAddDto);
}
@@ -37,7 +37,7 @@
@RequestMapping(value = "/mod",method = RequestMethod.POST)
public ResultVO<String> addMenu(Principal principal, @RequestBody MenuModRPCReqDTO menuModDto) {
String userId = principal.getName();
- return userAccountService.modMenu(Long.valueOf(userId), menuModDto);
+ return accountMenuService.modMenu(Long.valueOf(userId), menuModDto);
}
}
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java
new file mode 100644
index 0000000..a7d00ff
--- /dev/null
+++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java
@@ -0,0 +1,26 @@
+package com.gkhy.safePlatform.accountController;
+
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountMenuService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountUserService;
+import com.gkhy.safePlatform.account.rpc.apimodel.model.req.query.AccountRPCQuery;
+import com.gkhy.safePlatform.commons.query.PageQuery;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.security.Principal;
+
+@RestController
+@RequestMapping("/account")
+public class UserController {
+
+ @DubboReference(check = false)
+ private AccountUserService accountUserService;
+
+
+ @RequestMapping("/page/list")
+ public Object getUserPage(Principal principal, PageQuery<AccountRPCQuery> rpcQueryPageQuery) {
+ return accountUserService.getAccountPage(Long.valueOf(principal.getName()), rpcQueryPageQuery);
+ }
+}
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java
index a6ba791..ae3b0f6 100644
--- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java
+++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java
@@ -2,7 +2,8 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
+import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.commons.co.CacheAuthority;
import com.gkhy.safePlatform.commons.co.CacheUser;
import com.gkhy.safePlatform.commons.enums.RedisKeyEnum;
@@ -37,7 +38,7 @@
@Autowired
private TokenConfig tokenConfig;
@DubboReference(check = false)
- private UserAccountService userAccountService;
+ private AccountAuthService userAccountService;
diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java
index 7bd4a36..9d0e1fa 100644
--- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java
+++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java
@@ -1,6 +1,5 @@
package com.gkhy.safePlatform.config.security;
-import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.config.security.customzie.CustomizeAccessDeniedHandler;
import com.gkhy.safePlatform.config.security.customzie.CustomizeAuthenticationEntryPoint;
import org.apache.dubbo.config.annotation.DubboReference;
--
Gitblit v1.9.2