|
|
@@ -64,7 +64,7 @@ public class CollectionController extends BaseController {
|
|
|
@PostMapping("/create")
|
|
|
public Collection create(@RequestBody CollectionInfoDTO record) {
|
|
|
Collection collection = new Collection();
|
|
|
- BeanUtils.copyProperties(record,collection);
|
|
|
+ BeanUtils.copyProperties(record, collection);
|
|
|
collection = collectionService.create(collection);
|
|
|
CollectionPrivilege collectionPrivilege = new CollectionPrivilege();
|
|
|
BeanUtils.copyProperties(record, collectionPrivilege);
|
|
|
@@ -176,14 +176,16 @@ public class CollectionController extends BaseController {
|
|
|
collectionDTO.setPrivileges(null);
|
|
|
collectionDTO.setProperties(null);
|
|
|
|
|
|
- return new RecommendDTO(rc.getRecommend().getSort(), collectionDTO, "collection");
|
|
|
+ return new RecommendDTO(rc.getRecommend().getSort(), collectionDTO, "collection", rc.getRecommend()
|
|
|
+ .getCreatedAt());
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
List<RecommendDTO> news = newsRepo.recommend("LIST").stream().map(rn -> {
|
|
|
if (StringUtils.isNotBlank(rn.getRecommend().getPic())) {
|
|
|
rn.getNews().setPic(rn.getRecommend().getPic());
|
|
|
}
|
|
|
- return new RecommendDTO(rn.getRecommend().getSort(), rn.getNews(), "news");
|
|
|
+ return new RecommendDTO(rn.getRecommend().getSort(), rn.getNews(), "news", rn.getRecommend()
|
|
|
+ .getCreatedAt());
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
recommedDTOS.addAll(collectionDTOS);
|