|
@@ -82,6 +82,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TaskToUserDao taskToUserDao;
|
|
private TaskToUserDao taskToUserDao;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
private TechnicalArticlesDao technicalarticlesDao;
|
|
private TechnicalArticlesDao technicalarticlesDao;
|
|
|
|
|
|
|
|
@Value("${agency}")
|
|
@Value("${agency}")
|
|
@@ -721,6 +722,37 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return authingList;
|
|
return authingList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<TechnicalArticlesVO> articlesRanking() {
|
|
|
|
|
+ Pageable pageable = PageRequest.of(0, 10);
|
|
|
|
|
+ List<TechnicalArticlesVO> technicalArticlesVOList = new ArrayList<>();
|
|
|
|
|
+ technicalarticlesDao.findReading(pageable).forEach(technicalArticlesPO -> {
|
|
|
|
|
+ TechnicalArticlesVO technicalArticlesVO = new TechnicalArticlesVO();
|
|
|
|
|
+ technicalArticlesVO.setId(technicalArticlesPO.getId());
|
|
|
|
|
+ technicalArticlesVO.setName(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getName());
|
|
|
|
|
+ technicalArticlesVO.setPhotoUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getPhotoUrl());
|
|
|
|
|
+ technicalArticlesVO.setArticlesUrl(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getArticlesUrl());
|
|
|
|
|
+ technicalArticlesVO.setReading(technicalarticlesDao.findById(technicalArticlesPO.getId()).get().getReading());
|
|
|
|
|
+ technicalArticlesVOList.add(technicalArticlesVO);
|
|
|
|
|
+ });
|
|
|
|
|
+ List<TechnicalArticlesVO> results = technicalArticlesVOList.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
+ return results;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public UserVO getinformation(long userId) {
|
|
|
|
|
+ Optional<UserPO> userPO = userDao.findById(userId);
|
|
|
|
|
+ if (userPO.isPresent()) {
|
|
|
|
|
+ UserVO userVO = new UserVO();
|
|
|
|
|
+ userVO.setName(userPO.get().getName());
|
|
|
|
|
+ userVO.setUserName(userPO.get().getUserName());
|
|
|
|
|
+ userVO.setGender(userPO.get().getGender());
|
|
|
|
|
+ userVO.setEmail(userPO.get().getEmail());
|
|
|
|
|
+ return userVO;
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
|
if (user == null)
|
|
if (user == null)
|