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; 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); } } 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); } } 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); } } 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; 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;