丁云鹏 vor 11 Monaten
Ursprung
Commit
d42dd9460e

+ 5 - 3
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/BadStrategy.java

@@ -1,5 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.filter.strategy;
 
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.longarticle.recommend.server.model.Content;
 import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService;
 import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
@@ -16,12 +17,13 @@ import java.util.List;
 
 @Component
 @Slf4j
-public class BadStrategy  implements FilterStrategy {
+public class BadStrategy implements FilterStrategy {
 
     @Autowired
     private AIGCRemoteService aigcRemoteService;
 
 
+    @ApolloJsonValue("${badTitles:[]}")
     private static List<String> badTitles;
 
     static {
@@ -53,8 +55,8 @@ public class BadStrategy  implements FilterStrategy {
     public FilterResult filter(FilterParam param) {
         FilterResult filterResult = new FilterResult();
         List<String> result = new ArrayList<>();
-        List<Content> contents  = param.getContents();
-        List<Content> filterContents  = new ArrayList<>();
+        List<Content> contents = param.getContents();
+        List<Content> filterContents = new ArrayList<>();
         for (Content content : contents) {
             if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), badTitles)) {
                 result.add(content.getId());

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

@@ -15,8 +15,6 @@ import org.springframework.stereotype.Component;
 @Component
 @Slf4j
 public class CategoryStrategy implements FilterStrategy {
-    @Value("${aaa:528}")
-    private String aaa;
 
     @Override
     public FilterResult filter(FilterParam param) {

+ 2 - 2
long-article-recommend-service/src/main/resources/application-dev.yml

@@ -33,10 +33,10 @@ aliyun:
     endpoint: cn-hangzhou.log.aliyuncs.com
     accessKeyId: LTAIP6x1l3DXfSxm
     accessKeySecret: KbTaM9ars4OX3PMS6Xm7rtxGr1FLon
-    project: recommend-server-test
+    project: longarticle-recommend-server-test
   timer:
     log:
-      project: recommend-server-test
+      project: longarticle-recommend-server-test
       logStore: timer
 
 logging:

+ 14 - 21
long-article-recommend-service/src/main/resources/application.yml

@@ -2,7 +2,7 @@ spring:
   profiles:
     active: dev
   application:
-    name: recommend-server
+    name: longarticle-recommend-server
 #  cloud:
 #    sentinel:
 #      eager: true
@@ -17,15 +17,15 @@ spring:
 #            flow-rules-key: sentinel.flowRules
 #            default-flow-rule-value: []
 #            rule-type: flow
-grpc:
-  server:
-    port: 9001
-    reflection-service-enabled: true
-  client:
-    recommend-feature:
-      negotiationType: PLAINTEXT
-    abtest:
-      negotiationType: PLAINTEXT
+#grpc:
+#  server:
+#    port: 9001
+#    reflection-service-enabled: true
+#  client:
+#    recommend-feature:
+#      negotiationType: PLAINTEXT
+#    abtest:
+#      negotiationType: PLAINTEXT
 
 server:
   tomcat:
@@ -35,7 +35,7 @@ server:
     accept-count: 1000
     connection-timeout: 30000
   servlet:
-    context-path: /recommend-server
+    context-path: /
     session:
       timeout: 60
 pagehelper:
@@ -46,16 +46,9 @@ logging:
     path: /datalog/weblog/${spring.application.name}/
 
 app:
-  id: recommend-server
+  id: longarticle-recommend
 apollo:
   bootstrap:
     enabled: true
-    namespaces: application,RD.Experiment
-  cacheDir: /datalog/apollo-cache-dir
-
-feign:
-  client:
-    config:
-      default:
-        connectTimeout: 2000
-        readTimeout: 10000
+    namespaces: application
+  cacheDir: /datalog/apollo-cache-dir