丁云鹏 před 11 měsíci
rodič
revize
677d0282dc

+ 3 - 101
long-article-recommend-service/src/main/resources/application-prod.yml

@@ -1,88 +1,7 @@
 server:
   port: 8080
 
-eureka:
-  instance:
-    prefer-ip-address: true #是否优先使用IP地址作为主机名的标识,默认false
-    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port} #注册到eureka上的唯一实例ID
-    lease-renewal-interval-in-seconds: 10 #表示eureka client发送心跳给server端的频率,默认30
-    lease-expiration-duration-in-seconds: 30 #表示eureka server至上一次收到client的心跳之后,等待下一次心跳的超时时间,在这个时间内若没收到下一次心跳,则将移除该instance,默认90
-  client:
-    registry-fetch-interval-seconds: 5  #定时从Eureka Server拉取服务注册信息的间隔时间
-    serviceUrl:
-      defaultZone: http://eureka-internal.piaoquantv.com/eureka/
-
 spring:
-  redis:
-    hostName: r-bp1fogs2mflr1ybfot.redis.rds.aliyuncs.com
-    port: 6379
-    password: Wqsd@2019
-    timeout: 1000
-    lettuce:
-      pool:
-        max-active: 8
-        max-wait: -1
-        max-idle: 8
-        min-idle: 0
-  feature-redis:
-    hostName: r-bp1pi8wyv6lzvgjy5z.redis.rds.aliyuncs.com
-    port: 6379
-    password: Wqsd@2019
-    timeout: 1000
-    lettuce:
-      pool:
-        max-active: 8
-        max-wait: -1
-        max-idle: 8
-        min-idle: 0
-  long-video-redis:
-    hostName: r-bp1oyhyx4mxgs6klyt561.redis.rds.aliyuncs.com
-    port: 6379
-    password: Wqsd@2019
-    timeout: 1000
-    lettuce:
-      pool:
-        max-active: 8
-        max-wait: -1
-        max-idle: 8
-        min-idle: 0
-  filter-redis:
-    hostName: r-bp109v1gjl63qi00cb.redis.rds.aliyuncs.com
-    port: 6379
-    password: Wqsd@2019
-    timeout: 1000
-    lettuce:
-      pool:
-        max-active: 8
-        max-wait: -1
-        max-idle: 8
-        min-idle: 0
-  video-redis:
-    hostName: r-bp1f3341ec15a634301.redis.rds.aliyuncs.com
-    port: 6379
-    password: Wqsd@2019
-    timeout: 1000
-    lettuce:
-      pool:
-        max-active: 8
-        max-wait: -1
-        max-idle: 8
-        min-idle: 0
-  data:
-    mongodb:
-      clusterHost: s-bp14ce206f81b754.mongodb.rds.aliyuncs.com
-      clusterPort: 3717
-      secondaryHost: s-bp137073555e7bc4.mongodb.rds.aliyuncs.com
-      secondaryPort: 3717
-      database: longvideo
-      username: lv
-      password: lv2018
-      # 连接池
-      maxConnectionIdleTime: 180000
-      # maxConnectionLifeTime: 30000
-      maxWaitTime: 5000
-      minSize: 5
-      maxSize: 100
   datasource:
     url: jdbc:mysql://rm-bp1jjv3jv98133plv285-vpc-rw.mysql.rds.aliyuncs.com:3306/longvideo?useSSL=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
     username: wx2016_longvideo
@@ -98,18 +17,6 @@ spring:
     hibernate:
       ddl-auto: validate
     database: mysql
-xxl:
-  job:
-    admin:
-      addresses: http://192.168.201.25:8182/xxl-job-admin
-    accessToken:
-    executor:
-      appname: ${spring.application.name}
-      address:
-      ip:
-      port: 9999
-      logpath: /datalog/weblog/${spring.application.name}/xxl-job/
-      logretentiondays: 30
 
 apollo:
   meta: http://apolloconfig-internal.piaoquantv.com
@@ -119,13 +26,8 @@ aliyun:
     endpoint: cn-hangzhou-intranet.log.aliyuncs.com
     accessKeyId: LTAIP6x1l3DXfSxm
     accessKeySecret: KbTaM9ars4OX3PMS6Xm7rtxGr1FLon
-    project: recommend-server
+    project: longarticle-recommend-server-test
   timer:
     log:
-      project: recommend-server
-      logStore: timer
-  blacklist:
-    filter:
-      log:
-        project: wqsd-video
-        store: video_blacklist_security_filter_log
+      project: longarticle-recommend-server-test
+      logStore: timer

+ 36 - 43
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/FilterStrategyTest.java

@@ -1,16 +1,9 @@
 package com.tzld.longarticle.recommend.server;
 
-import com.alibaba.fastjson.JSONObject;
-import com.tzld.longarticle.recommend.server.model.Content;
-import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
-import com.tzld.longarticle.recommend.server.service.filter.FilterResult;
 import com.tzld.longarticle.recommend.server.service.filter.FilterStrategy;
-import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
 
 @SpringBootTest(classes = Application.class)
 public class FilterStrategyTest {
@@ -19,40 +12,40 @@ public class FilterStrategyTest {
     FilterStrategy badStrategy;
     @Resource
     FilterStrategy historyTitleStrategy;
-    @Test
-    public void badStrategyTest() {
-        FilterParam param = new FilterParam();
-        List<Content> contentList = new ArrayList<>();
-        Content content0 = new Content();
-        content0.setId("0");
-        content0.setTitle("中国第一位小品女皇,因一句台词识破潜伏间谍");
-        contentList.add(content0);
-        Content content1 = new Content();
-        content1.setId("1");
-        content1.setTitle("终身未娶拉扯张长大28年,女孩回报方式看哭众人");
-        contentList.add(content1);
-        param.setContents(contentList);
-        FilterResult result = badStrategy.filter(param);
-        System.out.println(JSONObject.toJSONString(result));
-    }
-    @Test
-    public void historyTitleStrategyTest() {
-        FilterParam param = new FilterParam();
-        List<Content> contentList = new ArrayList<>();
-        Content content0 = new Content();
-        content0.setId("0");
-        content0.setTitle("婆婆照顾十二年,醒后第一句话出乎意料");
-        content0.setProducePlanName("【1】");
-        contentList.add(content0);
-        Content content1 = new Content();
-        content1.setId("1");
-        content1.setTitle("邯郸惨案的深层原因");
-        content1.setProducePlanName("【2】");
-        content1.setContentPoolType("autoArticlePoolLevel2");
-        contentList.add(content1);
-        param.setAccountName("生活良读");
-        param.setContents(contentList);
-        FilterResult result = historyTitleStrategy.filter(param);
-        System.out.println(JSONObject.toJSONString(result));
-    }
+//    @Test
+//    public void badStrategyTest() {
+//        FilterParam param = new FilterParam();
+//        List<Content> contentList = new ArrayList<>();
+//        Content content0 = new Content();
+//        content0.setId("0");
+//        content0.setTitle("中国第一位小品女皇,因一句台词识破潜伏间谍");
+//        contentList.add(content0);
+//        Content content1 = new Content();
+//        content1.setId("1");
+//        content1.setTitle("终身未娶拉扯张长大28年,女孩回报方式看哭众人");
+//        contentList.add(content1);
+//        param.setContents(contentList);
+//        FilterResult result = badStrategy.filter(param);
+//        System.out.println(JSONObject.toJSONString(result));
+//    }
+//    @Test
+//    public void historyTitleStrategyTest() {
+//        FilterParam param = new FilterParam();
+//        List<Content> contentList = new ArrayList<>();
+//        Content content0 = new Content();
+//        content0.setId("0");
+//        content0.setTitle("婆婆照顾十二年,醒后第一句话出乎意料");
+//        content0.setProducePlanName("【1】");
+//        contentList.add(content0);
+//        Content content1 = new Content();
+//        content1.setId("1");
+//        content1.setTitle("邯郸惨案的深层原因");
+//        content1.setProducePlanName("【2】");
+//        content1.setContentPoolType("autoArticlePoolLevel2");
+//        contentList.add(content1);
+//        param.setAccountName("生活良读");
+//        param.setContents(contentList);
+//        FilterResult result = historyTitleStrategy.filter(param);
+//        System.out.println(JSONObject.toJSONString(result));
+//    }
 }

+ 8 - 8
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/RecommendTest.java

@@ -19,13 +19,13 @@ public class RecommendTest {
     private RecallService recallService;
 
 
-    @Test
-    void recall() {
-        RecallParam param = new RecallParam();
-        param.setAccountId("20231213123536190184852");
-        param.setPlanId("20240718181730864154902");
-        RecallResult recallResult = recallService.recall(param);
-        System.out.println(JSONObject.toJSONString(recallResult));
-    }
+//    @Test
+//    void recall() {
+//        RecallParam param = new RecallParam();
+//        param.setAccountId("20231213123536190184852");
+//        param.setPlanId("20240718181730864154902");
+//        RecallResult recallResult = recallService.recall(param);
+//        System.out.println(JSONObject.toJSONString(recallResult));
+//    }
 
 }