|
@@ -29,7 +29,6 @@ import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.awt.*;
|
|
|
import java.io.File;
|
|
@@ -790,7 +789,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
userVO.setProvince(userPO.get().getProvince());
|
|
|
userVO.setCity(userPO.get().getCity());
|
|
|
userVO.setCounty(userPO.get().getCounty());
|
|
|
- userVO.setDetailedAddress(userPO.get().getDetailedAddress());
|
|
|
userVO.setPersonalCompetence(userPO.get().getPersonalCompetence());
|
|
|
userDTO.setUserVO(userVO);
|
|
|
return userDTO;
|
|
@@ -923,6 +921,30 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return technicalArticlesDTO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public IndexInfoDTO getHotTesting() {
|
|
|
+ IndexInfoDTO indexInfoDTO = new IndexInfoDTO();
|
|
|
+ Pageable pageable = PageRequest.of(0, 10);
|
|
|
+ int top = 10;
|
|
|
+ //获取热门众测
|
|
|
+ List<ApplicationTypeVO> applicationTypeRank = projectDao.findTotalCountOfApplicationType(pageable).stream().map(rankInfos -> {
|
|
|
+ ApplicationType applicationType = commonRepo.getApplicationTypeByAppCode(rankInfos.getCode());
|
|
|
+ ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
+ applicationTypeVO.setCount(rankInfos.getCount());
|
|
|
+ return applicationTypeVO;
|
|
|
+ }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<ApplicationTypeVO> applicationTypeRanks = new ArrayList<>();
|
|
|
+ if (applicationTypeRanks.size() > top) {
|
|
|
+ for (int i = 0; i < top; i++) {
|
|
|
+ applicationTypeRanks.add(applicationTypeRank.get(i));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ applicationTypeRanks = applicationTypeRank;
|
|
|
+ }
|
|
|
+ indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
|
+ return indexInfoDTO;
|
|
|
+ }
|
|
|
+
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
|
if (user == null)
|