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("/perms") 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> selectRes(String uid) { try { List 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> selectMenus(String uid) { try { List 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> selectPerms(String uid) { try { List rs = permsService.selectPerms(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 = "/selectPermsEntity") public ResponseMsg> selectPermsEntity(String uid) { try { List rs = permsService.selectPermsEntity(uid); return success(rs); } catch (Exception ex) { return fail(ex.getMessage(), null); } } }