lyfO_o
2022-07-04 8c70558cd9bf1a6ad5ca155507d10b6d5f385f31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.gkhy.safePlatform.accountController;
 
import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService;
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.account.rpc.apimodel.model.resp.DepUserRPCRespDTO;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
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.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import java.security.Principal;
import java.util.List;
 
@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);
    }
 
 
    /**
     * @Description: 获取部门下的用户列表
     */
    @RequestMapping(value = "/dep/list", method = RequestMethod.GET)
    public ResultVO<List<DepUserRPCRespDTO>> depUserList(Principal principal, Long depId) {
        String userId = principal.getName();
        return accountUserService.getDepList(Long.valueOf(userId), depId);
    }
 
 
}