|
@@ -1,5 +1,7 @@
|
|
|
package com.tzld.longarticle.recommend.server.service.api.impl;
|
|
package com.tzld.longarticle.recommend.server.service.api.impl;
|
|
|
|
|
|
|
|
|
|
+import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
|
|
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId;
|
|
import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId;
|
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.LongArticlesRootSourceIdRepository;
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.LongArticlesRootSourceIdRepository;
|
|
|
import com.tzld.longarticle.recommend.server.service.api.ApiService;
|
|
import com.tzld.longarticle.recommend.server.service.api.ApiService;
|
|
@@ -9,7 +11,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -18,6 +22,9 @@ public class ApiServiceImpl implements ApiService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
LongArticlesRootSourceIdRepository longArticlesRootSourceIdRepository;
|
|
LongArticlesRootSourceIdRepository longArticlesRootSourceIdRepository;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LongArticleBaseMapper longArticleBaseMapper;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
|
@@ -45,4 +52,16 @@ public class ApiServiceImpl implements ApiService {
|
|
|
return exists;
|
|
return exists;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<String> getSourceIdsByAccount(String accountName, String type, Integer position,
|
|
|
|
|
+ String dateStrStart, String dateStrEnd) {
|
|
|
|
|
+ List<DatastatSortStrategy> list = longArticleBaseMapper.getByAccountAndOptionalParams(accountName, type, position,
|
|
|
|
|
+ dateStrStart, dateStrEnd);
|
|
|
|
|
+ return list.stream()
|
|
|
|
|
+ .map(DatastatSortStrategy::getSourceId)
|
|
|
|
|
+ .filter(StringUtils::isNotEmpty)
|
|
|
|
|
+ .distinct()
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|