Kaynağa Gözat

Merge branch 'wyp/0311-categoryVersion' of Server/long-article-recommend into master

wangyunpeng 2 ay önce
ebeveyn
işleme
e2b135e4cf

+ 0 - 3
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/AccountCategory.java

@@ -26,9 +26,6 @@ public class AccountCategory {
     @Column(name = "status")
     private Integer status;
 
-    @Column(name = "version")
-    private Integer version;
-
     @Column(name = "create_timestamp")
     private Long createTimestamp;
 

+ 2 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/AccountCategoryRepository.java

@@ -9,8 +9,8 @@ import java.util.List;
 @Repository
 public interface AccountCategoryRepository extends JpaRepository<AccountCategory, AccountCategory.PK> {
 
-    List<AccountCategory> getByGhIdAndStatusAndVersion(String ghId, Integer status, Integer version);
+    List<AccountCategory> getByGhIdAndStatus(String ghId, Integer status);
 
-    List<AccountCategory> getByStatusAndVersion(Integer status, Integer version);
+    List<AccountCategory> getByStatus(Integer status);
 
 }

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -486,7 +486,7 @@ public class RecallService implements ApplicationContextAware {
                 .filter(o -> "1".equals(o.getPosition()))
                 .filter(o -> Objects.nonNull(o.getReadAvg()) && o.getReadAvg() > 0 && o.getFans() > 1000)
                 .collect(Collectors.groupingBy(AccountAvgInfo::getGhId, Collectors.toMap(AccountAvgInfo::getUpdateTime, o -> o)));
-        List<AccountCategory> accountCategoryList = accountCategoryRepository.getByStatusAndVersion(StatusEnum.ONE.getCode(), activeVersion);
+        List<AccountCategory> accountCategoryList = accountCategoryRepository.getByStatus(StatusEnum.ONE.getCode());
         Map<String, JSONObject> accountCategoryMap = accountCategoryList.stream().filter(o -> StringUtils.hasText(o.getCategoryMap()))
                 .collect(Collectors.toMap(AccountCategory::getGhId, o -> JSONObject.parseObject(o.getCategoryMap())));
 

+ 2 - 6
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/score/strategy/CategoryStrategy.java

@@ -35,10 +35,6 @@ public class CategoryStrategy implements ScoreStrategy {
     @ApolloJsonValue("${accountCategoryWeightConfig:{}}")
     private Map<String, AccountCategoryWeightConfig[]> accountCategoryWeightConfigMap;
 
-    @Value("${category.active.version:1}")
-    private Integer activeVersion;
-
-
     @Override
     public List<Score> score(ScoreParam param) {
         long start = System.currentTimeMillis();
@@ -46,8 +42,8 @@ public class CategoryStrategy implements ScoreStrategy {
         if (CollectionUtils.isEmpty(param.getContents())) {
             return scores;
         }
-        List<AccountCategory> accountCategoryList = accountCategoryRepository.getByGhIdAndStatusAndVersion(
-                param.getGhId(), StatusEnum.ONE.getCode(), activeVersion);
+        List<AccountCategory> accountCategoryList = accountCategoryRepository.getByGhIdAndStatus(
+                param.getGhId(), StatusEnum.ONE.getCode());
         if (CollectionUtils.isEmpty(accountCategoryList)) {
             return scores;
         }