TRX 1 年間 前
コミット
aa3f7d9d04

+ 0 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/scene/SceneComponentModel.java

@@ -1,6 +1,5 @@
 package com.zhongshu.card.client.model.scene;
 
-import com.zhongshu.card.client.type.scene.SceneType;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
 import lombok.Data;

+ 2 - 5
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/scene/RoleSceneInfoController.java

@@ -5,10 +5,7 @@ import com.github.microservice.auth.security.type.AuthType;
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.card.client.model.base.IDParam;
 import com.zhongshu.card.client.model.base.SortParam;
-import com.zhongshu.card.client.model.scene.RoleBindAllParam;
-import com.zhongshu.card.client.model.scene.RoleBindSceneParam;
-import com.zhongshu.card.client.model.scene.RoleSceneInfoModel;
-import com.zhongshu.card.client.model.scene.SceneInfoModel;
+import com.zhongshu.card.client.model.scene.*;
 import com.zhongshu.card.server.core.service.scene.RoleSceneInfoService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -50,7 +47,7 @@ public class RoleSceneInfoController {
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "得到用户所有场景", description = "得到用户所有场景")
     @RequestMapping(value = {"getUserAllEnableScenes"}, method = {RequestMethod.GET})
-    public ResultContent<List<SceneInfoModel>> getUserAllEnableScenes() {
+    public ResultContent<List<SceneInfoAboutComModel>> getUserAllEnableScenes() {
         return ResultContent.buildSuccess(roleSceneInfoService.getUserAllEnableScenes());
     }
 

+ 6 - 7
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/scene/RoleSceneInfoService.java

@@ -5,10 +5,7 @@ import com.github.microservice.net.ResultMessage;
 import com.google.common.collect.Lists;
 import com.zhongshu.card.client.model.base.SortParam;
 import com.zhongshu.card.client.model.org.role.RoleSimpleModel;
-import com.zhongshu.card.client.model.scene.RoleBindAllParam;
-import com.zhongshu.card.client.model.scene.RoleBindSceneParam;
-import com.zhongshu.card.client.model.scene.RoleSceneInfoModel;
-import com.zhongshu.card.client.model.scene.SceneInfoModel;
+import com.zhongshu.card.client.model.scene.*;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.server.core.dao.org.RoleDao;
 import com.zhongshu.card.server.core.dao.scene.ProjectSceneInfoDao;
@@ -148,6 +145,7 @@ public class RoleSceneInfoService extends SuperService {
     public List<SceneInfoModel> getAllEnableScenes(String roleId) {
         List<SceneInfoModel> models = new ArrayList<>();
         if (StringUtils.isNotEmpty(roleId)) {
+            // 角色关联的场景数据
             List<RoleSceneInfo> list = roleSceneInfoDao.findByRoleIdOrderBySortAsc(roleId);
             if (ObjectUtils.isNotEmpty(list)) {
                 list.stream().forEach(it -> {
@@ -164,13 +162,14 @@ public class RoleSceneInfoService extends SuperService {
         return models;
     }
 
-    public List<SceneInfoModel> getUserAllEnableScenes() {
+    public List<SceneInfoAboutComModel> getUserAllEnableScenes() {
         // 得到当前用户所有的角色
         ResultContent<List<RoleSimpleModel>> content = roleServiceImpl.xcxGetCurrentRoles();
         if (content.isSuccess()) {
             List<RoleSimpleModel> roles = content.getContent();
             if (ObjectUtils.isNotEmpty(roles)) {
-                List<SceneInfoModel> models = new ArrayList<>();
+
+                List<SceneInfoAboutComModel> models = new ArrayList<>();
                 List<String> roleIds = roles.stream().map(it -> it.getId()).collect(Collectors.toUnmodifiableList());
                 List<RoleSceneInfo> list = roleSceneInfoDao.findByRoleIdInOrderBySortAsc(roleIds);
                 if (ObjectUtils.isNotEmpty(list)) {
@@ -179,7 +178,7 @@ public class RoleSceneInfoService extends SuperService {
                         ProjectSceneInfo projectSceneInfo = it.getProjectSceneInfo();
                         if (ObjectUtils.isNotEmpty(projectSceneInfo) && ObjectUtils.isNotEmpty(sceneInfo)) {
                             if (projectSceneInfo.getState() == DataState.Enable && sceneInfo.getState() == DataState.Enable) {
-                                models.add(sceneInfoService.toModel(sceneInfo));
+                                models.add(sceneInfoService.toAboutComModel(sceneInfo));
                             }
                         }
                     });