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);
|
}
|
}
|