完成zheng-upms对外接口

This commit is contained in:
shuzheng 2017-02-26 19:07:14 +08:00
parent 2403c05b27
commit 0595ce820d
3 changed files with 116 additions and 9 deletions

View File

@ -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<UpmsRole> selectUpmsRoleByUpmsUserId(Integer upmsUserId);
/**
* 根据角色id获取所拥有的权限
* @param upmsRoleId
* @return
*/
List<UpmsRolePermission> selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId);
/**
* 根据用户id获取所拥有的权限
* @param upmsUserId
* @return
*/
List<UpmsUserPermission> selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId);
/**
* 根据条件获取系统数据
* @param upmsSystemExample
* @return
*/
List<UpmsSystem> selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample);
/**
* 根据条件获取组织数据
* @param upmsOrganizationExample
* @return
*/
List<UpmsOrganization> selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample);
}

View File

@ -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<UpmsRolePermission> selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId) {
_log.info("UpmsApiServiceMock => selectUpmsRolePermisstionByUpmsRoleId");
return null;
}
@Override
public List<UpmsUserPermission> selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId) {
_log.info("UpmsApiServiceMock => selectUpmsUserPermissionByUpmsUserId");
return null;
}
@Override
public List<UpmsSystem> selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample) {
_log.info("UpmsApiServiceMock => selectUpmsSystemByExample");
return null;
}
@Override
public List<UpmsOrganization> selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample) {
_log.info("UpmsApiServiceMock => selectUpmsOrganizationByExample");
return null;
}
}

View File

@ -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<UpmsRolePermission> selectUpmsRolePermisstionByUpmsRoleId(Integer upmsRoleId) {
UpmsRolePermissionExample upmsRolePermissionExample = new UpmsRolePermissionExample();
upmsRolePermissionExample.createCriteria()
.andRoleIdEqualTo(upmsRoleId);
List<UpmsRolePermission> upmsRolePermissions = upmsRolePermissionMapper.selectByExample(upmsRolePermissionExample);
return upmsRolePermissions;
}
/**
* 根据用户id获取所拥有的权限
* @param upmsUserId
* @return
*/
@Override
public List<UpmsUserPermission> selectUpmsUserPermissionByUpmsUserId(Integer upmsUserId) {
UpmsUserPermissionExample upmsUserPermissionExample = new UpmsUserPermissionExample();
upmsUserPermissionExample.createCriteria()
.andUserIdEqualTo(upmsUserId);
List<UpmsUserPermission> upmsUserPermissions = upmsUserPermissionMapper.selectByExample(upmsUserPermissionExample);
return upmsUserPermissions;
}
/**
* 根据条件获取系统数据
* @param upmsSystemExample
* @return
*/
@Override
public List<UpmsSystem> selectUpmsSystemByExample(UpmsSystemExample upmsSystemExample) {
return upmsSystemMapper.selectByExample(upmsSystemExample);
}
/**
* 根据条件获取组织数据
* @param upmsOrganizationExample
* @return
*/
@Override
public List<UpmsOrganization> selectUpmsOrganizationByExample(UpmsOrganizationExample upmsOrganizationExample) {
return upmsOrganizationMapper.selectByExample(upmsOrganizationExample);
}
}