diff --git a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiService.java b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiService.java index edcb0e36..5794c914 100644 --- a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiService.java +++ b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiService.java @@ -1,7 +1,6 @@ package com.zheng.upms.rpc.api; -import com.zheng.upms.dao.model.UpmsPermission; -import com.zheng.upms.dao.model.UpmsRole; +import com.zheng.upms.dao.model.*; import java.util.List; @@ -25,4 +24,32 @@ public interface UpmsApiService { */ List selectUpmsRoleByUpmsUserId(Integer upmsUserId); + /** + * 根据角色id获取所拥有的权限 + * @param upmsRoleId + * @return + */ + List selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId); + + /** + * 根据用户id获取所拥有的权限 + * @param upmsUserId + * @return + */ + List selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId); + + /** + * 根据条件获取系统数据 + * @param upmsSystemExample + * @return + */ + List selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample); + + /** + * 根据条件获取组织数据 + * @param upmsOrganizationExample + * @return + */ + List selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample); + } diff --git a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiServiceMock.java b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiServiceMock.java index e5cde1fd..83dcb994 100644 --- a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiServiceMock.java +++ b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsApiServiceMock.java @@ -1,7 +1,6 @@ package com.zheng.upms.rpc.api; -import com.zheng.upms.dao.model.UpmsPermission; -import com.zheng.upms.dao.model.UpmsRole; +import com.zheng.upms.dao.model.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,4 +26,28 @@ public class UpmsApiServiceMock implements UpmsApiService { return null; } + @Override + public List selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId) { + _log.info("UpmsApiServiceMock => selectUpmsRolePermisstionByUpmsRoleId"); + return null; + } + + @Override + public List selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId) { + _log.info("UpmsApiServiceMock => selectUpmsUserPermissionByUpmsUserId"); + return null; + } + + @Override + public List selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample) { + _log.info("UpmsApiServiceMock => selectUpmsSystemByExample"); + return null; + } + + @Override + public List selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample) { + _log.info("UpmsApiServiceMock => selectUpmsOrganizationByExample"); + return null; + } + } diff --git a/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsApiServiceImpl.java b/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsApiServiceImpl.java index 92cf49b3..308df0e6 100644 --- a/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsApiServiceImpl.java +++ b/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsApiServiceImpl.java @@ -1,10 +1,7 @@ package com.zheng.upms.rpc.service.impl; -import com.zheng.upms.dao.mapper.UpmsApiMapper; -import com.zheng.upms.dao.mapper.UpmsUserMapper; -import com.zheng.upms.dao.model.UpmsPermission; -import com.zheng.upms.dao.model.UpmsRole; -import com.zheng.upms.dao.model.UpmsUser; +import com.zheng.upms.dao.mapper.*; +import com.zheng.upms.dao.model.*; import com.zheng.upms.rpc.api.UpmsApiService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +27,18 @@ public class UpmsApiServiceImpl implements UpmsApiService { @Autowired UpmsApiMapper upmsApiMapper; + @Autowired + UpmsRolePermissionMapper upmsRolePermissionMapper; + + @Autowired + UpmsUserPermissionMapper upmsUserPermissionMapper; + + @Autowired + UpmsSystemMapper upmsSystemMapper; + + @Autowired + UpmsOrganizationMapper upmsOrganizationMapper; + /** * 根据用户id获取所拥有的权限 * @param upmsUserId @@ -64,4 +73,52 @@ public class UpmsApiServiceImpl implements UpmsApiService { return upmsRoles; } + /** + * 根据角色id获取所拥有的权限 + * @param upmsRoleId + * @return + */ + @Override + public List selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId) { + UpmsRolePermissionExample upmsRolePermissionExample = new UpmsRolePermissionExample(); + upmsRolePermissionExample.createCriteria() + .andRoleIdEqualTo(upmsRoleId); + List upmsRolePermissions = upmsRolePermissionMapper.selectByExample(upmsRolePermissionExample); + return upmsRolePermissions; + } + + /** + * 根据用户id获取所拥有的权限 + * @param upmsUserId + * @return + */ + @Override + public List selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId) { + UpmsUserPermissionExample upmsUserPermissionExample = new UpmsUserPermissionExample(); + upmsUserPermissionExample.createCriteria() + .andUserIdEqualTo(upmsUserId); + List upmsUserPermissions = upmsUserPermissionMapper.selectByExample(upmsUserPermissionExample); + return upmsUserPermissions; + } + + /** + * 根据条件获取系统数据 + * @param upmsSystemExample + * @return + */ + @Override + public List selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample) { + return upmsSystemMapper.selectByExample(upmsSystemExample); + } + + /** + * 根据条件获取组织数据 + * @param upmsOrganizationExample + * @return + */ + @Override + public List selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample) { + return upmsOrganizationMapper.selectByExample(upmsOrganizationExample); + } + } \ No newline at end of file