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 54%
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..e4220d5a 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.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.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.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
+ 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 62%
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..d5759175 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.PermissionPolicyEntity;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
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) {
- org.springframework.data.domain.Page data;
+ 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) {
+ PermissionPolicyEntity 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) {
+ PermissionPolicyEntity 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 67%
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..5e274505 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,12 @@ 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;
+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 +40,16 @@ 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.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) {
- org.springframework.data.domain.Page data;
- Predicate predicate = appPermissionResourceConverter
+ public Page getPermissionResourceList(PageModel page,
+ PermissionResourceListQuery query) {
+ org.springframework.data.domain.Page data;
+ 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) {
- AppPermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
+ public PermissionResourceGetResult getPermissionResource(String id) {
+ PermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
.orElseThrow(AppResourceNotExistException::new);
- return appPermissionResourceConverter.entityConvertToResourceGetResult(resource);
+ return permissionResourceConverter.entityConvertToResourceGetResult(resource);
}
/**
@@ -112,12 +112,12 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
@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 AppPermissionResourceServiceImpl implements AppPermissionResourceSe
*/
@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());
@@ -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) {
+ PermissionResourceEntity resource = permissionResourceConverter
.resourceCreateParamConvertToEntity(param);
buildActions(param.getActions(), resource);
// 新增资源
@@ -164,28 +164,28 @@ 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) {
+ 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 AppPermissionResourceServiceImpl implements AppPermissionResourceSe
* 获取应用权限资源
*
* @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 AppPermissionResourceServiceImpl implements AppPermissionResourceSe
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)) {
@@ -248,15 +248,15 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
/**
* 批量处理actions
*
- * @param permissions {@link List}
- * @param resource {@link AppPermissionResourceEntity>}
+ * @param permissions {@link List< PermissionsActionParam >}
+ * @param resource {@link PermissionResourceEntity >}
*/
- private void buildActions(List permissions,
- AppPermissionResourceEntity resource) {
+ private void buildActions(List permissions,
+ PermissionResourceEntity resource) {
// 权限
- List list = new ArrayList<>();
- for (AppPermissionsActionParam p : permissions) {
- AppPermissionActionEntity entity = new AppPermissionActionEntity();
+ List list = new ArrayList<>();
+ for (PermissionsActionParam p : permissions) {
+ PermissionActionEntity entity = new PermissionActionEntity();
entity.setResource(resource);
entity.setType(p.getType());
entity.setName(p.getName());
@@ -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 75%
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..23fd1101 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.PermissionRoleEntity;
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) {
- org.springframework.data.domain.Page data;
- Predicate predicate = appPermissionRoleConverter
+ public Page getPermissionRoleList(PageModel page,
+ PermissionRoleListQuery query) {
+ org.springframework.data.domain.Page data;
+ 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) {
+ PermissionRoleEntity entity = permissionRoleConverter
.roleCreateParamConvertToEntity(param);
appPermissionRoleRepository.save(entity);
AuditContext.setTarget(Target.builder().id(entity.getId().toString())
@@ -105,9 +105,9 @@ public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
*/
@Override
public boolean updatePermissionRole(PermissionRoleUpdateParam param) {
- AppPermissionRoleEntity source = appPermissionRoleConverter
+ 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);
@@ -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);
+ Optional entity = appPermissionRoleRepository.findById(id);
//映射
- return appPermissionRoleConverter.entityConvertToRoleDetailResult(entity.orElse(null));
+ return permissionRoleConverter.entityConvertToRoleDetailResult(entity.orElse(null));
}
/**
@@ -164,7 +164,7 @@ public class AppPermissionRoleServiceImpl implements AppPermissionRoleService {
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)) {
@@ -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/permission/PermissionActionConverter.java
similarity index 83%
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/permission/PermissionActionConverter.java
index 83396cdb..c79aa6eb 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/permission/PermissionActionConverter.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.openapi.converter.app;
+package cn.topiam.employee.openapi.converter.permission;
+import cn.topiam.employee.common.entity.permission.PermissionActionEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
-import cn.topiam.employee.common.entity.app.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/permission/PermissionPolicyConverter.java
similarity index 75%
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/permission/PermissionPolicyConverter.java
index 1596e1ab..cd3c8a24 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/permission/PermissionPolicyConverter.java
@@ -15,16 +15,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-package cn.topiam.employee.openapi.converter.app;
+package cn.topiam.employee.openapi.converter.permission;
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.app.AppPermissionPolicyEntity;
-import cn.topiam.employee.common.entity.app.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/permission/PermissionResourceConverter.java
similarity index 83%
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/permission/PermissionResourceConverter.java
index f039ff60..2bd5543f 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/permission/PermissionResourceConverter.java
@@ -15,11 +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.openapi.converter.app;
+package cn.topiam.employee.openapi.converter.permission;
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;
@@ -28,7 +29,6 @@ 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.openapi.pojo.request.app.query.AppResourceListQuery;
import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionResourceCreateParam;
@@ -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 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
@@ -129,17 +129,17 @@ public interface AppPermissionResourceConverter {
/**
* 实体转换为资源列表结果
*
- * @param data {@link AppPermissionResourceEntity}
+ * @param data {@link PermissionResourceEntity}
* @return {@link AppPermissionResourceListResult}
*/
- AppPermissionResourceListResult entityConvertToResourceListResult(AppPermissionResourceEntity data);
+ AppPermissionResourceListResult entityConvertToResourceListResult(PermissionResourceEntity data);
/**
* 实体转获取详情返回
*
- * @param resource {@link AppPermissionResourceEntity}
+ * @param resource {@link PermissionResourceEntity}
* @return {@link AppPermissionResourceGetResult}
*/
@Mapping(target = "actions", source = "actions")
- AppPermissionResourceGetResult entityConvertToResourceGetResult(AppPermissionResourceEntity resource);
+ AppPermissionResourceGetResult entityConvertToResourceGetResult(PermissionResourceEntity resource);
}
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/permission/PermissionRoleConverter.java
similarity index 85%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/app/AppPermissionRoleConverter.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/converter/permission/PermissionRoleConverter.java
index 3b6c7156..bb8e5cf5 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/permission/PermissionRoleConverter.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.openapi.converter.app;
+package cn.topiam.employee.openapi.converter.permission;
import java.util.ArrayList;
import java.util.List;
@@ -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.PermissionRoleEntity;
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;
@@ -45,7 +45,7 @@ import cn.topiam.employee.support.repository.page.domain.Page;
* Created by support@topiam.cn on 2020/8/14 22:45
*/
@Mapper(componentModel = "spring")
-public interface AppPermissionRoleConverter {
+public interface PermissionRoleConverter {
/**
* 角色实体转换为角色分页结果
@@ -53,11 +53,11 @@ public interface AppPermissionRoleConverter {
* @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 AppPermissionRoleConverter {
/**
* 角色实体转换为角色分页结果
*
- * @param page {@link AppPermissionRoleEntity}
+ * @param page {@link PermissionRoleEntity}
* @return {@link AppPermissionRoleListResult}
*/
- AppPermissionRoleListResult entityConvertToRolePaginationResult(AppPermissionRoleEntity page);
+ AppPermissionRoleListResult entityConvertToRolePaginationResult(PermissionRoleEntity page);
/**
* 角色创建参数转换为角色实体
*
* @param param {@link AppPermissionRoleCreateParam}
- * @return {@link AppPermissionRoleEntity}
+ * @return {@link PermissionRoleEntity}
*/
@Mapping(target = "deleted", ignore = true)
@Mapping(target = "id", ignore = true)
@@ -93,13 +93,13 @@ public interface AppPermissionRoleConverter {
@Mapping(target = "updateBy", ignore = true)
@Mapping(target = "createTime", ignore = true)
@Mapping(target = "createBy", ignore = true)
- AppPermissionRoleEntity roleCreateParamConvertToEntity(AppPermissionRoleCreateParam param);
+ PermissionRoleEntity roleCreateParamConvertToEntity(AppPermissionRoleCreateParam 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 AppPermissionRoleConverter {
@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 AppPermissionRoleResult}
*/
- AppPermissionRoleResult entityConvertToRoleDetailResult(AppPermissionRoleEntity role);
+ AppPermissionRoleResult entityConvertToRoleDetailResult(PermissionRoleEntity role);
/**
* 角色分页查询参数转实体
*
* @param query {@link AppPermissionRoleListQuery}
- * @return {@link AppPermissionRoleEntity}
+ * @return {@link PermissionRoleEntity}
*/
default Predicate rolePaginationParamConvertToPredicate(AppPermissionRoleListQuery query) {
QAppPermissionRoleEntity role = QAppPermissionRoleEntity.appPermissionRoleEntity;
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/PermissionPolicyEndpoint.java
similarity index 76%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionPolicyEndpoint.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionPolicyEndpoint.java
index d6d3d9ef..2b736028 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/PermissionPolicyEndpoint.java
@@ -17,14 +17,14 @@
*/
package cn.topiam.employee.openapi.endpoint.permission;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
import org.springframework.validation.annotation.Validated;
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.openapi.pojo.request.app.query.OpenApiPolicyQuery;
-import cn.topiam.employee.openapi.service.AppPermissionPolicyService;
+import cn.topiam.employee.openapi.service.PermissionPolicyService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
import cn.topiam.employee.support.result.ApiRestResult;
@@ -43,21 +43,21 @@ import static cn.topiam.employee.openapi.constants.OpenApiV1Constants.OPEN_API_P
@RestController
@RequestMapping(value = OPEN_API_PERMISSION_PATH + "/policy")
@RequiredArgsConstructor
-public class AppPermissionPolicyEndpoint {
+public class PermissionPolicyEndpoint {
/**
* 获取所有策略(分页)
*
* @param page {@link PageModel}
- * @return {@link AppPermissionPolicyPO}
+ * @return {@link PermissionPolicyPO}
*/
@Operation(summary = "获取策略列表")
@GetMapping(value = "/list")
- public ApiRestResult> getPermissionPolicyList(PageModel page,
- @Validated OpenApiPolicyQuery query) {
- Page result = permissionPolicyService.getPermissionPolicyList(page,
+ public ApiRestResult> getPermissionPolicyList(PageModel page,
+ @Validated OpenApiPolicyQuery query) {
+ Page result = permissionPolicyService.getPermissionPolicyList(page,
query);
- return ApiRestResult.> builder().result(result).build();
+ return ApiRestResult.> builder().result(result).build();
}
- private final AppPermissionPolicyService permissionPolicyService;
+ private final PermissionPolicyService permissionPolicyService;
}
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionResourceEndpoint.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionResourceEndpoint.java
similarity index 90%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionResourceEndpoint.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionResourceEndpoint.java
index cc955e73..b3b18782 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionResourceEndpoint.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionResourceEndpoint.java
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import cn.topiam.employee.openapi.pojo.request.app.query.AppResourceListQuery;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionResourceListResult;
-import cn.topiam.employee.openapi.service.AppPermissionResourceService;
+import cn.topiam.employee.openapi.service.PermissionResourceService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
import cn.topiam.employee.support.result.ApiRestResult;
@@ -43,7 +43,7 @@ import static cn.topiam.employee.openapi.constants.OpenApiV1Constants.OPEN_API_P
@RestController
@RequestMapping(value = OPEN_API_PERMISSION_PATH + "/resource")
@RequiredArgsConstructor
-public class AppPermissionResourceEndpoint {
+public class PermissionResourceEndpoint {
/**
* 获取应用的所有资源(分页)
*
@@ -54,7 +54,7 @@ public class AppPermissionResourceEndpoint {
@GetMapping(value = "/list")
public ApiRestResult> getPermissionResourceList(PageModel page,
@Validated AppResourceListQuery query) {
- Page result = appPermissionResourceService
+ Page result = permissionResourceService
.getPermissionResourceList(page, query);
return ApiRestResult.> builder().result(result)
.build();
@@ -68,5 +68,5 @@ public class AppPermissionResourceEndpoint {
/**
* 资源服务类
*/
- private final AppPermissionResourceService appPermissionResourceService;
+ private final PermissionResourceService permissionResourceService;
}
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionRoleEndpoint.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionRoleEndpoint.java
similarity index 91%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionRoleEndpoint.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionRoleEndpoint.java
index 5574073f..692b64a3 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/AppPermissionRoleEndpoint.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/endpoint/permission/PermissionRoleEndpoint.java
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import cn.topiam.employee.openapi.pojo.request.app.query.AppPermissionRoleListQuery;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionRoleListResult;
-import cn.topiam.employee.openapi.service.AppPermissionRoleService;
+import cn.topiam.employee.openapi.service.PermissionRoleService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
import cn.topiam.employee.support.result.ApiRestResult;
@@ -43,7 +43,7 @@ import static cn.topiam.employee.openapi.constants.OpenApiV1Constants.OPEN_API_P
@RestController
@RequestMapping(value = OPEN_API_PERMISSION_PATH + "/role")
@RequiredArgsConstructor
-public class AppPermissionRoleEndpoint {
+public class PermissionRoleEndpoint {
//1、获取应用的所有角色(分页)
/**
* 获取所有角色(分页)
@@ -55,7 +55,7 @@ public class AppPermissionRoleEndpoint {
@GetMapping(value = "/list")
public ApiRestResult> getPermissionRoleList(PageModel page,
@Validated AppPermissionRoleListQuery query) {
- Page result = appPermissionRoleService
+ Page result = permissionRoleService
.getPermissionRoleList(page, query);
return ApiRestResult.> builder().result(result).build();
}
@@ -68,5 +68,5 @@ public class AppPermissionRoleEndpoint {
/**
* 角色服务类
*/
- private final AppPermissionRoleService appPermissionRoleService;
+ private final PermissionRoleService permissionRoleService;
}
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionActionService.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionActionService.java
similarity index 98%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionActionService.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionActionService.java
index 8de589f9..55d4b974 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionActionService.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionActionService.java
@@ -33,7 +33,7 @@ import cn.topiam.employee.openapi.pojo.response.app.AppPermissionActionListResul
* @author TopIAM
* Created by support@topiam.cn on 2020-08-10
*/
-public interface AppPermissionActionService {
+public interface PermissionActionService {
/**
* 获取权限列表
*
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/PermissionPolicyService.java
similarity index 90%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionPolicyService.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionPolicyService.java
index fe7c94e8..59925f55 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/PermissionPolicyService.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.PermissionPolicyPO;
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;
@@ -33,15 +33,15 @@ 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 OpenApiPolicyQuery}
- * @return {@link AppPermissionPolicyPO}
+ * @return {@link PermissionPolicyPO}
*/
- Page getPermissionPolicyList(PageModel page, OpenApiPolicyQuery query);
+ Page getPermissionPolicyList(PageModel page, OpenApiPolicyQuery query);
/**
* 获取资源
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionResourceService.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionResourceService.java
similarity index 98%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionResourceService.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionResourceService.java
index 1cc8b919..4ec6e8c1 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionResourceService.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionResourceService.java
@@ -34,7 +34,7 @@ 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 {
/**
* 获取资源列表
*
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionRoleService.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionRoleService.java
similarity index 98%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionRoleService.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionRoleService.java
index ffee1738..89217d9f 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/AppPermissionRoleService.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/PermissionRoleService.java
@@ -34,7 +34,7 @@ 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 {
/**
* 获取所有角色(分页)
diff --git a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionActionServiceImpl.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionActionServiceImpl.java
similarity index 94%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionActionServiceImpl.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionActionServiceImpl.java
index 249cc1d5..c29483a2 100644
--- a/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionActionServiceImpl.java
+++ b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionActionServiceImpl.java
@@ -26,7 +26,7 @@ import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionActionCreat
import cn.topiam.employee.openapi.pojo.request.app.update.ResourceActionUpdateParam;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionActionGetResult;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionActionListResult;
-import cn.topiam.employee.openapi.service.AppPermissionActionService;
+import cn.topiam.employee.openapi.service.PermissionActionService;
import lombok.RequiredArgsConstructor;
@@ -40,7 +40,7 @@ import lombok.RequiredArgsConstructor;
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionActionServiceImpl implements AppPermissionActionService {
+public class PermissionActionServiceImpl implements PermissionActionService {
/**
* 获取权限列表
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/PermissionPolicyServiceImpl.java
similarity index 79%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionPolicyServiceImpl.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionPolicyServiceImpl.java
index 643ee508..073b06ce 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/PermissionPolicyServiceImpl.java
@@ -17,21 +17,21 @@
*/
package cn.topiam.employee.openapi.service.impl;
+import cn.topiam.employee.common.entity.permission.po.PermissionPolicyPO;
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.PermissionPolicyEntity;
import cn.topiam.employee.common.exception.app.AppPolicyNotExistException;
-import cn.topiam.employee.common.repository.app.AppPermissionPolicyRepository;
-import cn.topiam.employee.openapi.converter.app.AppPermissionPolicyConverter;
+import cn.topiam.employee.common.repository.permission.AppPermissionPolicyRepository;
+import cn.topiam.employee.openapi.converter.permission.PermissionPolicyConverter;
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;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionPolicyGetResult;
-import cn.topiam.employee.openapi.service.AppPermissionPolicyService;
+import cn.topiam.employee.openapi.service.PermissionPolicyService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -47,18 +47,18 @@ import lombok.RequiredArgsConstructor;
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyService {
+public class PermissionPolicyServiceImpl implements PermissionPolicyService {
/**
* 获取策略列表
*
* @param page {@link PageModel}
* @param query {@link OpenApiPolicyQuery}
- * @return {@link AppPermissionPolicyPO}
+ * @return {@link PermissionPolicyPO}
*/
@Override
- public Page getPermissionPolicyList(PageModel page,
- OpenApiPolicyQuery query) {
+ public Page getPermissionPolicyList(PageModel page,
+ OpenApiPolicyQuery query) {
AppPolicyQuery appPolicyQuery = new AppPolicyQuery();
// TODO token获取所属应用
// appPolicyQuery.setAppId(0L);
@@ -68,9 +68,9 @@ public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyServic
appPolicyQuery.setSubjectType(query.getSubjectType());
appPolicyQuery.setObjectType(query.getObjectType());
QPageRequest request = QPageRequest.of(page.getCurrent(), page.getPageSize());
- org.springframework.data.domain.Page data = appPermissionPolicyRepository
+ org.springframework.data.domain.Page data = appPermissionPolicyRepository
.findPage(appPolicyQuery, request);
- return appPermissionPolicyConverter.entityConvertToPolicyListResult(data);
+ return permissionPolicyConverter.entityConvertToPolicyListResult(data);
}
/**
@@ -108,7 +108,7 @@ public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyServic
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean createPermissionPolicy(AppPermissionPolicyCreateParam param) {
- AppPermissionPolicyEntity resource = appPermissionPolicyConverter
+ PermissionPolicyEntity resource = permissionPolicyConverter
.policyCreateParamConvertToEntity(param);
// 新增策略
appPermissionPolicyRepository.save(resource);
@@ -123,14 +123,14 @@ public class AppPermissionPolicyServiceImpl implements AppPermissionPolicyServic
*/
@Override
public Boolean updatePermissionPolicy(AppPermissionPolicyUpdateParam param) {
- AppPermissionPolicyEntity resource = appPermissionPolicyConverter
+ PermissionPolicyEntity 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-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java b/eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionResourceServiceImpl.java
similarity index 79%
rename from eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/AppPermissionResourceServiceImpl.java
rename to eiam-openapi/src/main/java/cn/topiam/employee/openapi/service/impl/PermissionResourceServiceImpl.java
index e7d1bb26..3e743e11 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/PermissionResourceServiceImpl.java
@@ -23,6 +23,9 @@ 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.openapi.converter.permission.PermissionResourceConverter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.querydsl.QPageRequest;
import org.springframework.stereotype.Service;
@@ -31,15 +34,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.AppPermissionActionEntity;
-import cn.topiam.employee.common.entity.app.AppPermissionResourceEntity;
import cn.topiam.employee.common.entity.app.QAppPermissionResourceEntity;
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.openapi.converter.app.AppPermissionResourceConverter;
+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.pojo.request.app.AppPermissionsActionParam;
import cn.topiam.employee.openapi.pojo.request.app.query.AppResourceListQuery;
import cn.topiam.employee.openapi.pojo.request.app.query.OpenApiPolicyQuery;
@@ -47,7 +47,7 @@ import cn.topiam.employee.openapi.pojo.request.app.save.AppPermissionResourceCre
import cn.topiam.employee.openapi.pojo.request.app.update.AppPermissionResourceUpdateParam;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionResourceGetResult;
import cn.topiam.employee.openapi.pojo.response.app.AppPermissionResourceListResult;
-import cn.topiam.employee.openapi.service.AppPermissionResourceService;
+import cn.topiam.employee.openapi.service.PermissionResourceService;
import cn.topiam.employee.support.repository.page.domain.Page;
import cn.topiam.employee.support.repository.page.domain.PageModel;
@@ -63,7 +63,7 @@ import lombok.RequiredArgsConstructor;
*/
@Service
@RequiredArgsConstructor
-public class AppPermissionResourceServiceImpl implements AppPermissionResourceService {
+public class PermissionResourceServiceImpl implements PermissionResourceService {
/**
* 获取资源列表
@@ -75,12 +75,12 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
@Override
public Page getPermissionResourceList(PageModel page,
AppResourceListQuery query) {
- org.springframework.data.domain.Page data;
- Predicate predicate = appPermissionResourceConverter
+ org.springframework.data.domain.Page data;
+ 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);
}
/**
@@ -91,9 +91,9 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
*/
@Override
public AppPermissionResourceGetResult getPermissionResource(String id) {
- AppPermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
+ PermissionResourceEntity resource = appResourceRepository.findById(Long.valueOf(id))
.orElseThrow(AppResourceNotExistException::new);
- return appPermissionResourceConverter.entityConvertToResourceGetResult(resource);
+ return permissionResourceConverter.entityConvertToResourceGetResult(resource);
}
/**
@@ -106,12 +106,12 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
@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);
@@ -127,7 +127,7 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean createPermissionResource(AppPermissionResourceCreateParam param) {
- AppPermissionResourceEntity resource = appPermissionResourceConverter
+ PermissionResourceEntity resource = permissionResourceConverter
.resourceCreateParamConvertToEntity(param);
buildActions(param.getActions(), resource);
// 新增资源
@@ -144,19 +144,19 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updatePermissionResource(AppPermissionResourceUpdateParam param) {
- AppPermissionResourceEntity resource = appPermissionResourceConverter
+ PermissionResourceEntity resource = permissionResourceConverter
.resourceUpdateParamConvertToEntity(param);
buildActions(param.getActions(), resource);
// 查询资源下所有权限
- 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();
appPermissionPolicyRepository.deleteAllByObjectIdIn(removeActions);
// 更新资源
appResourceRepository.save(resource);
@@ -177,7 +177,7 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
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)) {
@@ -209,14 +209,14 @@ public class AppPermissionResourceServiceImpl implements AppPermissionResourceSe
* 批量处理actions
*
* @param permissions {@link List}
- * @param resource {@link AppPermissionResourceEntity>}
+ * @param resource {@link PermissionResourceEntity >}
*/
private void buildActions(List permissions,
- AppPermissionResourceEntity resource) {
+ PermissionResourceEntity resource) {
// 权限
- List