sysAuthorities) {
- if (CollectionUtils.isNotEmpty(sysAuthorities)) {
- return sysAuthorities.stream().map(UpmsHelper::convertSysAuthorityToSysMetadata).collect(Collectors.toList());
- }
- return new ArrayList<>();
- }
-
- private static SysMetadata convertSysAuthorityToSysMetadata(SysAuthority sysAuthority) {
- SysMetadata sysMetadata = new SysMetadata();
- sysMetadata.setMetadataId(sysAuthority.getAuthorityId());
- sysMetadata.setDefaultExpression(sysAuthority.getAuthorityCode());
- sysMetadata.setUrl(sysAuthority.getUrl());
- sysMetadata.setRequestMethod(sysAuthority.getRequestMethod());
- sysMetadata.setServiceId(sysAuthority.getServiceId());
- sysMetadata.setScopeExpression(SecurityExpression.SCOPE_DENY_ACCESS);
- return sysMetadata;
- }
-
public static OauthClientDetails convertOauthApplicationsToOauthClientDetails(OauthApplications oauthApplications, OauthClientDetails oauthClientDetails) {
if (ObjectUtils.isEmpty(oauthClientDetails)) {
oauthClientDetails = new OauthClientDetails();
diff --git a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysRoleEntityListener.java b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysRoleEntityListener.java
index e7f2b6412..d359fe7b9 100644
--- a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysRoleEntityListener.java
+++ b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysRoleEntityListener.java
@@ -22,16 +22,12 @@
package cn.herodotus.eurynome.upms.api.listener.entity;
-import cn.herodotus.eurynome.upms.api.entity.system.SysAuthority;
import cn.herodotus.eurynome.upms.api.entity.system.SysRole;
-import cn.herodotus.eurynome.upms.api.listener.event.SysMetadataRelationChangeEvent;
+import cn.herodotus.eurynome.upms.api.listener.event.SysSecurityAttributeRelationChangeEvent;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
import javax.persistence.PostLoad;
import javax.persistence.PostRemove;
@@ -64,21 +60,21 @@ protected void postLoad(SysRole entity) {
@PreUpdate
protected void preUpdate(SysRole entity) {
- log.debug("[Eurynome] |- SysRoleEntityListener @PreUpdate actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
+ log.debug("[Eurynome] |- SysRoleEntityListener @PreUpdate actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
this.setAfter(clone(entity));
}
@PostUpdate
protected void postUpdate(SysRole entity) {
- log.debug("[Eurynome] |- SysRoleEntityListener @PostUpdate actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
- this.getApplicationContext().publishEvent(new SysMetadataRelationChangeEvent(this.getChangedAuthority()));
+ log.debug("[Eurynome] |- SysRoleEntityListener @PostUpdate actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
+ this.getApplicationContext().publishEvent(new SysSecurityAttributeRelationChangeEvent(this.getChangedAuthority()));
}
@PostRemove
protected void postRemove(SysRole entity) {
- log.debug("[Eurynome] |- SysRoleEntityListener @PostRemove actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
+ log.debug("[Eurynome] |- SysRoleEntityListener @PostRemove actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
if (CollectionUtils.isNotEmpty(entity.getAuthorities())) {
- this.getApplicationContext().publishEvent(new SysMetadataRelationChangeEvent(clone(entity)));
+ this.getApplicationContext().publishEvent(new SysSecurityAttributeRelationChangeEvent(clone(entity)));
}
}
}
diff --git a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysScopeEntityListener.java b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysScopeEntityListener.java
index 21b067f8b..24cfc553c 100644
--- a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysScopeEntityListener.java
+++ b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysScopeEntityListener.java
@@ -23,16 +23,11 @@
package cn.herodotus.eurynome.upms.api.listener.entity;
import cn.herodotus.eurynome.upms.api.entity.oauth.OAuth2Scopes;
-import cn.herodotus.eurynome.upms.api.entity.system.SysAuthority;
-import cn.herodotus.eurynome.upms.api.entity.system.SysRole;
-import cn.herodotus.eurynome.upms.api.listener.event.SysMetadataRelationChangeEvent;
+import cn.herodotus.eurynome.upms.api.listener.event.SysSecurityAttributeRelationChangeEvent;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
import javax.persistence.PostLoad;
import javax.persistence.PostRemove;
@@ -65,21 +60,21 @@ protected void postLoad(OAuth2Scopes entity) {
@PreUpdate
protected void preUpdate(OAuth2Scopes entity) {
- log.debug("[Eurynome] |- SysScopeEntityListener @PreUpdate actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
+ log.debug("[Eurynome] |- SysScopeEntityListener @PreUpdate actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
this.setAfter(clone(entity));
}
@PostUpdate
protected void postUpdate(OAuth2Scopes entity) {
- log.debug("[Eurynome] |- SysScopeEntityListener @PostUpdate actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
- this.getApplicationContext().publishEvent(new SysMetadataRelationChangeEvent(this.getChangedAuthority()));
+ log.debug("[Eurynome] |- SysScopeEntityListener @PostUpdate actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
+ this.getApplicationContext().publishEvent(new SysSecurityAttributeRelationChangeEvent(this.getChangedAuthority()));
}
@PostRemove
protected void postRemove(OAuth2Scopes entity) {
- log.debug("[Eurynome] |- SysScopeEntityListener @PostRemove actived, value is : [{}]. Trigger SysMetadata relation change event.", entity.toString());
+ log.debug("[Eurynome] |- SysScopeEntityListener @PostRemove actived, value is : [{}]. Trigger SysSecurityAttribute relation change event.", entity.toString());
if (CollectionUtils.isNotEmpty(entity.getAuthorities())) {
- this.getApplicationContext().publishEvent(new SysMetadataRelationChangeEvent(clone(entity)));
+ this.getApplicationContext().publishEvent(new SysSecurityAttributeRelationChangeEvent(clone(entity)));
}
}
}
diff --git a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysMetadataEntityListener.java b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysSecurityAttributeEntityListener.java
similarity index 68%
rename from services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysMetadataEntityListener.java
rename to services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysSecurityAttributeEntityListener.java
index 968476af8..259b3f882 100644
--- a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysMetadataEntityListener.java
+++ b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/entity/SysSecurityAttributeEntityListener.java
@@ -15,15 +15,15 @@
*
* Project Name: eurynome-cloud
* Module Name: eurynome-cloud-upms-api
- * File Name: SysMetadataEntityListener.java
+ * File Name: SysSecurityAttributeEntityListener.java
* Author: gengwei.zheng
* Date: 2021/08/05 17:08:05
*/
package cn.herodotus.eurynome.upms.api.listener.entity;
-import cn.herodotus.eurynome.upms.api.entity.system.SysMetadata;
-import cn.herodotus.eurynome.upms.api.listener.event.SysMetadataChangeEvent;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
+import cn.herodotus.eurynome.upms.api.listener.event.SysSecurityAttributeChangeEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
@@ -33,14 +33,14 @@
import javax.persistence.PostUpdate;
/**
- * Description: SysMetadata实体变更监听
+ * Description: SysSecurityAttribute实体变更监听
*
* @author : gengwei.zheng
* @date : 2021/8/5 17:08
*/
-public class SysMetadataEntityListener implements ApplicationContextAware {
+public class SysSecurityAttributeEntityListener implements ApplicationContextAware {
- private static final Logger log = LoggerFactory.getLogger(SysMetadataEntityListener.class);
+ private static final Logger log = LoggerFactory.getLogger(SysSecurityAttributeEntityListener.class);
private ApplicationContext applicationContext;
@@ -50,8 +50,8 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
}
@PostUpdate
- protected void postUpdate(SysMetadata entity) {
- log.trace("[Eurynome] |- SysMetadataEntityListener @PostUpdate : [{}]", entity.toString());
- this.applicationContext.publishEvent(new SysMetadataChangeEvent(entity));
+ protected void postUpdate(SysSecurityAttribute entity) {
+ log.trace("[Eurynome] |- SysSecurityAttributeEntityListener @PostUpdate : [{}]", entity.toString());
+ this.applicationContext.publishEvent(new SysSecurityAttributeChangeEvent(entity));
}
}
diff --git a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataChangeEvent.java b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeChangeEvent.java
similarity index 61%
rename from services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataChangeEvent.java
rename to services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeChangeEvent.java
index 11faf1a03..167a2d412 100644
--- a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataChangeEvent.java
+++ b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeChangeEvent.java
@@ -15,32 +15,32 @@
*
* Project Name: eurynome-cloud
* Module Name: eurynome-cloud-upms-api
- * File Name: SysMetadataChangeEvent.java
+ * File Name: SysSecurityAttributeChangeEvent.java
* Author: gengwei.zheng
* Date: 2021/08/05 17:09:05
*/
package cn.herodotus.eurynome.upms.api.listener.event;
-import cn.herodotus.eurynome.upms.api.entity.system.SysMetadata;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
import org.springframework.context.ApplicationEvent;
/**
- * Description: SysMetadata实体数据变更事件
+ * Description: SysSecurityAttribute实体数据变更事件
*
* @author : gengwei.zheng
* @date : 2021/8/5 17:09
*/
-public class SysMetadataChangeEvent extends ApplicationEvent {
+public class SysSecurityAttributeChangeEvent extends ApplicationEvent {
- private final SysMetadata sysMetadata;
+ private final SysSecurityAttribute sysSecurityAttribute;
- public SysMetadataChangeEvent(SysMetadata sysMetadata) {
- super(sysMetadata);
- this.sysMetadata = sysMetadata;
+ public SysSecurityAttributeChangeEvent(SysSecurityAttribute sysSecurityAttribute) {
+ super(sysSecurityAttribute);
+ this.sysSecurityAttribute = sysSecurityAttribute;
}
- public SysMetadata getSysMetadata() {
- return sysMetadata;
+ public SysSecurityAttribute getSysSecurityAttribute() {
+ return sysSecurityAttribute;
}
}
diff --git a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataRelationChangeEvent.java b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeRelationChangeEvent.java
similarity index 81%
rename from services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataRelationChangeEvent.java
rename to services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeRelationChangeEvent.java
index a6bad0f1d..dee38c5de 100644
--- a/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysMetadataRelationChangeEvent.java
+++ b/services/eurynome-cloud-upms-api/src/main/java/cn/herodotus/eurynome/upms/api/listener/event/SysSecurityAttributeRelationChangeEvent.java
@@ -15,7 +15,7 @@
*
* Project Name: eurynome-cloud
* Module Name: eurynome-cloud-upms-api
- * File Name: SysMetadataRelationChangeEvent.java
+ * File Name: SysSecurityAttributeRelationChangeEvent.java
* Author: gengwei.zheng
* Date: 2021/08/05 17:10:05
*/
@@ -29,16 +29,16 @@
import java.util.List;
/**
- * Description: SysMetadata关联数据变更Event
+ * Description: SysSecurityAttribute关联数据变更Event
*
* @author : gengwei.zheng
* @date : 2021/8/5 17:10
*/
-public class SysMetadataRelationChangeEvent extends ApplicationEvent {
+public class SysSecurityAttributeRelationChangeEvent extends ApplicationEvent {
private final List changedAuthorities;
- public SysMetadataRelationChangeEvent(List changedAuthorities) {
+ public SysSecurityAttributeRelationChangeEvent(List changedAuthorities) {
super(changedAuthorities);
this.changedAuthorities = changedAuthorities;
}
diff --git a/services/eurynome-cloud-upms-logic/pom.xml b/services/eurynome-cloud-upms-logic/pom.xml
index 0743599f4..2871bc8f5 100644
--- a/services/eurynome-cloud-upms-logic/pom.xml
+++ b/services/eurynome-cloud-upms-logic/pom.xml
@@ -7,11 +7,11 @@
services
cn.herodotus.eurynome
- 2.5.4.40
+ 2.5.4.50
eurynome-cloud-upms-logic
- 2.5.4.40
+ 2.5.4.50
diff --git a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysMetadataRepository.java b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysSecurityAttributeRepository.java
similarity index 76%
rename from services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysMetadataRepository.java
rename to services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysSecurityAttributeRepository.java
index faf995c62..5fa4d6fd4 100644
--- a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysMetadataRepository.java
+++ b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/repository/system/SysSecurityAttributeRepository.java
@@ -15,7 +15,7 @@
*
* Project Name: eurynome-cloud
* Module Name: eurynome-cloud-upms-logic
- * File Name: SysMetadataRepository.java
+ * File Name: SysSecurityAttributeRepository.java
* Author: gengwei.zheng
* Date: 2021/08/05 17:48:05
*/
@@ -23,20 +23,20 @@
package cn.herodotus.eurynome.upms.logic.repository.system;
import cn.herodotus.eurynome.data.base.repository.BaseRepository;
-import cn.herodotus.eurynome.upms.api.entity.system.SysMetadata;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
import org.springframework.data.jpa.repository.QueryHints;
import javax.persistence.QueryHint;
import java.util.List;
/**
- * Description: SysMetadataRepository
+ * Description: SysSecurityAttributeRepository
*
* @author : gengwei.zheng
* @date : 2021/8/5 17:48
*/
-public interface SysMetadataRepository extends BaseRepository {
+public interface SysSecurityAttributeRepository extends BaseRepository {
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
- List findByMetadataIdIn(List ids);
+ List findByAttributeIdIn(List ids);
}
diff --git a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysAuthorityService.java b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysAuthorityService.java
index 891249f66..b561f656d 100644
--- a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysAuthorityService.java
+++ b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysAuthorityService.java
@@ -28,7 +28,7 @@
import cn.herodotus.eurynome.crud.service.BaseLayeredService;
import cn.herodotus.eurynome.data.base.repository.BaseRepository;
import cn.herodotus.eurynome.upms.api.entity.system.SysAuthority;
-import cn.herodotus.eurynome.upms.api.entity.system.SysMetadata;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
import cn.herodotus.eurynome.upms.logic.repository.system.SysAuthorityRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,7 +76,7 @@ public List findAllByAuthorityType(AuthorityType authorityType) {
}
/**
- * 查找SysMetadata中不存在的SysAuthority
+ * 查找SysSecurityAttribute中不存在的SysAuthority
*
* @return SysAuthority列表
*/
@@ -86,16 +86,16 @@ public List findAllocatable() {
Specification specification = (root, criteriaQuery, criteriaBuilder) -> {
// 构造Not Exist子查询
- Subquery subQuery = criteriaQuery.subquery(SysMetadata.class);
- Root subRoot = subQuery.from(SysMetadata.class);
+ Subquery subQuery = criteriaQuery.subquery(SysSecurityAttribute.class);
+ Root subRoot = subQuery.from(SysSecurityAttribute.class);
// 构造Not Exist 子查询的where条件
- Predicate subPredicate = criteriaBuilder.equal(subRoot.get("metadataId"), root.get("authorityId"));
+ Predicate subPredicate = criteriaBuilder.equal(subRoot.get("attributeId"), root.get("authorityId"));
subQuery.where(subPredicate);
// 构造完整的子查询语句
//这句话不加会报错,因为他不知道你子查询要查出什么字段。就是上面示例中的子查询中的“select *”的作用
- subQuery.select(subRoot.get("metadataId"));
+ subQuery.select(subRoot.get("attributeId"));
// 构造完整SQL
// 正确的结构参考:SELECT * FROM sys_authority sa WHERE NOT EXISTS ( SELECT * FROM sys_metadata sm WHERE sm.metadata_id = sa.authority_id )
diff --git a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysMetadataService.java b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysSecurityAttributeService.java
similarity index 55%
rename from services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysMetadataService.java
rename to services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysSecurityAttributeService.java
index a04bc1eec..c9f7168ca 100644
--- a/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysMetadataService.java
+++ b/services/eurynome-cloud-upms-logic/src/main/java/cn/herodotus/eurynome/upms/logic/service/system/SysSecurityAttributeService.java
@@ -15,7 +15,7 @@
*
* Project Name: eurynome-cloud
* Module Name: eurynome-cloud-upms-logic
- * File Name: SysMetadataService.java
+ * File Name: SysSecurityAttributeService.java
* Author: gengwei.zheng
* Date: 2021/08/05 17:50:05
*/
@@ -24,9 +24,9 @@
import cn.herodotus.eurynome.crud.service.BaseLayeredService;
import cn.herodotus.eurynome.data.base.repository.BaseRepository;
-import cn.herodotus.eurynome.upms.api.entity.system.SysMetadata;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
import cn.herodotus.eurynome.upms.api.entity.system.SysRole;
-import cn.herodotus.eurynome.upms.logic.repository.system.SysMetadataRepository;
+import cn.herodotus.eurynome.upms.logic.repository.system.SysSecurityAttributeRepository;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,66 +41,66 @@
import java.util.List;
/**
- * Description: SysMetadataService
+ * Description: SysSecurityAttributeService
*
* @author : gengwei.zheng
* @date : 2021/8/5 17:50
*/
@Service
-public class SysMetadataService extends BaseLayeredService {
+public class SysSecurityAttributeService extends BaseLayeredService {
- private static final Logger log = LoggerFactory.getLogger(SysMetadataService.class);
+ private static final Logger log = LoggerFactory.getLogger(SysSecurityAttributeService.class);
- private final SysMetadataRepository sysMetadataRepository;
+ private final SysSecurityAttributeRepository sysSecurityAttributeRepository;
@Autowired
- public SysMetadataService(SysMetadataRepository sysMetadataRepository) {
- this.sysMetadataRepository = sysMetadataRepository;
+ public SysSecurityAttributeService(SysSecurityAttributeRepository sysSecurityAttributeRepository) {
+ this.sysSecurityAttributeRepository = sysSecurityAttributeRepository;
}
@Override
- public BaseRepository getRepository() {
- return this.sysMetadataRepository;
+ public BaseRepository getRepository() {
+ return this.sysSecurityAttributeRepository;
}
- public List batchSaveOrUpdate(List sysMetadata) {
- log.debug("[Eurynome] |- SysMetadata Service batchSaveOrUpdate.");
- return sysMetadataRepository.saveAllAndFlush(sysMetadata);
+ public List batchSaveOrUpdate(List sysMetadata) {
+ log.debug("[Eurynome] |- SysSecurityAttribute Service batchSaveOrUpdate.");
+ return sysSecurityAttributeRepository.saveAllAndFlush(sysMetadata);
}
- public List findByMetadataIn(List ids) {
- log.debug("[Eurynome] |- SysMetadata Service findByMetadataIn.");
- return sysMetadataRepository.findByMetadataIdIn(ids);
+ public List findByAttributeIdIn(List ids) {
+ log.debug("[Eurynome] |- SysSecurityAttribute Service findByAttributeIdIn.");
+ return sysSecurityAttributeRepository.findByAttributeIdIn(ids);
}
- public List findByRoleId(String roleId) {
+ public List findByRoleId(String roleId) {
return this.findByCondition(roleId, null, null);
}
- public List findByScopeId(String scopeId) {
+ public List findByScopeId(String scopeId) {
return this.findByCondition(null, scopeId, null);
}
- public List findByIpAddressId(String ipAddressId) {
+ public List findByIpAddressId(String ipAddressId) {
return this.findByCondition(null, null, ipAddressId);
}
- public List findByCondition(String roleId, String scopeId, String ipAddressId) {
- Specification specification = (root, criteriaQuery, criteriaBuilder) -> {
+ public List findByCondition(String roleId, String scopeId, String ipAddressId) {
+ Specification specification = (root, criteriaQuery, criteriaBuilder) -> {
List predicates = new ArrayList<>();
if (StringUtils.isNotBlank(roleId)) {
- SetJoin join = root.joinSet("roles", JoinType.INNER);
+ SetJoin join = root.joinSet("roles", JoinType.INNER);
predicates.add(criteriaBuilder.equal(join.get("roleId").as(String.class), roleId));
}
if (StringUtils.isNotBlank(scopeId)) {
- SetJoin join = root.joinSet("scopes", JoinType.INNER);
+ SetJoin join = root.joinSet("scopes", JoinType.INNER);
predicates.add(criteriaBuilder.equal(join.get("scopeId").as(String.class), scopeId));
}
if (StringUtils.isNotBlank(ipAddressId)) {
- SetJoin join = root.joinSet("ipAddress", JoinType.INNER);
+ SetJoin join = root.joinSet("ipAddress", JoinType.INNER);
predicates.add(criteriaBuilder.equal(join.get("ipId").as(String.class), ipAddressId));
}
@@ -109,7 +109,7 @@ public List findByCondition(String roleId, String scopeId, String i
return criteriaQuery.getRestriction();
};
- log.debug("[Eurynome] |- SysMetadata Service findByCondition.");
- return this.sysMetadataRepository.findAll(specification);
+ log.debug("[Eurynome] |- SysSecurityAttribute Service findByCondition.");
+ return this.sysSecurityAttributeRepository.findAll(specification);
}
}
diff --git a/services/eurynome-cloud-upms-rest/pom.xml b/services/eurynome-cloud-upms-rest/pom.xml
index 6ef11f89e..40e815699 100644
--- a/services/eurynome-cloud-upms-rest/pom.xml
+++ b/services/eurynome-cloud-upms-rest/pom.xml
@@ -6,11 +6,11 @@
services
cn.herodotus.eurynome
- 2.5.4.40
+ 2.5.4.50
eurynome-cloud-upms-rest
- 2.5.4.40
+ 2.5.4.50
eurynome-cloud-upms-rest
通用权限,人员信息服务供应商
diff --git a/services/eurynome-cloud-upms-rest/src/main/java/cn/herodotus/eurynome/upms/rest/controller/system/SysSecurityAttributeController.java b/services/eurynome-cloud-upms-rest/src/main/java/cn/herodotus/eurynome/upms/rest/controller/system/SysSecurityAttributeController.java
new file mode 100644
index 000000000..9e802b48f
--- /dev/null
+++ b/services/eurynome-cloud-upms-rest/src/main/java/cn/herodotus/eurynome/upms/rest/controller/system/SysSecurityAttributeController.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019-2021 Gengwei Zheng (herodotus@aliyun.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Project Name: eurynome-cloud
+ * Module Name: eurynome-cloud-upms-rest
+ * File Name: SysSecurityAttributeController.java
+ * Author: gengwei.zheng
+ * Date: 2021/08/14 06:54:14
+ */
+
+package cn.herodotus.eurynome.upms.rest.controller.system;
+
+import cn.herodotus.eurynome.crud.controller.BaseWriteableRestController;
+import cn.herodotus.eurynome.crud.service.WriteableService;
+import cn.herodotus.eurynome.upms.api.entity.system.SysSecurityAttribute;
+import cn.herodotus.eurynome.upms.logic.service.system.SysSecurityAttributeService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Description: SysSecurityAttributeController
+ *
+ * @author : gengwei.zheng
+ * @date : 2021/8/14 6:54
+ */
+@RestController
+@RequestMapping("/security-attribute")
+@Api(tags = {"用户中心服务", "系统元数据接口", "权限管理"})
+public class SysSecurityAttributeController extends BaseWriteableRestController {
+
+ private final SysSecurityAttributeService sysSecurityAttributeService;
+
+ @Autowired
+ public SysSecurityAttributeController(SysSecurityAttributeService sysSecurityAttributeService) {
+ this.sysSecurityAttributeService = sysSecurityAttributeService;
+ }
+
+ @Override
+ public WriteableService getWriteableService() {
+ return this.sysSecurityAttributeService;
+ }
+}
diff --git a/services/pom.xml b/services/pom.xml
index 46549ddd3..e0e09cad1 100644
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -31,7 +31,7 @@
eurynome-cloud
cn.herodotus.eurynome
- 2.5.4.40
+ 2.5.4.50
services