package com.lf.server.controller.all;
|
|
import com.lf.server.aspect.SysLog;
|
import com.lf.server.entity.all.MenusAuthEntity;
|
import com.lf.server.entity.all.PermsAuthEntity;
|
import com.lf.server.entity.all.ResAuthEntity;
|
import com.lf.server.entity.all.ResponseMsg;
|
import com.lf.server.service.all.PermsService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* 授权控制器
|
* @author WWW
|
*/
|
@Api(tags = "运维管理\\授权管理")
|
@RestController
|
@RequestMapping("/file")
|
public class PermsController extends BaseController {
|
@Autowired
|
PermsService permsService;
|
|
@SysLog()
|
@ApiOperation(value = "根据用户Uid查询资源授权")
|
@ApiImplicitParams({
|
@ApiImplicitParam(name = "uid", value = "用户Uid", dataType = "String", paramType = "query", example = "admin")
|
})
|
@GetMapping(value = "/selectRes")
|
public ResponseMsg<List<ResAuthEntity>> selectRes(String uid) {
|
try {
|
List<ResAuthEntity> rs = permsService.selectRes(uid);
|
|
return success(rs);
|
} catch (Exception ex) {
|
return fail(ex.getMessage(), null);
|
}
|
}
|
|
@SysLog()
|
@ApiOperation(value = "根据用户Uid查询菜单授权")
|
@ApiImplicitParams({
|
@ApiImplicitParam(name = "uid", value = "用户Uid", dataType = "String", paramType = "query", example = "admin")
|
})
|
@GetMapping(value = "/selectMenus")
|
public ResponseMsg<List<MenusAuthEntity>> selectMenus(String uid) {
|
try {
|
List<MenusAuthEntity> rs = permsService.selectMenus(uid);
|
|
return success(rs);
|
} catch (Exception ex) {
|
return fail(ex.getMessage(), null);
|
}
|
}
|
|
@SysLog()
|
@ApiOperation(value = "根据用户Uid查询权限授权")
|
@ApiImplicitParams({
|
@ApiImplicitParam(name = "uid", value = "用户Uid", dataType = "String", paramType = "query", example = "admin")
|
})
|
@GetMapping(value = "/selectPerms")
|
public ResponseMsg<List<PermsAuthEntity>> selectPerms(String uid) {
|
try {
|
List<PermsAuthEntity> rs = permsService.selectPerms(uid);
|
|
return success(rs);
|
} catch (Exception ex) {
|
return fail(ex.getMessage(), null);
|
}
|
}
|
|
@SysLog()
|
@ApiOperation(value = "根据用户Uid查询权限授权2")
|
@ApiImplicitParams({
|
@ApiImplicitParam(name = "uid", value = "用户Uid", dataType = "String", paramType = "query", example = "admin")
|
})
|
@GetMapping(value = "/selectPerms2")
|
public ResponseMsg<List<String>> selectPerms2(String uid) {
|
try {
|
List<String> rs = permsService.selectPerms2(uid);
|
|
return success(rs);
|
} catch (Exception ex) {
|
return fail(ex.getMessage(), null);
|
}
|
}
|
}
|