From 504c52b3642221eac41fc518cad47d110ff7f8c1 Mon Sep 17 00:00:00 2001 From: easonzhu Date: Fri, 21 Feb 2025 14:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/syzb/common/constant/ProductType.java | 10 ++---- .../syzb/common/service/RecommendService.java | 5 +-- start.sh | 31 +++++++++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 start.sh diff --git a/src/main/java/com/syzb/common/constant/ProductType.java b/src/main/java/com/syzb/common/constant/ProductType.java index b829970..abb3885 100644 --- a/src/main/java/com/syzb/common/constant/ProductType.java +++ b/src/main/java/com/syzb/common/constant/ProductType.java @@ -15,19 +15,15 @@ public enum ProductType { VIEW_SINGLE(2, "单篇观点"), VIDEO_SINGLE(3, "视频"), // COURSE(4, "课程"), - CIRCLE(5, "交易圈"), +// CIRCLE(5, "交易圈"), LIVE(6, "图文直播"), PORTFOLIO(7, "组合"), TIPS(8, "股票池"), PACKAGE_PRODUCT(9, "套餐产品"), H5(10, "H5"), // 仅用于推荐位&Banner VIDEO_COLUMN(11, "栏目"), // - THIRD_VALUE_PRODUCT(21, "三方产品-增值产品"), - THIRD_COURSE(22, "三方产品-课程"), - THIRD_ETF(23, "三方产品-ETF专区"), - THIRD_STOCK_TOOL(24, "三方产品-选股工具"), - SMALL_PLANE_FINANCE(25, "三方产品-小飞机理财"), + THIRD_PRODUCT(21, "三方产品"), COURSE_PACKAGE(31, "课程包"), COURSE_SINGLE(32, "课程"), @@ -41,8 +37,6 @@ public enum ProductType { public final String name; - public static final List THIRD_PRODUCTS = Arrays.asList(THIRD_VALUE_PRODUCT.value, THIRD_COURSE.value, THIRD_ETF.value, THIRD_STOCK_TOOL.value, SMALL_PLANE_FINANCE.value); - ProductType(Integer value, String name) { this.value = value; this.name = name; diff --git a/src/main/java/com/syzb/common/service/RecommendService.java b/src/main/java/com/syzb/common/service/RecommendService.java index d564fa9..1a35554 100644 --- a/src/main/java/com/syzb/common/service/RecommendService.java +++ b/src/main/java/com/syzb/common/service/RecommendService.java @@ -140,10 +140,7 @@ public class RecommendService { } MergeProductInfoVO vo = table.get(product.getProductType(), product.getProductId()); if ((ProductType.ADVISOR_INFO.equals(productType) && !AdvisorInfoStatus.PASS.value.equals(vo.getStatus())) - || (ProductType.THIRD_VALUE_PRODUCT.equals(productType) && !ThirdPartyProductStatus.PASS.value.equals(vo.getStatus())) - || (ProductType.THIRD_COURSE.equals(productType) && !ThirdPartyProductStatus.PASS.value.equals(vo.getStatus())) - || (ProductType.THIRD_ETF.equals(productType) && !ThirdPartyProductStatus.PASS.value.equals(vo.getStatus())) - || (ProductType.THIRD_STOCK_TOOL.equals(productType) && !ThirdPartyProductStatus.PASS.value.equals(vo.getStatus())) + || (ProductType.THIRD_PRODUCT.equals(productType) && !ThirdPartyProductStatus.PASS.value.equals(vo.getStatus())) ) { throw new BizException(ResponseStatus.PRODUCT_STATUS_ERROR); } diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..9b35211 --- /dev/null +++ b/start.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# 获取当前日期(格式:yyyyMMdd) +current_date=$(date +"%Y%m%d") + +# 日志文件名,包含日期 +log_file="advisor_server_${current_date}.log" + +# 查找包含 AdvisorServer 的进程 +pid=$(ps aux | grep 'AdvisorServer' | grep -v 'grep' | awk '{print $2}') + +if [ -n "$pid" ]; then + # 如果找到了进程,则杀掉它 + echo "Found process with PID $pid. Killing the process..." + kill -9 $pid + if [ $? -eq 0 ]; then + echo "Process $pid terminated successfully." + else + echo "Failed to terminate process $pid." + fi +else + echo "No process found for AdvisorServer." +fi + +# 使用 nohup 启动 jar 包,并设置 JVM 内存参数,同时保存日志,追加输出 +echo "Starting /root/AdvisorServer-2.6.7.jar with JVM memory parameters..." >> "$log_file" 2>&1 + +nohup java -Xms2g -Xmx2g -XX:+UseG1GC -jar AdvisorServer-2.6.7.jar --spring.profiles.active=prod >> "$log_file" 2>&1 & + +echo "AdvisorServer-2.6.7.jar started in background with nohup." >> "$log_file" 2>&1 +