mirror of https://github.com/elunez/eladmin
取消默认的后端限制
parent
7fbefa9a1c
commit
0248c7d0f7
|
@ -2,7 +2,6 @@ package me.zhengjie.modules.system.domain.vo;
|
|||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,13 +48,6 @@ public class PermissionServiceImpl implements PermissionService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Permission resources) {
|
||||
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(resources.getId().equals(1L)){
|
||||
throw new BadRequestException("该权限不能被修改");
|
||||
}
|
||||
|
||||
Optional<Permission> optionalPermission = permissionRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull(optionalPermission,"Permission","id",resources.getId());
|
||||
|
||||
|
@ -75,13 +68,6 @@ public class PermissionServiceImpl implements PermissionService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(id.equals(1L)){
|
||||
throw new BadRequestException("该权限不能被删除");
|
||||
}
|
||||
|
||||
List<Permission> permissionList = permissionRepository.findByPid(id);
|
||||
for (Permission permission : permissionList) {
|
||||
permissionRepository.delete(permission);
|
||||
|
|
|
@ -48,14 +48,6 @@ public class RoleServiceImpl implements RoleService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Role resources) {
|
||||
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(resources.getId().equals(1L)){
|
||||
throw new BadRequestException("该角色不能被修改");
|
||||
}
|
||||
|
||||
|
||||
Optional<Role> optionalRole = roleRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull(optionalRole,"Role","id",resources.getId());
|
||||
|
||||
|
@ -74,12 +66,6 @@ public class RoleServiceImpl implements RoleService {
|
|||
|
||||
@Override
|
||||
public void updatePermission(Role resources, RoleDTO roleDTO) {
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(resources.getId().equals(1L)){
|
||||
throw new BadRequestException("该角色不可操作");
|
||||
}
|
||||
Role role = roleMapper.toEntity(roleDTO);
|
||||
role.setPermissions(resources.getPermissions());
|
||||
roleRepository.save(role);
|
||||
|
@ -87,12 +73,6 @@ public class RoleServiceImpl implements RoleService {
|
|||
|
||||
@Override
|
||||
public void updateMenu(Role resources, RoleDTO roleDTO) {
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(resources.getId().equals(1L)){
|
||||
throw new BadRequestException("该角色不可操作");
|
||||
}
|
||||
Role role = roleMapper.toEntity(roleDTO);
|
||||
role.setMenus(resources.getMenus());
|
||||
roleRepository.save(role);
|
||||
|
@ -101,12 +81,6 @@ public class RoleServiceImpl implements RoleService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(id.equals(1L)){
|
||||
throw new BadRequestException("该角色不能被删除");
|
||||
}
|
||||
roleRepository.deleteById(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,13 +68,6 @@ public class UserServiceImpl implements UserService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(User resources) {
|
||||
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(resources.getId().equals(1L)){
|
||||
throw new BadRequestException("该账号不能被修改");
|
||||
}
|
||||
|
||||
Optional<User> userOptional = userRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull(userOptional,"User","id",resources.getId());
|
||||
|
||||
|
@ -106,12 +99,6 @@ public class UserServiceImpl implements UserService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
/**
|
||||
* 根据实际需求修改
|
||||
*/
|
||||
if(id.equals(1L)){
|
||||
throw new BadRequestException("该账号不能被删除");
|
||||
}
|
||||
userRepository.deleteById(id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue