| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @PostMapping("bindingUserWithRole") |
| | | @ApiOperation(value = "绑定用户和角色") |
| | | @CacheEvict(cacheNames = {"userBridge"},key="'getAuthorizationInfo'+#p0") //清除 |
| | | public boolean bindingUserWithRole(@RequestParam int userId,int roleId){ |
| | | return userRoleService.bindingUserWithRole(userId,roleId); |
| | | } |
| | | |
| | | @PostMapping("bindingUserWithRoleBatch") |
| | | @ApiOperation(value = "批量绑定用户和角色",notes = "传入userId和roleId的数组") |
| | | @CacheEvict(cacheNames = {"userBridge"},allEntries = true) //全部清除 |
| | | public boolean bindingUserWithRoleBatch(@RequestBody List<UserRole> userRoles){ |
| | | return userRoleService.bindingUserWithRoleBatch(userRoles); |
| | | } |
| | |
| | | |
| | | @PostMapping("bindingRoleWithPermission") |
| | | @ApiOperation(value = "绑定角色-权限") |
| | | @CacheEvict(cacheNames = {"userBridge"},allEntries = true) //全部清除 |
| | | public boolean bindingRoleWithPermission(@RequestParam int roleId,int permissionId){ |
| | | return rolePermissionService.bindingUserWithRole(roleId,permissionId); |
| | | } |
| | | |
| | | @PostMapping("bindingRoleWithPermissionBatch") |
| | | @ApiOperation(value = "批量绑定角色-权限",notes = "传入roleId和privilegeId的数组") |
| | | @CacheEvict(cacheNames = {"userBridge"},allEntries = true) //全部清除 |
| | | public boolean bindingRoleWithPermissionBatch(@RequestBody List<RolePermission> rolePermissions){ |
| | | return rolePermissionService.bindingUserWithRoleBatch(rolePermissions); |
| | | } |