|
@@ -1,5 +1,66 @@
|
|
|
package cn.com.qmth.examcloud.core.basic.api.provider;
|
|
|
|
|
|
-public class RolePrivilegeCloudServiceProvider {
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.RolePrivilegeCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.RoleBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.PrivilegeGroupRepo;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.PrivilegeRepo;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.RolePrivilegeRelationRepo;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.RoleRepo;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 角色权限服务
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @date 2018年6月8日
|
|
|
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("${$rmp}" + "rolePrivilege")
|
|
|
+public class RolePrivilegeCloudServiceProvider extends ControllerSupport
|
|
|
+ implements
|
|
|
+ RolePrivilegeCloudService {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -4360164791713797878L;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RoleRepo roleRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RolePrivilegeRelationRepo rolePrivilegeRelationRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ PrivilegeRepo privilegeRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ PrivilegeGroupRepo privilegeGroupRepo;
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询所有角色", notes = "")
|
|
|
+ @PostMapping("getAllRoles")
|
|
|
+ @Override
|
|
|
+ public List<RoleBean> getAllRoles() {
|
|
|
+ List<cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity> roleList = roleRepo.findAll();
|
|
|
+ List<RoleBean> roleBeanList = Lists.newArrayList();
|
|
|
+ for (cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity cur : roleList) {
|
|
|
+ RoleBean bean = new RoleBean();
|
|
|
+ bean.setRoleId(cur.getId());
|
|
|
+ bean.setRoleName(cur.getName());
|
|
|
+ bean.setRoleCode(cur.getCode());
|
|
|
+
|
|
|
+ roleBeanList.add(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ return roleBeanList;
|
|
|
+ }
|
|
|
|
|
|
}
|