lyh
2025-01-13 137d008bd9b7d932160436a3a560b24512f6d1db
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
46
47
48
49
50
package org.jeecg.modules.dnc.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.dnc.response.CommonCode;
import org.jeecg.modules.dnc.response.QueryListResponseResult;
import org.jeecg.modules.dnc.service.IUserPermButtonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Collections;
import java.util.List;
 
@Slf4j
@Api(tags = "用户按钮权限")
@RestController
@RequestMapping("/nc/user")
public class UserPermButtonController  {
    @Autowired
    private IUserPermButtonService userPermButtonService;
 
 
    /**
     * 获取当前用户按钮权限列表
     * @param param
     * @param flag
     * @param objectId
     * @param relativeParam
     * @param relativeObjectId
     * @return
     */
    @AutoLog(value = "用户按钮权限-获取当前用户按钮权限列表")
    @ApiOperation(value = "用户按钮权限-获取当前用户按钮权限列表", notes = "用户按钮权限-获取当前用户按钮权限列表")
    @GetMapping("/get/button/perms")
    public QueryListResponseResult<String> getCurrentUserButtonPerms(@RequestParam("param") String param,
                                                                     @RequestParam("flag") Integer flag,
                                                                     @RequestParam(value = "objectId", required = false) String objectId,
                                                                     @RequestParam(value = "relativeParam", required = false) String relativeParam,
                                                                     @RequestParam(value = "relativeObjectId", required = false) String relativeObjectId) {
        List<String> perms = userPermButtonService.getCurrentUserButtonPerms(param, flag, objectId, relativeParam, relativeObjectId);
        if(perms == null)
            perms = Collections.emptyList();
        return new QueryListResponseResult(CommonCode.SUCCESS, perms);
    }
}