|
@@ -7,10 +7,7 @@ import com.mooctest.crowd.domain.domainobject.*;
|
|
|
import com.mooctest.crowd.domain.exception.*;
|
|
|
import com.mooctest.crowd.domain.factory.CrowdTestProjectFactory;
|
|
|
import com.mooctest.crowd.domain.model.*;
|
|
|
-import com.mooctest.crowd.domain.repository.CommonRepo;
|
|
|
-import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
|
|
|
-import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
|
|
|
-import com.mooctest.crowd.domain.repository.UserRepo;
|
|
|
+import com.mooctest.crowd.domain.repository.*;
|
|
|
import com.mooctest.crowd.domain.util.Converter;
|
|
|
import com.mooctest.crowd.site.command.ApplyEnterpriseAuthCommand;
|
|
|
import com.mooctest.crowd.site.command.ApplyPersonalAuthCommand;
|
|
@@ -61,6 +58,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
private CommonRepo commonRepo;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ToolRepo toolRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CrowdTestTaskDao taskDao;
|
|
|
|
|
|
@Autowired
|
|
@@ -463,7 +463,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
// userRanks = userRank;
|
|
|
// }
|
|
|
|
|
|
- // 获取资源和工具
|
|
|
+ // 获取资源
|
|
|
List<Resource> resourceList = commonRepo.getAllResource();
|
|
|
List<ResourceVO> resourceVOS = new ArrayList<>();
|
|
|
List<ResourceVO> resourceVOList = resourceList.stream().map(resource -> {
|
|
@@ -478,11 +478,23 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
resourceVOS = resourceVOList;
|
|
|
}
|
|
|
|
|
|
+ // 获取工具
|
|
|
+ List<Tool> toolList = toolRepo.getAllTools();
|
|
|
+ List<ToolVO> toolVOS = new ArrayList<>();
|
|
|
+ List<ToolVO> toolVOList = toolList.stream().map(tool -> new ToolVO(tool)).collect(Collectors.toList());
|
|
|
+ if (toolVOList.size() > 12) {
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
+ toolVOS.add(toolVOList.get(i));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ toolVOS = toolVOList;
|
|
|
+ }
|
|
|
+
|
|
|
indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
|
indexInfoDTO.setAgencyRank(agencyRanks);
|
|
|
indexInfoDTO.setUserRank(userRanks);
|
|
|
indexInfoDTO.setResourceList(resourceVOS);
|
|
|
-
|
|
|
+ indexInfoDTO.setToolList(toolVOS);
|
|
|
return indexInfoDTO;
|
|
|
}
|
|
|
|