|
@@ -27,6 +27,7 @@ import org.codehaus.jettison.json.JSONException;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -129,6 +130,13 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Autowired
|
|
|
private EndPointDao endPointDao;
|
|
|
|
|
|
+
|
|
|
+ @Value("${file.save.path}")
|
|
|
+ private String fileSaveRootPath;
|
|
|
+
|
|
|
+ @Value("${feature.client.oss}")
|
|
|
+ private Boolean usingOss;
|
|
|
+
|
|
|
@Override
|
|
|
public List<CrowdTestProjectVO> crowdTestProjects() {
|
|
|
List<CrowdTestProjectVO> authingList = new ArrayList<>();
|
|
@@ -501,12 +509,23 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@NotNull
|
|
|
public List<ApplicationTypeVO> getApplicationTypeRankVOS(Pageable pageable) {
|
|
|
|
|
|
- return 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());
|
|
|
+ if(usingOss){
|
|
|
+ return 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());
|
|
|
+ }else{
|
|
|
+ return projectDao.findTotalCountOfApplicationType(pageable).stream().map(rankInfos -> {
|
|
|
+ ApplicationType applicationType = commonRepo.getApplicationTypeByAppCode(rankInfos.getCode());
|
|
|
+ ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
+ applicationTypeVO.setCount(rankInfos.getCount());
|
|
|
+ applicationTypeVO.setImage(fileSaveRootPath + applicationType.getImage());
|
|
|
+ return applicationTypeVO;
|
|
|
+ }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|