actions;
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/app/PermissionRoleUpdateParam.java b/eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/permission/PermissionRoleUpdateParam.java
similarity index 96%
rename from eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/app/PermissionRoleUpdateParam.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/permission/PermissionRoleUpdateParam.java
index 98a5c12d..855df4fe 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/app/PermissionRoleUpdateParam.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/pojo/update/permission/PermissionRoleUpdateParam.java
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.pojo.update.app;
+package cn.topiam.employee.console.pojo.update.permission;
import java.io.Serial;
import java.io.Serializable;
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionActionService.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionActionService.java
similarity index 68%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionActionService.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionActionService.java
index 7d6bed67..bc6f375e 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionActionService.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionActionService.java
@@ -15,12 +15,12 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app;
+package cn.topiam.employee.console.service.permission;
import java.util.List;
-import cn.topiam.employee.console.pojo.query.app.AppPermissionActionListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionActionListResult;
+import cn.topiam.employee.console.pojo.query.permission.PermissionActionListQuery;
+import cn.topiam.employee.console.pojo.result.permission.PermissionActionListResult;
/**
*
@@ -30,14 +30,14 @@ import cn.topiam.employee.console.pojo.result.app.AppPermissionActionListResult;
* @author TopIAM
* Created by support@topiam.cn on 2020-08-10
*/
-public interface AppPermissionActionService {
+public interface PermissionActionService {
/**
* 获取资源权限列表
*
- * @param query {@link AppPermissionActionListQuery}
- * @return {@link AppPermissionActionListResult}
+ * @param query {@link PermissionActionListQuery}
+ * @return {@link PermissionActionListResult}
*/
- List getPermissionActionList(AppPermissionActionListQuery query);
+ List getPermissionActionList(PermissionActionListQuery query);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionPolicyService.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionPolicyService.java
similarity index 61%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionPolicyService.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionPolicyService.java
index e27934fb..6eec5049 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionPolicyService.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionPolicyService.java
@@ -15,13 +15,13 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app;
+package cn.topiam.employee.console.service.permission;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionPolicyGetResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionPolicyListResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionPolicyCreateParam;
-import cn.topiam.employee.console.pojo.update.app.AppPermissionPolicyUpdateParam;
+import cn.topiam.employee.console.pojo.result.permission.PermissionPolicyGetResult;
+import cn.topiam.employee.console.pojo.result.permission.PermissionPolicyListResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionPolicyCreateParam;
+import cn.topiam.employee.console.pojo.update.permission.PermissionPolicyUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -33,24 +33,24 @@ import cn.topiam.employee.support.repository.page.domain.PageModel;
* @author TopIAM
* Created by support@topiam.cn on 2020-08-10
*/
-public interface AppPermissionPolicyService {
+public interface PermissionPolicyService {
/**
* 获取资源列表
*
* @param page {@link PageModel}
* @param query {@link AppPolicyQuery}
- * @return {@link AppPermissionPolicyListResult}
+ * @return {@link PermissionPolicyListResult}
*/
- Page getPermissionPolicyList(PageModel page,
- AppPolicyQuery query);
+ Page getPermissionPolicyList(PageModel page,
+ AppPolicyQuery query);
/**
* 获取资源
*
* @param id {@link String}
- * @return {@link AppPermissionPolicyGetResult}
+ * @return {@link PermissionPolicyGetResult}
*/
- AppPermissionPolicyGetResult getPermissionPolicy(String id);
+ PermissionPolicyGetResult getPermissionPolicy(String id);
/**
* 删除资源
@@ -63,16 +63,16 @@ public interface AppPermissionPolicyService {
/**
* 创建资源
*
- * @param param {@link AppPermissionPolicyCreateParam}
+ * @param param {@link PermissionPolicyCreateParam}
* @return {@link Boolean}
*/
- Boolean createPermissionPolicy(AppPermissionPolicyCreateParam param);
+ Boolean createPermissionPolicy(PermissionPolicyCreateParam param);
/**
* 更新资源
*
- * @param param {@link AppPermissionPolicyUpdateParam}
+ * @param param {@link PermissionPolicyUpdateParam}
* @return {@link Boolean}
*/
- Boolean updatePermissionPolicy(AppPermissionPolicyUpdateParam param);
+ Boolean updatePermissionPolicy(PermissionPolicyUpdateParam param);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionResourceService.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionResourceService.java
similarity index 66%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionResourceService.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionResourceService.java
index c93d88b3..19ae316e 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionResourceService.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionResourceService.java
@@ -15,14 +15,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app;
+package cn.topiam.employee.console.service.permission;
import cn.topiam.employee.common.enums.CheckValidityType;
-import cn.topiam.employee.console.pojo.query.app.AppResourceListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionResourceGetResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionResourceListResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionResourceCreateParam;
-import cn.topiam.employee.console.pojo.update.app.AppPermissionResourceUpdateParam;
+import cn.topiam.employee.console.pojo.query.permission.PermissionResourceListQuery;
+import cn.topiam.employee.console.pojo.result.permission.PermissionResourceGetResult;
+import cn.topiam.employee.console.pojo.result.permission.PermissionResourceListResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionResourceCreateParam;
+import cn.topiam.employee.console.pojo.update.permission.PermissionResourceUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -34,24 +34,24 @@ import cn.topiam.employee.support.repository.page.domain.PageModel;
* @author TopIAM
* Created by support@topiam.cn on 2020-08-10
*/
-public interface AppPermissionResourceService {
+public interface PermissionResourceService {
/**
* 获取资源列表
*
* @param page {@link PageModel}
- * @param query {@link AppResourceListQuery}
- * @return {@link AppPermissionResourceListResult}
+ * @param query {@link PermissionResourceListQuery}
+ * @return {@link PermissionResourceListResult}
*/
- Page getPermissionResourceList(PageModel page,
- AppResourceListQuery query);
+ Page getPermissionResourceList(PageModel page,
+ PermissionResourceListQuery query);
/**
* 获取资源
*
* @param id {@link String}
- * @return {@link AppPermissionResourceGetResult}
+ * @return {@link PermissionResourceGetResult}
*/
- AppPermissionResourceGetResult getPermissionResource(String id);
+ PermissionResourceGetResult getPermissionResource(String id);
/**
* 删除资源
@@ -73,18 +73,18 @@ public interface AppPermissionResourceService {
/**
* 创建资源
*
- * @param param {@link AppPermissionResourceCreateParam}
+ * @param param {@link PermissionResourceCreateParam}
* @return {@link Boolean}
*/
- Boolean createPermissionResource(AppPermissionResourceCreateParam param);
+ Boolean createPermissionResource(PermissionResourceCreateParam param);
/**
* 更新资源
*
- * @param param {@link AppPermissionResourceUpdateParam}
+ * @param param {@link PermissionResourceUpdateParam}
* @return {@link Boolean}
*/
- Boolean updatePermissionResource(AppPermissionResourceUpdateParam param);
+ Boolean updatePermissionResource(PermissionResourceUpdateParam param);
/**
* 参数有效性验证
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionRoleService.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionRoleService.java
similarity index 69%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionRoleService.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionRoleService.java
index 707d0648..b33618fa 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/AppPermissionRoleService.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/PermissionRoleService.java
@@ -15,14 +15,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app;
+package cn.topiam.employee.console.service.permission;
import cn.topiam.employee.common.enums.CheckValidityType;
-import cn.topiam.employee.console.pojo.query.app.AppPermissionRoleListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionRoleListResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionRoleResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionRoleCreateParam;
-import cn.topiam.employee.console.pojo.update.app.PermissionRoleUpdateParam;
+import cn.topiam.employee.console.pojo.query.permission.PermissionRoleListQuery;
+import cn.topiam.employee.console.pojo.result.permission.PermissionRoleListResult;
+import cn.topiam.employee.console.pojo.result.permission.PermissionRoleResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionRoleCreateParam;
+import cn.topiam.employee.console.pojo.update.permission.PermissionRoleUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -34,25 +34,25 @@ import cn.topiam.employee.support.repository.page.domain.PageModel;
* @author TopIAM
* Created by support@topiam.cn on 2020-08-10
*/
-public interface AppPermissionRoleService {
+public interface PermissionRoleService {
/**
* 获取所有角色(分页)
*
* @param page {@link PageModel}
- * @param query {@link AppPermissionRoleListQuery}
- * @return {@link AppPermissionRoleListResult}
+ * @param query {@link PermissionRoleListQuery}
+ * @return {@link PermissionRoleListResult}
*/
- Page getPermissionRoleList(PageModel page,
- AppPermissionRoleListQuery query);
+ Page getPermissionRoleList(PageModel page,
+ PermissionRoleListQuery query);
/**
* 创建角色
*
- * @param param {@link AppPermissionRoleCreateParam}
+ * @param param {@link PermissionRoleCreateParam}
* @return {@link Boolean}
*/
- boolean createPermissionRole(AppPermissionRoleCreateParam param);
+ boolean createPermissionRole(PermissionRoleCreateParam param);
/**
* 更新角色
@@ -74,9 +74,9 @@ public interface AppPermissionRoleService {
* 角色详情
*
* @param id {@link Long}
- * @return {@link AppPermissionRoleResult}
+ * @return {@link PermissionRoleResult}
*/
- AppPermissionRoleResult getPermissionRole(Long id);
+ PermissionRoleResult getPermissionRole(Long id);
/**
* 参数有效性验证
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionActionServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
similarity index 58%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionActionServiceImpl.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
index 39dd8300..ae818747 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionActionServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
@@ -15,20 +15,20 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app.impl;
+package cn.topiam.employee.console.service.permission.impl;
import java.util.List;
+import cn.topiam.employee.console.converter.permission.PermissionActionConverter;
import org.springframework.stereotype.Service;
import com.querydsl.core.types.Predicate;
-import cn.topiam.employee.common.entity.app.AppPermissionResourceEntity;
-import cn.topiam.employee.common.repository.app.AppPermissionResourceRepository;
-import cn.topiam.employee.console.converter.app.AppPermissionActionConverter;
-import cn.topiam.employee.console.pojo.query.app.AppPermissionActionListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionActionListResult;
-import cn.topiam.employee.console.service.app.AppPermissionActionService;
+import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
+import cn.topiam.employee.common.repository.permission.AppPermissionResourceRepository;
+import cn.topiam.employee.console.pojo.query.permission.PermissionActionListQuery;
+import cn.topiam.employee.console.pojo.result.permission.PermissionActionListResult;
+import cn.topiam.employee.console.service.permission.PermissionActionService;
import lombok.RequiredArgsConstructor;
@@ -42,24 +42,24 @@ import lombok.RequiredArgsConstructor;
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionActionServiceImpl implements AppPermissionActionService {
+public class PermissionActionServiceImpl implements PermissionActionService {
/**
* 获取资源列表
*
- * @param query {@link AppPermissionActionListQuery}
- * @return {@link AppPermissionActionListResult}
+ * @param query {@link PermissionActionListQuery}
+ * @return {@link PermissionActionListResult}
*/
@Override
- public List getPermissionActionList(AppPermissionActionListQuery query) {
- Predicate predicate = appPermissionActionConverter
+ public List getPermissionActionList(PermissionActionListQuery query) {
+ Predicate predicate = permissionActionConverter
.appPermissionActionListQueryConvertToPredicate(query);
List list = (List) appPermissionResourceRepository
.findAll(predicate);
- return appPermissionActionConverter.entityConvertToResourceActionListResult(list);
+ return permissionActionConverter.entityConvertToResourceActionListResult(list);
}
private final AppPermissionResourceRepository appPermissionResourceRepository;
- private final AppPermissionActionConverter appPermissionActionConverter;
+ private final PermissionActionConverter permissionActionConverter;
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionPolicyServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
similarity index 64%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionPolicyServiceImpl.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
index 280cd110..a3534a8f 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionPolicyServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
@@ -15,23 +15,23 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app.impl;
+package cn.topiam.employee.console.service.permission.impl;
+import cn.topiam.employee.console.pojo.result.permission.PermissionPolicyListResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionPolicyCreateParam;
import org.springframework.data.querydsl.QPageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import cn.topiam.employee.common.entity.app.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.app.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
+import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.exception.app.AppPolicyNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.console.converter.app.AppPermissionPolicyConverter;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionPolicyGetResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionPolicyListResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionPolicyCreateParam;
-import cn.topiam.employee.console.pojo.update.app.AppPermissionPolicyUpdateParam;
-import cn.topiam.employee.console.service.app.AppPermissionPolicyService;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.console.converter.permission.PermissionPolicyConverter;
+import cn.topiam.employee.console.pojo.result.permission.PermissionPolicyGetResult;
+import cn.topiam.employee.console.pojo.update.permission.PermissionPolicyUpdateParam;
+import cn.topiam.employee.console.service.permission.PermissionPolicyService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -47,32 +47,32 @@ import lombok.RequiredArgsConstructor;
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyService {
+public class PermissionPolicyServiceImpl implements PermissionPolicyService {
/**
* 获取策略列表
*
* @param page {@link PageModel}
* @param query {@link AppPolicyQuery}
- * @return {@link AppPermissionPolicyListResult}
+ * @return {@link PermissionPolicyListResult}
*/
@Override
- public Page getPermissionPolicyList(PageModel page,
- AppPolicyQuery query) {
+ public Page getPermissionPolicyList(PageModel page,
+ AppPolicyQuery query) {
org.springframework.data.domain.Page data;
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
data = appPermissionPolicyRepository.findPage(query, request);
- return appPermissionPolicyConverter.entityConvertToPolicyListResult(data);
+ return permissionPolicyConverter.entityConvertToPolicyListResult(data);
}
/**
* 获取策略
*
* @param id {@link String}
- * @return {@link AppPermissionPolicyGetResult}
+ * @return {@link PermissionPolicyGetResult}
*/
@Override
- public AppPermissionPolicyGetResult getPermissionPolicy(String id) {
+ public PermissionPolicyGetResult getPermissionPolicy(String id) {
return null;
}
@@ -94,13 +94,13 @@ public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyServic
/**
* 创建策略
*
- * @param param {@link AppPermissionPolicyCreateParam}
+ * @param param {@link PermissionPolicyCreateParam}
* @return {@link Boolean}
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public Boolean createPermissionPolicy(AppPermissionPolicyCreateParam param) {
- AppPermissionPolicyEntity resource = appPermissionPolicyConverter
+ public Boolean createPermissionPolicy(PermissionPolicyCreateParam param) {
+ AppPermissionPolicyEntity resource = permissionPolicyConverter
.policyCreateParamConvertToEntity(param);
// 新增策略
appPermissionPolicyRepository.save(resource);
@@ -110,19 +110,19 @@ public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyServic
/**
* 更新策略
*
- * @param param {@link AppPermissionPolicyUpdateParam}
+ * @param param {@link PermissionPolicyUpdateParam}
* @return {@link Boolean}
*/
@Override
- public Boolean updatePermissionPolicy(AppPermissionPolicyUpdateParam param) {
- AppPermissionPolicyEntity resource = appPermissionPolicyConverter
+ public Boolean updatePermissionPolicy(PermissionPolicyUpdateParam param) {
+ AppPermissionPolicyEntity resource = permissionPolicyConverter
.policyUpdateParamConvertToEntity(param);
// 更新策略
appPermissionPolicyRepository.save(resource);
return null;
}
- private final AppPermissionPolicyConverter appPermissionPolicyConverter;
+ private final PermissionPolicyConverter permissionPolicyConverter;
private final AppPermissionPolicyRepository appPermissionPolicyRepository;
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionResourceServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
similarity index 78%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionResourceServiceImpl.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
index b4ae401a..0cba28a0 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionResourceServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app.impl;
+package cn.topiam.employee.console.service.permission.impl;
import java.util.ArrayList;
import java.util.List;
@@ -23,6 +23,10 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
+import cn.topiam.employee.console.pojo.result.permission.PermissionResourceGetResult;
+import cn.topiam.employee.console.pojo.result.permission.PermissionResourceListResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionResourceCreateParam;
+import cn.topiam.employee.console.pojo.update.permission.PermissionResourceUpdateParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.querydsl.QPageRequest;
import org.springframework.stereotype.Service;
@@ -34,22 +38,18 @@ import com.querydsl.core.types.dsl.BooleanExpression;
import cn.topiam.employee.audit.context.AuditContext;
import cn.topiam.employee.audit.entity.Target;
import cn.topiam.employee.audit.enums.TargetType;
-import cn.topiam.employee.common.entity.app.AppPermissionActionEntity;
-import cn.topiam.employee.common.entity.app.AppPermissionResourceEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppResourceNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionActionRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionResourceRepository;
-import cn.topiam.employee.console.converter.app.AppPermissionResourceConverter;
-import cn.topiam.employee.console.pojo.query.app.AppResourceListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionResourceGetResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionResourceListResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionResourceCreateParam;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionsActionParam;
-import cn.topiam.employee.console.pojo.update.app.AppPermissionResourceUpdateParam;
-import cn.topiam.employee.console.service.app.AppPermissionResourceService;
+import cn.topiam.employee.common.repository.permission.AppPermissionActionRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionResourceRepository;
+import cn.topiam.employee.console.converter.permission.PermissionResourceConverter;
+import cn.topiam.employee.console.pojo.query.permission.PermissionResourceListQuery;
+import cn.topiam.employee.console.pojo.save.permission.PermissionsActionParam;
+import cn.topiam.employee.console.service.permission.PermissionResourceService;
import cn.topiam.employee.support.exception.BadParamsException;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -69,37 +69,37 @@ import static cn.topiam.employee.support.repository.domain.BaseEntity.LAST_MODIF
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionResourceServiceImpl implements AppPermissionResourceService {
+public class PermissionResourceServiceImpl implements PermissionResourceService {
/**
* 获取资源列表
*
* @param page {@link PageModel}
- * @param query {@link AppResourceListQuery}
- * @return {@link AppPermissionResourceListResult}
+ * @param query {@link PermissionResourceListQuery}
+ * @return {@link PermissionResourceListResult}
*/
@Override
- public Page getPermissionResourceList(PageModel page,
- AppResourceListQuery query) {
+ public Page getPermissionResourceList(PageModel page,
+ PermissionResourceListQuery query) {
org.springframework.data.domain.Page data;
- Predicate predicate = appPermissionResourceConverter
+ Predicate predicate = permissionResourceConverter
.resourcePaginationParamConvertToPredicate(query);
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
data = appResourceRepository.findAll(predicate, request);
- return appPermissionResourceConverter.entityConvertToResourceListResult(data);
+ return permissionResourceConverter.entityConvertToResourceListResult(data);
}
/**
* 获取资源
*
* @param id {@link String}
- * @return {@link AppPermissionResourceGetResult}
+ * @return {@link PermissionResourceGetResult}
*/
@Override
- public AppPermissionResourceGetResult getPermissionResource(String id) {
+ public PermissionResourceGetResult getPermissionResource(String id) {
AppPermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
.orElseThrow(AppResourceNotExistException::new);
- return appPermissionResourceConverter.entityConvertToResourceGetResult(resource);
+ return permissionResourceConverter.entityConvertToResourceGetResult(resource);
}
/**
@@ -145,13 +145,13 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
/**
* 创建资源
*
- * @param param {@link AppPermissionResourceCreateParam}
+ * @param param {@link PermissionResourceCreateParam}
* @return {@link Boolean}
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public Boolean createPermissionResource(AppPermissionResourceCreateParam param) {
- AppPermissionResourceEntity resource = appPermissionResourceConverter
+ public Boolean createPermissionResource(PermissionResourceCreateParam param) {
+ AppPermissionResourceEntity resource = permissionResourceConverter
.resourceCreateParamConvertToEntity(param);
buildActions(param.getActions(), resource);
// 新增资源
@@ -164,13 +164,13 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
/**
* 更新资源
*
- * @param param {@link AppPermissionResourceUpdateParam}
+ * @param param {@link PermissionResourceUpdateParam}
* @return {@link Boolean}
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public Boolean updatePermissionResource(AppPermissionResourceUpdateParam param) {
- AppPermissionResourceEntity resource = appPermissionResourceConverter
+ public Boolean updatePermissionResource(PermissionResourceUpdateParam param) {
+ AppPermissionResourceEntity resource = permissionResourceConverter
.resourceUpdateParamConvertToEntity(param);
AppPermissionResourceEntity entity = getAppPermissionResourceEntity(
Long.valueOf(param.getId()));
@@ -248,14 +248,14 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
/**
* 批量处理actions
*
- * @param permissions {@link List}
+ * @param permissions {@link List< PermissionsActionParam >}
* @param resource {@link AppPermissionResourceEntity>}
*/
- private void buildActions(List permissions,
+ private void buildActions(List permissions,
AppPermissionResourceEntity resource) {
// 权限
List list = new ArrayList<>();
- for (AppPermissionsActionParam p : permissions) {
+ for (PermissionsActionParam p : permissions) {
AppPermissionActionEntity entity = new AppPermissionActionEntity();
entity.setResource(resource);
entity.setType(p.getType());
@@ -267,7 +267,7 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
resource.setActions(list);
}
- private final AppPermissionResourceConverter appPermissionResourceConverter;
+ private final PermissionResourceConverter permissionResourceConverter;
private final AppPermissionResourceRepository appResourceRepository;
/**
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionRoleServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
similarity index 79%
rename from eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionRoleServiceImpl.java
rename to eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
index 0864b2be..ff69b12a 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppPermissionRoleServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
@@ -15,13 +15,17 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.console.service.app.impl;
+package cn.topiam.employee.console.service.permission.impl;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
+import cn.topiam.employee.console.converter.permission.PermissionRoleConverter;
+import cn.topiam.employee.console.pojo.result.permission.PermissionRoleListResult;
+import cn.topiam.employee.console.pojo.result.permission.PermissionRoleResult;
+import cn.topiam.employee.console.pojo.save.permission.PermissionRoleCreateParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.querydsl.QPageRequest;
import org.springframework.stereotype.Service;
@@ -33,19 +37,15 @@ import com.querydsl.core.types.dsl.BooleanExpression;
import cn.topiam.employee.audit.context.AuditContext;
import cn.topiam.employee.audit.entity.Target;
import cn.topiam.employee.audit.enums.TargetType;
-import cn.topiam.employee.common.entity.app.AppPermissionRoleEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionRoleEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppRoleNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionRoleRepository;
-import cn.topiam.employee.console.converter.app.AppPermissionRoleConverter;
-import cn.topiam.employee.console.pojo.query.app.AppPermissionRoleListQuery;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionRoleListResult;
-import cn.topiam.employee.console.pojo.result.app.AppPermissionRoleResult;
-import cn.topiam.employee.console.pojo.save.app.AppPermissionRoleCreateParam;
-import cn.topiam.employee.console.pojo.update.app.PermissionRoleUpdateParam;
-import cn.topiam.employee.console.service.app.AppPermissionRoleService;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionRoleRepository;
+import cn.topiam.employee.console.pojo.query.permission.PermissionRoleListQuery;
+import cn.topiam.employee.console.pojo.update.permission.PermissionRoleUpdateParam;
+import cn.topiam.employee.console.service.permission.PermissionRoleService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
import cn.topiam.employee.support.util.BeanUtils;
@@ -64,34 +64,34 @@ import static cn.topiam.employee.support.repository.domain.BaseEntity.LAST_MODIF
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
+public class PermissionRoleServiceImpl implements PermissionRoleService {
/**
* 获取所有角色(分页)
*
* @param page {@link PageModel}
- * @return {@link AppPermissionRoleListResult}
+ * @return {@link PermissionRoleListResult}
*/
@Override
- public Page getPermissionRoleList(PageModel page,
- AppPermissionRoleListQuery query) {
+ public Page getPermissionRoleList(PageModel page,
+ PermissionRoleListQuery query) {
org.springframework.data.domain.Page data;
- Predicate predicate = appPermissionRoleConverter
+ Predicate predicate = permissionRoleConverter
.rolePaginationParamConvertToPredicate(query);
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
data = appPermissionRoleRepository.findAll(predicate, request);
- return appPermissionRoleConverter.entityConvertToRolePaginationResult(data);
+ return permissionRoleConverter.entityConvertToRolePaginationResult(data);
}
/**
* 创建系统
*
- * @param param {@link AppPermissionRoleCreateParam}
+ * @param param {@link PermissionRoleCreateParam}
* @return {@link Boolean}
*/
@Override
- public boolean createPermissionRole(AppPermissionRoleCreateParam param) {
- AppPermissionRoleEntity entity = appPermissionRoleConverter
+ public boolean createPermissionRole(PermissionRoleCreateParam param) {
+ AppPermissionRoleEntity entity = permissionRoleConverter
.roleCreateParamConvertToEntity(param);
appPermissionRoleRepository.save(entity);
AuditContext.setTarget(Target.builder().id(entity.getId().toString())
@@ -105,7 +105,7 @@ public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
*/
@Override
public boolean updatePermissionRole(PermissionRoleUpdateParam param) {
- AppPermissionRoleEntity source = appPermissionRoleConverter
+ AppPermissionRoleEntity source = permissionRoleConverter
.roleUpdateParamConvertToEntity(param);
AppPermissionRoleEntity target = appPermissionRoleRepository
.findById(Long.valueOf(param.getId())).orElseThrow(AppRoleNotExistException::new);
@@ -140,14 +140,14 @@ public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
* 角色详情
*
* @param id {@link Long}
- * @return {@link AppPermissionRoleResult}
+ * @return {@link PermissionRoleResult}
*/
@Override
- public AppPermissionRoleResult getPermissionRole(Long id) {
+ public PermissionRoleResult getPermissionRole(Long id) {
//查询
Optional entity = appPermissionRoleRepository.findById(id);
//映射
- return appPermissionRoleConverter.entityConvertToRoleDetailResult(entity.orElse(null));
+ return permissionRoleConverter.entityConvertToRoleDetailResult(entity.orElse(null));
}
/**
@@ -208,7 +208,7 @@ public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
/**
* 用户数据映射器
*/
- private final AppPermissionRoleConverter appPermissionRoleConverter;
+ private final PermissionRoleConverter permissionRoleConverter;
/**
* RoleRepository
*/
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/MessageSettingService.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/MessageSettingService.java
index 273675c1..bcf3e974 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/MessageSettingService.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/MessageSettingService.java
@@ -20,7 +20,7 @@ package cn.topiam.employee.console.service.setting;
import cn.topiam.employee.console.pojo.result.setting.EmailProviderConfigResult;
import cn.topiam.employee.console.pojo.save.setting.MailProviderSaveParam;
import cn.topiam.employee.console.pojo.save.setting.SmsProviderSaveParam;
-import cn.topiam.employee.console.pojo.setting.SmsProviderConfigResult;
+import cn.topiam.employee.console.pojo.result.setting.SmsProviderConfigResult;
/**
* 消息设置接口
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/impl/MessageSettingServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/impl/MessageSettingServiceImpl.java
index 500bf90d..9b87d537 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/impl/MessageSettingServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/setting/impl/MessageSettingServiceImpl.java
@@ -25,7 +25,7 @@ import cn.topiam.employee.console.converter.setting.MessageSettingConverter;
import cn.topiam.employee.console.pojo.result.setting.EmailProviderConfigResult;
import cn.topiam.employee.console.pojo.save.setting.MailProviderSaveParam;
import cn.topiam.employee.console.pojo.save.setting.SmsProviderSaveParam;
-import cn.topiam.employee.console.pojo.setting.SmsProviderConfigResult;
+import cn.topiam.employee.console.pojo.result.setting.SmsProviderConfigResult;
import cn.topiam.employee.console.service.setting.MessageSettingService;
import cn.topiam.employee.support.context.ApplicationContextHelp;
import static cn.topiam.employee.common.constant.ConfigBeanNameConstants.MAIL_PROVIDER_SEND;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java
index 83396cdb..fab71c28 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java
@@ -20,7 +20,7 @@ package cn.topiam.employee.openapi.converter.app;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
-import cn.topiam.employee.common.entity.app.AppPermissionActionEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
import cn.topiam.employee.openapi.pojo.request.app.AppPermissionsActionParam;
/**
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java
index 1596e1ab..9302c07f 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java
@@ -23,8 +23,8 @@ import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.util.CollectionUtils;
-import cn.topiam.employee.common.entity.app.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.app.po.AppPermissionPolicyPO;
+import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionPolicyCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionPolicyUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java
index f039ff60..d92bbcf8 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java
@@ -28,8 +28,8 @@ import org.springframework.util.CollectionUtils;
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
-import cn.topiam.employee.common.entity.app.AppPermissionResourceEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.openapi.pojo.request.app.query.AppResourceListQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionResourceCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionResourceUpdateParam;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionRoleConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionRoleConverter.java
index 3b6c7156..0bb1b79a 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionRoleConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionRoleConverter.java
@@ -29,8 +29,8 @@ import org.springframework.util.ObjectUtils;
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
-import cn.topiam.employee.common.entity.app.AppPermissionRoleEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionRoleEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
import cn.topiam.employee.openapi.pojo.request.app.query.AppPermissionRoleListQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionRoleCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.PermissionRoleUpdateParam;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionPolicyEndpoint.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionPolicyEndpoint.java
index d6d3d9ef..4a13be00 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionPolicyEndpoint.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionPolicyEndpoint.java
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import cn.topiam.employee.common.entity.app.po.AppPermissionPolicyPO;
+import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.openapi.pojo.request.app.query.OpenApiPolicyQuery;
import cn.topiam.employee.openapi.service.AppPermissionPolicyService;
import cn.topiam.employee.support.repository.page.domain.Page;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionPolicyService.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionPolicyService.java
index fe7c94e8..55d623f3 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionPolicyService.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionPolicyService.java
@@ -17,7 +17,7 @@
*/
package cn.topiam.employee.openapi.service;
-import cn.topiam.employee.common.entity.app.po.AppPermissionPolicyPO;
+import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.openapi.pojo.request.app.query.OpenApiPolicyQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionPolicyCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionPolicyUpdateParam;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionPolicyServiceImpl.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionPolicyServiceImpl.java
index 643ee508..57590c05 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionPolicyServiceImpl.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionPolicyServiceImpl.java
@@ -21,11 +21,11 @@ import org.springframework.data.querydsl.QPageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import cn.topiam.employee.common.entity.app.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.app.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
+import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.exception.app.AppPolicyNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
import cn.topiam.employee.openapi.converter.app.AppPermissionPolicyConverter;
import cn.topiam.employee.openapi.pojo.request.app.query.OpenApiPolicyQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionPolicyCreateParam;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java
index e7d1bb26..8c48d2ee 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java
@@ -31,14 +31,14 @@ import org.springframework.transaction.annotation.Transactional;
import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.BooleanExpression;
-import cn.topiam.employee.common.entity.app.AppPermissionActionEntity;
-import cn.topiam.employee.common.entity.app.AppPermissionResourceEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppResourceNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionActionRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionResourceRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionActionRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionResourceRepository;
import cn.topiam.employee.openapi.converter.app.AppPermissionResourceConverter;
import cn.topiam.employee.openapi.pojo.request.app.AppPermissionsActionParam;
import cn.topiam.employee.openapi.pojo.request.app.query.AppResourceListQuery;
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionRoleServiceImpl.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionRoleServiceImpl.java
index 3194c22b..23742471 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionRoleServiceImpl.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionRoleServiceImpl.java
@@ -30,12 +30,12 @@ import org.springframework.transaction.annotation.Transactional;
import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.BooleanExpression;
-import cn.topiam.employee.common.entity.app.AppPermissionRoleEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionRoleEntity;
+import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppRoleNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.common.repository.app.AppPermissionRoleRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.common.repository.permission.AppPermissionRoleRepository;
import cn.topiam.employee.openapi.converter.app.AppPermissionRoleConverter;
import cn.topiam.employee.openapi.pojo.request.app.query.AppPermissionRoleListQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionRoleCreateParam;
From 54ac2665cee652a410acb6a5f4a4c0b822650f37 Mon Sep 17 00:00:00 2001
From: smallbun <2689170096@qq.com>
Date: Mon, 18 Sep 2023 23:40:33 +0800
Subject: [PATCH 2/3] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ntity.java => PermissionActionEntity.java} | 4 +-
...ntity.java => PermissionPolicyEntity.java} | 2 +-
...ity.java => PermissionResourceEntity.java} | 4 +-
...eEntity.java => PermissionRoleEntity.java} | 2 +-
...nPolicyPO.java => PermissionPolicyPO.java} | 2 +-
...missionPolicyRepositoryCustomizedImpl.java | 6 +-
.../mapper/AppPermissionPolicyPoMapper.java | 26 ++--
.../AppPermissionActionRepository.java | 12 +-
.../AppPermissionPolicyRepository.java | 8 +-
...pPermissionPolicyRepositoryCustomized.java | 6 +-
.../AppPermissionResourceRepository.java | 10 +-
.../AppPermissionRoleRepository.java | 10 +-
.../permission/PermissionActionConverter.java | 16 +--
.../permission/PermissionPolicyConverter.java | 22 +--
.../PermissionResourceConverter.java | 24 ++--
.../permission/PermissionRoleConverter.java | 24 ++--
.../impl/PermissionActionServiceImpl.java | 4 +-
.../impl/PermissionPolicyServiceImpl.java | 10 +-
.../impl/PermissionResourceServiceImpl.java | 42 +++---
.../impl/PermissionRoleServiceImpl.java | 14 +-
...er.java => PermissionActionConverter.java} | 8 +-
...er.java => PermissionPolicyConverter.java} | 22 +--
....java => PermissionResourceConverter.java} | 28 ++--
...rter.java => PermissionRoleConverter.java} | 26 ++--
.../AppPermissionPolicyEndpoint.java | 12 +-
.../service/AppPermissionPolicyService.java | 6 +-
.../impl/AppPermissionPolicyServiceImpl.java | 22 +--
.../AppPermissionResourceServiceImpl.java | 44 +++---
.../impl/AppPermissionRoleServiceImpl.java | 24 ++--
.../app/PermissionActionConverterImpl.java | 45 +++++++
.../app/PermissionPolicyConverterImpl.java | 53 ++++++++
.../app/PermissionResourceConverterImpl.java | 125 ++++++++++++++++++
.../app/PermissionRoleConverterImpl.java | 98 ++++++++++++++
33 files changed, 541 insertions(+), 220 deletions(-)
rename eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/{AppPermissionActionEntity.java => PermissionActionEntity.java} (94%)
rename eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/{AppPermissionPolicyEntity.java => PermissionPolicyEntity.java} (97%)
rename eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/{AppPermissionResourceEntity.java => PermissionResourceEntity.java} (95%)
rename eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/{AppPermissionRoleEntity.java => PermissionRoleEntity.java} (96%)
rename eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/{AppPermissionPolicyPO.java => PermissionPolicyPO.java} (97%)
rename eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/{AppPermissionActionConverter.java => PermissionActionConverter.java} (85%)
rename eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/{AppPermissionPolicyConverter.java => PermissionPolicyConverter.java} (76%)
rename eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/{AppPermissionResourceConverter.java => PermissionResourceConverter.java} (84%)
rename eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/{AppPermissionRoleConverter.java => PermissionRoleConverter.java} (85%)
create mode 100644 eiam-openapi/target/generated-sources/annotations/cn/topiam/employee/openapi/converter/app/PermissionActionConverterImpl.java
create mode 100644 eiam-openapi/target/generated-sources/annotations/cn/topiam/employee/openapi/converter/app/PermissionPolicyConverterImpl.java
create mode 100644 eiam-openapi/target/generated-sources/annotations/cn/topiam/employee/openapi/converter/app/PermissionResourceConverterImpl.java
create mode 100644 eiam-openapi/target/generated-sources/annotations/cn/topiam/employee/openapi/converter/app/PermissionRoleConverterImpl.java
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionActionEntity.java b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionActionEntity.java
similarity index 94%
rename from eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionActionEntity.java
rename to eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionActionEntity.java
index dbf3da03..8655e58b 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionActionEntity.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionActionEntity.java
@@ -48,7 +48,7 @@ import static cn.topiam.employee.support.repository.domain.LogicDeleteEntity.SOF
@Table(name = "app_permission_action")
@SQLDelete(sql = "update app_permission_action set " + SOFT_DELETE_SET + " where id_ = ?")
@Where(clause = SOFT_DELETE_WHERE)
-public class AppPermissionActionEntity extends LogicDeleteEntity {
+public class PermissionActionEntity extends LogicDeleteEntity {
@Serial
private static final long serialVersionUID = -3954680915360748087L;
@@ -75,5 +75,5 @@ public class AppPermissionActionEntity extends LogicDeleteEntity {
*/
@ManyToOne
@JoinColumn(name = "resource_id")
- private AppPermissionResourceEntity resource;
+ private PermissionResourceEntity resource;
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionPolicyEntity.java b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionPolicyEntity.java
similarity index 97%
rename from eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionPolicyEntity.java
rename to eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionPolicyEntity.java
index 6f14bdc1..8ca2d8f8 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionPolicyEntity.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionPolicyEntity.java
@@ -50,7 +50,7 @@ import static cn.topiam.employee.support.repository.domain.LogicDeleteEntity.SOF
@Table(name = "app_permission_policy")
@SQLDelete(sql = "update app_permission_policy set " + SOFT_DELETE_SET + " where id_ = ?")
@Where(clause = SOFT_DELETE_WHERE)
-public class AppPermissionPolicyEntity extends LogicDeleteEntity {
+public class PermissionPolicyEntity extends LogicDeleteEntity {
/**
* 应用id
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionResourceEntity.java b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionResourceEntity.java
similarity index 95%
rename from eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionResourceEntity.java
rename to eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionResourceEntity.java
index f63c1204..99fbf8a3 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionResourceEntity.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionResourceEntity.java
@@ -52,7 +52,7 @@ import static jakarta.persistence.FetchType.LAZY;
@Table(name = "app_permission_resource")
@SQLDelete(sql = "update app_permission_resource set " + SOFT_DELETE_SET + " where id_ = ?")
@Where(clause = SOFT_DELETE_WHERE)
-public class AppPermissionResourceEntity extends LogicDeleteEntity {
+public class PermissionResourceEntity extends LogicDeleteEntity {
@Serial
private static final long serialVersionUID = 7342074686605139968L;
@@ -93,5 +93,5 @@ public class AppPermissionResourceEntity extends LogicDeleteEntity {
@ToString.Exclude
@OneToMany(mappedBy = "resource", fetch = LAZY, cascade = { CascadeType.PERSIST,
CascadeType.REMOVE })
- private List actions;
+ private List actions;
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionRoleEntity.java b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionRoleEntity.java
similarity index 96%
rename from eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionRoleEntity.java
rename to eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionRoleEntity.java
index b2dedb43..5e3055ae 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/AppPermissionRoleEntity.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/PermissionRoleEntity.java
@@ -51,7 +51,7 @@ import static cn.topiam.employee.support.repository.domain.LogicDeleteEntity.SOF
@Table(name = "app_permission_role")
@SQLDelete(sql = "update app_permission_role set " + SOFT_DELETE_SET + " where id_ = ?")
@Where(clause = SOFT_DELETE_WHERE)
-public class AppPermissionRoleEntity extends LogicDeleteEntity {
+public class PermissionRoleEntity extends LogicDeleteEntity {
@Serial
private static final long serialVersionUID = -7761332532995424593L;
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/AppPermissionPolicyPO.java b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/PermissionPolicyPO.java
similarity index 97%
rename from eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/AppPermissionPolicyPO.java
rename to eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/PermissionPolicyPO.java
index 08b0d595..662d7991 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/AppPermissionPolicyPO.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/entity/permission/po/PermissionPolicyPO.java
@@ -38,7 +38,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
@Data
@Accessors(chain = true)
@Schema(description = "分页查询策略响应")
-public class AppPermissionPolicyPO implements Serializable {
+public class PermissionPolicyPO implements Serializable {
@Serial
private static final long serialVersionUID = 3320953184046791392L;
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppPermissionPolicyRepositoryCustomizedImpl.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppPermissionPolicyRepositoryCustomizedImpl.java
index 7e3c1997..fcdd0f8e 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppPermissionPolicyRepositoryCustomizedImpl.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/AppPermissionPolicyRepositoryCustomizedImpl.java
@@ -19,6 +19,7 @@ package cn.topiam.employee.common.repository.app.impl;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
@@ -29,7 +30,6 @@ import org.springframework.util.ObjectUtils;
import com.google.common.collect.Lists;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.repository.app.impl.mapper.AppPermissionPolicyPoMapper;
import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepositoryCustomized;
@@ -49,7 +49,7 @@ public class AppPermissionPolicyRepositoryCustomizedImpl implements
}
@Override
- public Page findPage(AppPolicyQuery query, Pageable pageable) {
+ public Page findPage(AppPolicyQuery query, Pageable pageable) {
//查询条件
//@formatter:off
// 所属应用
@@ -111,7 +111,7 @@ public class AppPermissionPolicyRepositoryCustomizedImpl implements
.append(" FROM app_permission_policy policy ").append(subjectJoin).append(objectJoin);
// @formatter:off
- List list = jdbcTemplate
+ List list = jdbcTemplate
.query(
selectSql.append(" LIMIT ").append(pageable.getPageNumber() * pageable.getPageSize())
.append(",").append(pageable.getPageSize()).toString(),
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/mapper/AppPermissionPolicyPoMapper.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/mapper/AppPermissionPolicyPoMapper.java
index 954a586c..54863c41 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/mapper/AppPermissionPolicyPoMapper.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/impl/mapper/AppPermissionPolicyPoMapper.java
@@ -20,9 +20,9 @@ package cn.topiam.employee.common.repository.app.impl.mapper;
import java.sql.ResultSet;
import java.sql.SQLException;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import org.springframework.jdbc.core.RowMapper;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.common.enums.app.AppPolicyEffect;
import cn.topiam.employee.common.enums.app.AppPolicyObjectType;
import cn.topiam.employee.common.enums.app.AppPolicySubjectType;
@@ -31,7 +31,7 @@ import cn.topiam.employee.common.enums.app.AppPolicySubjectType;
* @author TopIAM
* Created by support@topiam.cn on 2022/2/13 23:25
*/
-public class AppPermissionPolicyPoMapper implements RowMapper {
+public class AppPermissionPolicyPoMapper implements RowMapper {
/**
* Implementations must implement this method to map each row of data
@@ -46,18 +46,18 @@ public class AppPermissionPolicyPoMapper implements RowMapper,
- QuerydslPredicateExecutor {
+ LogicDeleteRepository,
+ QuerydslPredicateExecutor {
/**
* findAllByResource
*
- * @param resource {@link AppPermissionResourceEntity}
+ * @param resource {@link PermissionResourceEntity}
* @return {@link List}
*/
- List findAllByResource(AppPermissionResourceEntity resource);
+ List findAllByResource(PermissionResourceEntity resource);
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepository.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepository.java
index 76e2f0f7..4bea3303 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepository.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepository.java
@@ -20,6 +20,7 @@ package cn.topiam.employee.common.repository.permission;
import java.io.Serializable;
import java.util.Collection;
+import cn.topiam.employee.common.entity.permission.PermissionPolicyEntity;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
@@ -27,7 +28,6 @@ import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
-import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
import cn.topiam.employee.support.repository.LogicDeleteRepository;
import static cn.topiam.employee.support.repository.domain.LogicDeleteEntity.SOFT_DELETE_SET;
@@ -37,8 +37,8 @@ import static cn.topiam.employee.support.repository.domain.LogicDeleteEntity.SOF
*/
@Repository
public interface AppPermissionPolicyRepository extends AppPermissionPolicyRepositoryCustomized,
- LogicDeleteRepository,
- QuerydslPredicateExecutor {
+ LogicDeleteRepository,
+ QuerydslPredicateExecutor {
/**
* 按主体 ID 删除所有
*
@@ -81,6 +81,6 @@ public interface AppPermissionPolicyRepository extends AppPermissionPolicyReposi
*/
@Transactional(rollbackFor = Exception.class)
@Modifying
- @Query(value = "UPDATE AppPermissionResourceEntity set enabled =:status WHERE id =:id")
+ @Query(value = "UPDATE PermissionResourceEntity set enabled =:status WHERE id =:id")
Integer updateStatus(@Param(value = "id") Long id, @Param(value = "status") Boolean status);
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepositoryCustomized.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepositoryCustomized.java
index 6eba8eca..c65c1ee0 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepositoryCustomized.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionPolicyRepositoryCustomized.java
@@ -17,11 +17,11 @@
*/
package cn.topiam.employee.common.repository.permission;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
/**
* @author TopIAM
@@ -33,7 +33,7 @@ public interface AppPermissionPolicyRepositoryCustomized {
*
* @param query {@link AppPolicyQuery}
* @param request {@link Pageable}
- * @return {@link AppPermissionPolicyPO}
+ * @return {@link PermissionPolicyPO}
*/
- Page findPage(AppPolicyQuery query, Pageable request);
+ Page findPage(AppPolicyQuery query, Pageable request);
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionResourceRepository.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionResourceRepository.java
index 6170c4f6..169e5293 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionResourceRepository.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionResourceRepository.java
@@ -19,13 +19,13 @@ package cn.topiam.employee.common.repository.permission;
import java.util.Optional;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.support.repository.LogicDeleteRepository;
/**
@@ -38,16 +38,16 @@ import cn.topiam.employee.support.repository.LogicDeleteRepository;
*/
@Repository
public interface AppPermissionResourceRepository extends
- LogicDeleteRepository,
- QuerydslPredicateExecutor {
+ LogicDeleteRepository,
+ QuerydslPredicateExecutor {
/**
* findByIdContainsDeleted
*
* @param id must not be {@literal null}.
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
@NotNull
@Query(value = "SELECT * FROM app_permission_resource WHERE id_ = :id", nativeQuery = true)
- Optional findByIdContainsDeleted(@NotNull @Param(value = "id") Long id);
+ Optional findByIdContainsDeleted(@NotNull @Param(value = "id") Long id);
}
diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionRoleRepository.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionRoleRepository.java
index 9a2253d0..c545d62d 100644
--- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionRoleRepository.java
+++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/permission/AppPermissionRoleRepository.java
@@ -19,6 +19,7 @@ package cn.topiam.employee.common.repository.permission;
import java.util.Optional;
+import cn.topiam.employee.common.entity.permission.PermissionRoleEntity;
import org.jetbrains.annotations.NotNull;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Modifying;
@@ -28,7 +29,6 @@ import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
-import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
import cn.topiam.employee.support.repository.LogicDeleteRepository;
/**
@@ -41,8 +41,8 @@ import cn.topiam.employee.support.repository.LogicDeleteRepository;
*/
@Repository
public interface AppPermissionRoleRepository extends
- LogicDeleteRepository,
- QuerydslPredicateExecutor {
+ LogicDeleteRepository,
+ QuerydslPredicateExecutor {
/**
* 更新角色状态
*
@@ -58,10 +58,10 @@ public interface AppPermissionRoleRepository extends
* findByIdContainsDeleted
*
* @param id must not be {@literal null}.
- * @return {@link AppPermissionRoleEntity}
+ * @return {@link PermissionRoleEntity}
*/
@NotNull
@Cacheable
@Query(value = "SELECT * FROM app_permission_role WHERE id_ = :id", nativeQuery = true)
- Optional findByIdContainsDeleted(@NotNull @Param(value = "id") Long id);
+ Optional findByIdContainsDeleted(@NotNull @Param(value = "id") Long id);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionActionConverter.java b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionActionConverter.java
index 6e69fd76..ef46a91b 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionActionConverter.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionActionConverter.java
@@ -20,6 +20,8 @@ package cn.topiam.employee.console.converter.permission;
import java.util.ArrayList;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionActionEntity;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@@ -29,8 +31,6 @@ import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.common.enums.PermissionActionType;
import cn.topiam.employee.console.pojo.query.permission.PermissionActionListQuery;
import cn.topiam.employee.console.pojo.result.permission.PermissionActionListResult;
@@ -68,18 +68,18 @@ public interface PermissionActionConverter {
/**
* 实体转资源权限结果返回
*
- * @param list {@link AppPermissionResourceEntity}
+ * @param list {@link PermissionResourceEntity}
* @return {@link PermissionActionListResult}
*/
- default List entityConvertToResourceActionListResult(List list) {
+ default List entityConvertToResourceActionListResult(List list) {
List results = new ArrayList<>();
List menus = new ArrayList<>();
List apis = new ArrayList<>();
List buttons = new ArrayList<>();
List others = new ArrayList<>();
List datas = new ArrayList<>();
- for (AppPermissionResourceEntity resource : list) {
- for (AppPermissionActionEntity action : resource.getActions()) {
+ for (PermissionResourceEntity resource : list) {
+ for (PermissionActionEntity action : resource.getActions()) {
if (PermissionActionType.MENU.equals(action.getType())) {
menus.add(actionConvertToResourceActionResult(action));
}
@@ -117,10 +117,10 @@ public interface PermissionActionConverter {
/**
* actionConvertToResourceActionResult
*
- * @param action {@link AppPermissionActionEntity}
+ * @param action {@link PermissionActionEntity}
* @return {@link PermissionActionListResult.Action}
*/
@Mapping(target = "access", source = "value")
- PermissionActionListResult.Action actionConvertToResourceActionResult(AppPermissionActionEntity action);
+ PermissionActionListResult.Action actionConvertToResourceActionResult(PermissionActionEntity action);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionPolicyConverter.java b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionPolicyConverter.java
index e383c918..437723ea 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionPolicyConverter.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionPolicyConverter.java
@@ -20,14 +20,14 @@ package cn.topiam.employee.console.converter.permission;
import java.util.ArrayList;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import cn.topiam.employee.console.pojo.result.permission.PermissionPolicyListResult;
import cn.topiam.employee.console.pojo.save.permission.PermissionPolicyCreateParam;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.util.CollectionUtils;
-import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.console.pojo.update.permission.PermissionPolicyUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
@@ -44,7 +44,7 @@ public interface PermissionPolicyConverter {
* 资源创建参数转实体类
*
* @param param {@link PermissionPolicyCreateParam}
- * @return {@link AppPermissionPolicyEntity}
+ * @return {@link PermissionPolicyEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "id", ignore = true)
@@ -53,13 +53,13 @@ public interface PermissionPolicyConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionPolicyEntity policyCreateParamConvertToEntity(PermissionPolicyCreateParam param);
+ PermissionPolicyEntity policyCreateParamConvertToEntity(PermissionPolicyCreateParam param);
/**
* 资源修改参数转实体类
*
* @param param {@link PermissionPolicyCreateParam}
- * @return {@link AppPermissionPolicyEntity}
+ * @return {@link PermissionPolicyEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "updateTime", ignore = true)
@@ -67,7 +67,7 @@ public interface PermissionPolicyConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionPolicyEntity policyUpdateParamConvertToEntity(PermissionPolicyUpdateParam param);
+ PermissionPolicyEntity policyUpdateParamConvertToEntity(PermissionPolicyUpdateParam param);
/**
* 资源转换为资源列表结果
@@ -75,9 +75,9 @@ public interface PermissionPolicyConverter {
* @param page {@link Page}
* @return {@link Page}
*/
- default Page entityConvertToPolicyListResult(org.springframework.data.domain.Page page) {
+ default Page entityConvertToPolicyListResult(org.springframework.data.domain.Page page) {
Page result = new Page<>();
- List pageList = page.getContent();
+ List pageList = page.getContent();
if (!CollectionUtils.isEmpty(pageList)) {
//@formatter:off
result.setPagination(Page.Pagination.builder()
@@ -87,7 +87,7 @@ public interface PermissionPolicyConverter {
.build());
//@formatter:on
List list = new ArrayList<>();
- for (AppPermissionPolicyPO po : pageList) {
+ for (PermissionPolicyPO po : pageList) {
list.add(entityConvertToPolicyListResult(po));
}
result.setList(list);
@@ -99,7 +99,7 @@ public interface PermissionPolicyConverter {
* entityConvertToPolicyListResult
*
* @param entity {@link PermissionPolicyListResult}
- * @return {@link AppPermissionPolicyPO}
+ * @return {@link PermissionPolicyPO}
*/
- PermissionPolicyListResult entityConvertToPolicyListResult(AppPermissionPolicyPO entity);
+ PermissionPolicyListResult entityConvertToPolicyListResult(PermissionPolicyPO entity);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionResourceConverter.java b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionResourceConverter.java
index e840c3d8..ce6df9ea 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionResourceConverter.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionResourceConverter.java
@@ -20,6 +20,7 @@ package cn.topiam.employee.console.converter.permission;
import java.util.ArrayList;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import cn.topiam.employee.console.pojo.result.permission.PermissionResourceGetResult;
import cn.topiam.employee.console.pojo.result.permission.PermissionResourceListResult;
import cn.topiam.employee.console.pojo.update.permission.PermissionResourceUpdateParam;
@@ -33,7 +34,6 @@ import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.console.pojo.query.permission.PermissionResourceListQuery;
import cn.topiam.employee.console.pojo.save.permission.PermissionResourceCreateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
@@ -71,7 +71,7 @@ public interface PermissionResourceConverter {
* 资源创建参数转实体类
*
* @param param {@link PermissionResourceCreateParam}
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "actions", ignore = true)
@@ -81,13 +81,13 @@ public interface PermissionResourceConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionResourceEntity resourceCreateParamConvertToEntity(PermissionResourceCreateParam param);
+ PermissionResourceEntity resourceCreateParamConvertToEntity(PermissionResourceCreateParam param);
/**
* 资源修改参数转实体类
*
* @param param {@link PermissionResourceCreateParam}
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "actions", ignore = true)
@@ -96,7 +96,7 @@ public interface PermissionResourceConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionResourceEntity resourceUpdateParamConvertToEntity(PermissionResourceUpdateParam param);
+ PermissionResourceEntity resourceUpdateParamConvertToEntity(PermissionResourceUpdateParam param);
/**
* 资源转换为资源列表结果
@@ -104,12 +104,12 @@ public interface PermissionResourceConverter {
* @param page {@link Page}
* @return {@link Page}
*/
- default Page entityConvertToResourceListResult(org.springframework.data.domain.Page page) {
+ default Page entityConvertToResourceListResult(org.springframework.data.domain.Page page) {
Page result = new Page<>();
- List pageList = page.getContent();
+ List pageList = page.getContent();
if (!CollectionUtils.isEmpty(pageList)) {
List list = new ArrayList<>();
- for (AppPermissionResourceEntity resource : pageList) {
+ for (PermissionResourceEntity resource : pageList) {
list.add(entityConvertToResourceListResult(resource));
}
//@formatter:off
@@ -127,17 +127,17 @@ public interface PermissionResourceConverter {
/**
* 实体转换为资源列表结果
*
- * @param data {@link AppPermissionResourceEntity}
+ * @param data {@link PermissionResourceEntity}
* @return {@link PermissionResourceListResult}
*/
- PermissionResourceListResult entityConvertToResourceListResult(AppPermissionResourceEntity data);
+ PermissionResourceListResult entityConvertToResourceListResult(PermissionResourceEntity data);
/**
* 实体转获取详情返回
*
- * @param resource {@link AppPermissionResourceEntity}
+ * @param resource {@link PermissionResourceEntity}
* @return {@link PermissionResourceGetResult}
*/
@Mapping(target = "actions", source = "actions")
- PermissionResourceGetResult entityConvertToResourceGetResult(AppPermissionResourceEntity resource);
+ PermissionResourceGetResult entityConvertToResourceGetResult(PermissionResourceEntity resource);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionRoleConverter.java b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionRoleConverter.java
index d37c3e0a..18b1310a 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionRoleConverter.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/converter/permission/PermissionRoleConverter.java
@@ -31,7 +31,7 @@ import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
import cn.topiam.employee.common.entity.app.QAppPermissionRoleEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
+import cn.topiam.employee.common.entity.permission.PermissionRoleEntity;
import cn.topiam.employee.console.pojo.query.permission.PermissionRoleListQuery;
import cn.topiam.employee.console.pojo.result.permission.PermissionRoleListResult;
import cn.topiam.employee.console.pojo.result.permission.PermissionRoleResult;
@@ -53,11 +53,11 @@ public interface PermissionRoleConverter {
* @param page {@link Page}
* @return {@link Page}
*/
- default Page entityConvertToRolePaginationResult(org.springframework.data.domain.Page page) {
+ default Page entityConvertToRolePaginationResult(org.springframework.data.domain.Page page) {
Page result = new Page<>();
if (!CollectionUtils.isEmpty(page.getContent())) {
List list = new ArrayList<>();
- for (AppPermissionRoleEntity user : page.getContent()) {
+ for (PermissionRoleEntity user : page.getContent()) {
list.add(entityConvertToRolePaginationResult(user));
}
//@formatter:off
@@ -75,16 +75,16 @@ public interface PermissionRoleConverter {
/**
* 角色实体转换为角色分页结果
*
- * @param page {@link AppPermissionRoleEntity}
+ * @param page {@link PermissionRoleEntity}
* @return {@link PermissionRoleListResult}
*/
- PermissionRoleListResult entityConvertToRolePaginationResult(AppPermissionRoleEntity page);
+ PermissionRoleListResult entityConvertToRolePaginationResult(PermissionRoleEntity page);
/**
* 角色创建参数转换为角色实体
*
* @param param {@link PermissionRoleCreateParam}
- * @return {@link AppPermissionRoleEntity}
+ * @return {@link PermissionRoleEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "id", ignore = true)
@@ -93,13 +93,13 @@ public interface PermissionRoleConverter {
@Mapping(target = "updateBy", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionRoleEntity roleCreateParamConvertToEntity(PermissionRoleCreateParam param);
+ PermissionRoleEntity roleCreateParamConvertToEntity(PermissionRoleCreateParam param);
/**
* 角色更新参数转换为角色实体类
*
* @param param {@link PermissionRoleUpdateParam} 更新参数
- * @return {@link AppPermissionRoleEntity} 角色实体
+ * @return {@link PermissionRoleEntity} 角色实体
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "appId", ignore = true)
@@ -108,21 +108,21 @@ public interface PermissionRoleConverter {
@Mapping(target = "updateBy", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionRoleEntity roleUpdateParamConvertToEntity(PermissionRoleUpdateParam param);
+ PermissionRoleEntity roleUpdateParamConvertToEntity(PermissionRoleUpdateParam param);
/**
* 实体转系统详情结果
*
- * @param role {@link AppPermissionRoleEntity}
+ * @param role {@link PermissionRoleEntity}
* @return {@link PermissionRoleResult}
*/
- PermissionRoleResult entityConvertToRoleDetailResult(AppPermissionRoleEntity role);
+ PermissionRoleResult entityConvertToRoleDetailResult(PermissionRoleEntity role);
/**
* 角色分页查询参数转实体
*
* @param query {@link PermissionRoleListQuery}
- * @return {@link AppPermissionRoleEntity}
+ * @return {@link PermissionRoleEntity}
*/
default Predicate rolePaginationParamConvertToPredicate(PermissionRoleListQuery query) {
QAppPermissionRoleEntity role = QAppPermissionRoleEntity.appPermissionRoleEntity;
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
index ae818747..e4220d5a 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionActionServiceImpl.java
@@ -19,12 +19,12 @@ package cn.topiam.employee.console.service.permission.impl;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import cn.topiam.employee.console.converter.permission.PermissionActionConverter;
import org.springframework.stereotype.Service;
import com.querydsl.core.types.Predicate;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.common.repository.permission.AppPermissionResourceRepository;
import cn.topiam.employee.console.pojo.query.permission.PermissionActionListQuery;
import cn.topiam.employee.console.pojo.result.permission.PermissionActionListResult;
@@ -54,7 +54,7 @@ public class PermissionActionServiceImpl implements PermissionActionService {
public List getPermissionActionList(PermissionActionListQuery query) {
Predicate predicate = permissionActionConverter
.appPermissionActionListQueryConvertToPredicate(query);
- List list = (List) appPermissionResourceRepository
+ List list = (List) appPermissionResourceRepository
.findAll(predicate);
return permissionActionConverter.entityConvertToResourceActionListResult(list);
}
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
index a3534a8f..d5759175 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionPolicyServiceImpl.java
@@ -24,8 +24,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.topiam.employee.common.entity.app.query.AppPolicyQuery;
-import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
+import cn.topiam.employee.common.entity.permission.PermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import cn.topiam.employee.common.exception.app.AppPolicyNotExistException;
import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
import cn.topiam.employee.console.converter.permission.PermissionPolicyConverter;
@@ -59,7 +59,7 @@ public class PermissionPolicyServiceImpl implements PermissionPolicyService {
@Override
public Page getPermissionPolicyList(PageModel page,
AppPolicyQuery query) {
- org.springframework.data.domain.Page data;
+ org.springframework.data.domain.Page data;
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
data = appPermissionPolicyRepository.findPage(query, request);
return permissionPolicyConverter.entityConvertToPolicyListResult(data);
@@ -100,7 +100,7 @@ public class PermissionPolicyServiceImpl implements PermissionPolicyService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean createPermissionPolicy(PermissionPolicyCreateParam param) {
- AppPermissionPolicyEntity resource = permissionPolicyConverter
+ PermissionPolicyEntity resource = permissionPolicyConverter
.policyCreateParamConvertToEntity(param);
// 新增策略
appPermissionPolicyRepository.save(resource);
@@ -115,7 +115,7 @@ public class PermissionPolicyServiceImpl implements PermissionPolicyService {
*/
@Override
public Boolean updatePermissionPolicy(PermissionPolicyUpdateParam param) {
- AppPermissionPolicyEntity resource = permissionPolicyConverter
+ PermissionPolicyEntity resource = permissionPolicyConverter
.policyUpdateParamConvertToEntity(param);
// 更新策略
appPermissionPolicyRepository.save(resource);
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
index 0cba28a0..5e274505 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionResourceServiceImpl.java
@@ -23,6 +23,8 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
+import cn.topiam.employee.common.entity.permission.PermissionActionEntity;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import cn.topiam.employee.console.pojo.result.permission.PermissionResourceGetResult;
import cn.topiam.employee.console.pojo.result.permission.PermissionResourceListResult;
import cn.topiam.employee.console.pojo.save.permission.PermissionResourceCreateParam;
@@ -39,8 +41,6 @@ import cn.topiam.employee.audit.context.AuditContext;
import cn.topiam.employee.audit.entity.Target;
import cn.topiam.employee.audit.enums.TargetType;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppResourceNotExistException;
import cn.topiam.employee.common.repository.permission.AppPermissionActionRepository;
@@ -81,7 +81,7 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
@Override
public Page getPermissionResourceList(PageModel page,
PermissionResourceListQuery query) {
- org.springframework.data.domain.Page data;
+ org.springframework.data.domain.Page data;
Predicate predicate = permissionResourceConverter
.resourcePaginationParamConvertToPredicate(query);
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
@@ -97,7 +97,7 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
*/
@Override
public PermissionResourceGetResult getPermissionResource(String id) {
- AppPermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
+ PermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
.orElseThrow(AppResourceNotExistException::new);
return permissionResourceConverter.entityConvertToResourceGetResult(resource);
}
@@ -112,12 +112,12 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
@Transactional(rollbackFor = Exception.class)
public Boolean deletePermissionResource(String id) {
Long resourceId = Long.valueOf(id);
- AppPermissionResourceEntity resource = appResourceRepository.findById(resourceId)
+ PermissionResourceEntity resource = appResourceRepository.findById(resourceId)
.orElseThrow(AppResourceNotExistException::new);
- List actionList = appPermissionActionRepository
+ List actionList = appPermissionActionRepository
.findAllByResource(resource);
List objectIdList = new ArrayList<>(
- actionList.stream().map(AppPermissionActionEntity::getId).toList());
+ actionList.stream().map(PermissionActionEntity::getId).toList());
objectIdList.add(resourceId);
appPermissionPolicyRepository.deleteAllByObjectIdIn(objectIdList);
appResourceRepository.deleteById(resourceId);
@@ -135,7 +135,7 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
*/
@Override
public Boolean updateStatus(Long id, boolean enabled) {
- AppPermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
+ PermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
.orElseThrow(AppResourceNotExistException::new);
AuditContext.setTarget(
Target.builder().id(id.toString()).type(TargetType.APP_PERMISSION_RESOURCE).build());
@@ -151,7 +151,7 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean createPermissionResource(PermissionResourceCreateParam param) {
- AppPermissionResourceEntity resource = permissionResourceConverter
+ PermissionResourceEntity resource = permissionResourceConverter
.resourceCreateParamConvertToEntity(param);
buildActions(param.getActions(), resource);
// 新增资源
@@ -170,22 +170,22 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updatePermissionResource(PermissionResourceUpdateParam param) {
- AppPermissionResourceEntity resource = permissionResourceConverter
+ PermissionResourceEntity resource = permissionResourceConverter
.resourceUpdateParamConvertToEntity(param);
- AppPermissionResourceEntity entity = getAppPermissionResourceEntity(
+ PermissionResourceEntity entity = getAppPermissionResourceEntity(
Long.valueOf(param.getId()));
buildActions(param.getActions(), resource);
BeanUtils.merge(resource, entity, LAST_MODIFIED_BY, LAST_MODIFIED_TIME);
// 查询资源下所有权限
- List actionList = appPermissionActionRepository
+ List actionList = appPermissionActionRepository
.findAllByResource(resource);
// 取出未删除的权限id
- Set reservedSet = resource.getActions().stream().map(AppPermissionActionEntity::getId)
+ Set reservedSet = resource.getActions().stream().map(PermissionActionEntity::getId)
.collect(Collectors.toSet());
// 过滤要删除的权限id
List removeActions = actionList.stream()
.filter(item -> !reservedSet.contains(item.getId()))
- .map(AppPermissionActionEntity::getId).toList();
+ .map(PermissionActionEntity::getId).toList();
appPermissionActionRepository.deleteAllById(removeActions);
// 更新资源
appResourceRepository.save(entity);
@@ -198,9 +198,9 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
* 获取应用权限资源
*
* @param id {@link Long}
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
- private AppPermissionResourceEntity getAppPermissionResourceEntity(Long id) {
+ private PermissionResourceEntity getAppPermissionResourceEntity(Long id) {
return appResourceRepository.findById(id)
.orElseThrow(() -> new BadParamsException("应用权限资源不存在"));
}
@@ -219,7 +219,7 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
public Boolean permissionResourceParamCheck(CheckValidityType type, String value, Long appId,
Long id) {
QAppPermissionResourceEntity role = QAppPermissionResourceEntity.appPermissionResourceEntity;
- AppPermissionResourceEntity entity = new AppPermissionResourceEntity();
+ PermissionResourceEntity entity = new PermissionResourceEntity();
boolean result = false;
// ID存在说明是修改操作,查询一下当前数据
if (Objects.nonNull(id)) {
@@ -249,14 +249,14 @@ public class PermissionResourceServiceImpl implements PermissionResourceService
* 批量处理actions
*
* @param permissions {@link List< PermissionsActionParam >}
- * @param resource {@link AppPermissionResourceEntity>}
+ * @param resource {@link PermissionResourceEntity >}
*/
private void buildActions(List permissions,
- AppPermissionResourceEntity resource) {
+ PermissionResourceEntity resource) {
// 权限
- List list = new ArrayList<>();
+ List list = new ArrayList<>();
for (PermissionsActionParam p : permissions) {
- AppPermissionActionEntity entity = new AppPermissionActionEntity();
+ PermissionActionEntity entity = new PermissionActionEntity();
entity.setResource(resource);
entity.setType(p.getType());
entity.setName(p.getName());
diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
index ff69b12a..23fd1101 100644
--- a/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
+++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/permission/impl/PermissionRoleServiceImpl.java
@@ -38,7 +38,7 @@ import cn.topiam.employee.audit.context.AuditContext;
import cn.topiam.employee.audit.entity.Target;
import cn.topiam.employee.audit.enums.TargetType;
import cn.topiam.employee.common.entity.app.QAppPermissionRoleEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionRoleEntity;
+import cn.topiam.employee.common.entity.permission.PermissionRoleEntity;
import cn.topiam.employee.common.enums.CheckValidityType;
import cn.topiam.employee.common.exception.app.AppRoleNotExistException;
import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
@@ -75,7 +75,7 @@ public class PermissionRoleServiceImpl implements PermissionRoleService {
@Override
public Page getPermissionRoleList(PageModel page,
PermissionRoleListQuery query) {
- org.springframework.data.domain.Page data;
+ org.springframework.data.domain.Page data;
Predicate predicate = permissionRoleConverter
.rolePaginationParamConvertToPredicate(query);
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
@@ -91,7 +91,7 @@ public class PermissionRoleServiceImpl implements PermissionRoleService {
*/
@Override
public boolean createPermissionRole(PermissionRoleCreateParam param) {
- AppPermissionRoleEntity entity = permissionRoleConverter
+ PermissionRoleEntity entity = permissionRoleConverter
.roleCreateParamConvertToEntity(param);
appPermissionRoleRepository.save(entity);
AuditContext.setTarget(Target.builder().id(entity.getId().toString())
@@ -105,9 +105,9 @@ public class PermissionRoleServiceImpl implements PermissionRoleService {
*/
@Override
public boolean updatePermissionRole(PermissionRoleUpdateParam param) {
- AppPermissionRoleEntity source = permissionRoleConverter
+ PermissionRoleEntity source = permissionRoleConverter
.roleUpdateParamConvertToEntity(param);
- AppPermissionRoleEntity target = appPermissionRoleRepository
+ PermissionRoleEntity target = appPermissionRoleRepository
.findById(Long.valueOf(param.getId())).orElseThrow(AppRoleNotExistException::new);
BeanUtils.merge(source, target, LAST_MODIFIED_TIME, LAST_MODIFIED_BY);
appPermissionRoleRepository.save(target);
@@ -145,7 +145,7 @@ public class PermissionRoleServiceImpl implements PermissionRoleService {
@Override
public PermissionRoleResult getPermissionRole(Long id) {
//查询
- Optional entity = appPermissionRoleRepository.findById(id);
+ Optional entity = appPermissionRoleRepository.findById(id);
//映射
return permissionRoleConverter.entityConvertToRoleDetailResult(entity.orElse(null));
}
@@ -164,7 +164,7 @@ public class PermissionRoleServiceImpl implements PermissionRoleService {
public Boolean permissionRoleParamCheck(CheckValidityType type, String value, Long appId,
Long id) {
QAppPermissionRoleEntity role = QAppPermissionRoleEntity.appPermissionRoleEntity;
- AppPermissionRoleEntity entity = new AppPermissionRoleEntity();
+ PermissionRoleEntity entity = new PermissionRoleEntity();
boolean result = false;
// ID存在说明是修改操作,查询一下当前数据
if (Objects.nonNull(id)) {
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionActionConverter.java
similarity index 85%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionActionConverter.java
index fab71c28..2376960f 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionActionConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionActionConverter.java
@@ -17,10 +17,10 @@
*/
package cn.topiam.employee.openapi.converter.app;
+import cn.topiam.employee.common.entity.permission.PermissionActionEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
-import cn.topiam.employee.common.entity.permission.AppPermissionActionEntity;
import cn.topiam.employee.openapi.pojo.request.app.AppPermissionsActionParam;
/**
@@ -31,7 +31,7 @@ import cn.topiam.employee.openapi.pojo.request.app.AppPermissionsActionParam;
*/
@SuppressWarnings("AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc")
@Mapper(componentModel = "spring")
-public interface AppPermissionActionConverter {
+public interface PermissionActionConverter {
@Mapping(target = "updateTime", ignore = true)
@Mapping(target = "updateBy", ignore = true)
@Mapping(target = "resource", ignore = true)
@@ -40,7 +40,7 @@ public interface AppPermissionActionConverter {
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionActionEntity toEntity(AppPermissionsActionParam dto);
+ PermissionActionEntity toEntity(AppPermissionsActionParam dto);
- AppPermissionsActionParam toDTO(AppPermissionActionEntity entities);
+ AppPermissionsActionParam toDTO(PermissionActionEntity entities);
}
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionPolicyConverter.java
similarity index 76%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionPolicyConverter.java
index 9302c07f..0bf5f68b 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionPolicyConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionPolicyConverter.java
@@ -19,12 +19,12 @@ package cn.topiam.employee.openapi.converter.app;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.util.CollectionUtils;
-import cn.topiam.employee.common.entity.permission.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.permission.po.AppPermissionPolicyPO;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionPolicyCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionPolicyUpdateParam;
import cn.topiam.employee.support.repository.page.domain.Page;
@@ -35,14 +35,14 @@ import cn.topiam.employee.support.repository.page.domain.Page;
* @author TopIAM
* Created by support@topiam.cn on 2020/8/14 22:45
*/
-@Mapper(componentModel = "spring", uses = AppPermissionActionConverter.class)
-public interface AppPermissionPolicyConverter {
+@Mapper(componentModel = "spring", uses = PermissionActionConverter.class)
+public interface PermissionPolicyConverter {
/**
* 资源创建参数转实体类
*
* @param param {@link AppPermissionPolicyCreateParam}
- * @return {@link AppPermissionPolicyEntity}
+ * @return {@link PermissionPolicyEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "id", ignore = true)
@@ -51,13 +51,13 @@ public interface AppPermissionPolicyConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionPolicyEntity policyCreateParamConvertToEntity(AppPermissionPolicyCreateParam param);
+ PermissionPolicyEntity policyCreateParamConvertToEntity(AppPermissionPolicyCreateParam param);
/**
* 资源修改参数转实体类
*
* @param param {@link AppPermissionPolicyCreateParam}
- * @return {@link AppPermissionPolicyEntity}
+ * @return {@link PermissionPolicyEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "updateTime", ignore = true)
@@ -65,7 +65,7 @@ public interface AppPermissionPolicyConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionPolicyEntity policyUpdateParamConvertToEntity(AppPermissionPolicyUpdateParam param);
+ PermissionPolicyEntity policyUpdateParamConvertToEntity(AppPermissionPolicyUpdateParam param);
/**
* 资源转换为资源列表结果
@@ -73,9 +73,9 @@ public interface AppPermissionPolicyConverter {
* @param page {@link Page}
* @return {@link Page}
*/
- default Page entityConvertToPolicyListResult(org.springframework.data.domain.Page page) {
- Page result = new Page<>();
- List pageList = page.getContent();
+ default Page entityConvertToPolicyListResult(org.springframework.data.domain.Page page) {
+ Page result = new Page<>();
+ List pageList = page.getContent();
if (!CollectionUtils.isEmpty(pageList)) {
//@formatter:off
result.setPagination(Page.Pagination.builder()
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionResourceConverter.java
similarity index 84%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionResourceConverter.java
index d92bbcf8..c04c44ec 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionResourceConverter.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/PermissionResourceConverter.java
@@ -20,6 +20,7 @@ package cn.topiam.employee.openapi.converter.app;
import java.util.ArrayList;
import java.util.List;
+import cn.topiam.employee.common.entity.permission.PermissionResourceEntity;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@@ -29,7 +30,6 @@ import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
-import cn.topiam.employee.common.entity.permission.AppPermissionResourceEntity;
import cn.topiam.employee.openapi.pojo.request.app.query.AppResourceListQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionResourceCreateParam;
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionResourceUpdateParam;
@@ -43,8 +43,8 @@ import cn.topiam.employee.support.repository.page.domain.Page;
* @author TopIAM
* Created by support@topiam.cn on 2020/8/14 22:45
*/
-@Mapper(componentModel = "spring", uses = AppPermissionActionConverter.class)
-public interface AppPermissionResourceConverter {
+@Mapper(componentModel = "spring", uses = PermissionActionConverter.class)
+public interface PermissionResourceConverter {
/**
* 资源分页查询参数转实体
@@ -70,7 +70,7 @@ public interface AppPermissionResourceConverter {
* 资源创建参数转实体类
*
* @param param {@link AppPermissionResourceCreateParam}
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "actions", ignore = true)
@@ -80,13 +80,13 @@ public interface AppPermissionResourceConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionResourceEntity resourceCreateParamConvertToEntity(AppPermissionResourceCreateParam param);
+ PermissionResourceEntity resourceCreateParamConvertToEntity(AppPermissionResourceCreateParam param);
/**
* 资源修改参数转实体类
*
* @param param {@link AppPermissionResourceCreateParam}
- * @return {@link AppPermissionResourceEntity}
+ * @return {@link PermissionResourceEntity}
*/
@Mapping(target = "enabled", expression = "java(Boolean.TRUE)")
@Mapping(target = "deleted", ignore = true)
@@ -98,7 +98,7 @@ public interface AppPermissionResourceConverter {
@Mapping(target = "remark", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionResourceEntity resourceUpdateParamConvertToEntity(AppPermissionResourceUpdateParam param);
+ PermissionResourceEntity resourceUpdateParamConvertToEntity(AppPermissionResourceUpdateParam param);
/**
* 资源转换为资源列表结果
@@ -106,12 +106,12 @@ public interface AppPermissionResourceConverter {
* @param page {@link Page}
* @return {@link Page}
*/
- default Page entityConvertToResourceListResult(org.springframework.data.domain.Page page) {
+ default Page entityConvertToResourceListResult(org.springframework.data.domain.Page page) {
Page result = new Page<>();
- List