From fea25a3ca8897f415f2a8cc14e5c9497a828d32e Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: Fri, 08 Jul 2022 11:05:32 +0800
Subject: [PATCH] UP
---
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
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 e257ec2..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,8 +1,9 @@
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.model.UserLoginRespDTO;
+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;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
@@ -11,17 +12,26 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.security.Principal;
+import java.util.List;
+
@RestController
@RequestMapping("/auth")
public class LoginController {
@DubboReference(check = false)
- private UserAccountService userAccountService;
+ private AccountAuthService accountAuthService;
@RequestMapping("/login")
- public ResultVO<UserLoginRespDTO> authLogin(@RequestBody JSONObject loginForm){
+ 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 accountAuthService.getMenu(Long.valueOf(userId), projectId);
}
}
--
Gitblit v1.9.2