| | |
| | | package com.gkhy.safePlatform.accountController; |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.apache.dubbo.config.annotation.DubboService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | } |
| | | |
| | | @RequestMapping("/menu") |
| | | public ResultVO<List<MenuRPCRespDTO>> getMenu(Principal principal, Long projectId){ |
| | | String userId = principal.getName(); |
| | | return accountAuthService.getMenu(Long.valueOf(userId), projectId); |
| | | public ResultVO<List<MenuRPCRespDTO>> getMenu(Authentication authentication, Long projectId){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountAuthService.getMenu(currentUser, projectId); |
| | | } |
| | | } |