From 8a9e3a1307710ee7e6ac7ef73ece6ee8fc9e4ecc Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: Tue, 28 Jun 2022 11:55:01 +0800
Subject: [PATCH] 菜单和登录
---
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 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..608b319 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
@@ -2,7 +2,8 @@
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.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;
@@ -10,6 +11,9 @@
import org.springframework.web.bind.annotation.RequestBody;
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")
@@ -19,9 +23,15 @@
private UserAccountService userAccountService;
@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);
}
+
+ @RequestMapping("/menu")
+ public ResultVO<List<MenuRPCRespDTO>> getMenu(Principal principal, Long projectId){
+ String userId = principal.getName();
+ return userAccountService.getMenu(Long.valueOf(userId), projectId);
+ }
}
--
Gitblit v1.9.2