优化脚本及配置文件
This commit is contained in:
parent
04e005a2c8
commit
620825100e
19
deploy.bat
19
deploy.bat
@ -1,6 +1,13 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
:: 1. 运行 Maven 打包
|
:: 1. 设置动态参数
|
||||||
|
set REMOTE_IP=8.138.144.54
|
||||||
|
set REMOTE_PORT=22
|
||||||
|
set REMOTE_PATH=/root
|
||||||
|
set REMOTE_USER=root
|
||||||
|
set START_SCRIPT=/root/start.sh
|
||||||
|
|
||||||
|
:: 2. 运行 Maven 打包
|
||||||
echo Running mvn clean package...
|
echo Running mvn clean package...
|
||||||
:: call mvn clean package -P thin-jar
|
:: call mvn clean package -P thin-jar
|
||||||
call mvn clean package
|
call mvn clean package
|
||||||
@ -11,9 +18,9 @@ IF %ERRORLEVEL% NEQ 0 (
|
|||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
)
|
)
|
||||||
|
|
||||||
:: 2. 将 JAR 包传输到 Linux 服务器
|
:: 3. 将 JAR 包传输到 Linux 服务器
|
||||||
echo Copying JAR file to Linux server...
|
echo Copying JAR file to Linux server...
|
||||||
call scp target\AdvisorServer-2.6.7.jar root@8.138.144.54:/root
|
call scp -P %REMOTE_PORT% target\AdvisorServer-2.6.7.jar %REMOTE_USER%@%REMOTE_IP%:%REMOTE_PATH%
|
||||||
|
|
||||||
:: 检查 SCP 命令是否成功
|
:: 检查 SCP 命令是否成功
|
||||||
IF %ERRORLEVEL% NEQ 0 (
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
@ -21,9 +28,9 @@ IF %ERRORLEVEL% NEQ 0 (
|
|||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
)
|
)
|
||||||
|
|
||||||
:: 3. 通过 SSH 运行 start.sh 脚本
|
:: 4. 通过 SSH 运行 start.sh 脚本
|
||||||
echo Running start.sh script on Linux server...
|
echo Running start.sh script on Linux server...
|
||||||
call ssh root@8.138.144.54 "bash /root/start.sh"
|
call ssh -p %REMOTE_PORT% %REMOTE_USER%@%REMOTE_IP% "bash %START_SCRIPT%"
|
||||||
|
|
||||||
:: 检查 SSH 命令是否成功
|
:: 检查 SSH 命令是否成功
|
||||||
IF %ERRORLEVEL% NEQ 0 (
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
@ -31,4 +38,4 @@ IF %ERRORLEVEL% NEQ 0 (
|
|||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Deployment successful!
|
echo Deployment successful!
|
||||||
41
deploy_frontend.sh
Normal file
41
deploy_frontend.sh
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 当前服务器上的文件路径
|
||||||
|
HTML_ZIP_FILE="/tmp/h5.zip /tmp/syAdmin.zip"
|
||||||
|
|
||||||
|
# 目标服务器信息(格式:IP地址:端口)
|
||||||
|
SERVERS=(
|
||||||
|
"172.26.1.9:22"
|
||||||
|
"172.26.1.15:22"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 目标路径
|
||||||
|
TARGET_DIR="/home/ubuntu"
|
||||||
|
|
||||||
|
# 1. 循环拷贝文件到所有服务器
|
||||||
|
for SERVER in "${SERVERS[@]}"; do
|
||||||
|
# 获取 IP 和端口
|
||||||
|
IP=$(echo $SERVER | cut -d ':' -f 1)
|
||||||
|
PORT=$(echo $SERVER | cut -d ':' -f 2)
|
||||||
|
|
||||||
|
# 拷贝 JAR 文件到目标服务器
|
||||||
|
echo "Copying HTML_ZIP_FILE to $IP:$TARGET_DIR"
|
||||||
|
scp -P $PORT $HTML_ZIP_FILE ubuntu@$IP:$TARGET_DIR
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Files copied to all servers."
|
||||||
|
|
||||||
|
# 2. 所有文件拷贝完成后,执行服务器上的release_html.sh
|
||||||
|
for SERVER in "${SERVERS[@]}"; do
|
||||||
|
# 获取 IP 和端口
|
||||||
|
IP=$(echo $SERVER | cut -d ':' -f 1)
|
||||||
|
PORT=$(echo $SERVER | cut -d ':' -f 2)
|
||||||
|
|
||||||
|
# 执行 release_html.sh 脚本
|
||||||
|
echo "Executing release_html.sh on $IP"
|
||||||
|
ssh -p $PORT ubuntu@$IP "sudo bash /home/ubuntu/release_html.sh"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All html released."
|
||||||
|
|
||||||
|
echo "All tasks completed."
|
||||||
30
deploy_html.bat
Normal file
30
deploy_html.bat
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
:: 1. 设置动态参数
|
||||||
|
set REMOTE_IP=119.29.151.152
|
||||||
|
set REMOTE_PORT=22101
|
||||||
|
set REMOTE_PATH=/tmp
|
||||||
|
set REMOTE_USER=ubuntu
|
||||||
|
set DEPLOY_SCRIPT=/home/ubuntu/deploy_html.sh
|
||||||
|
|
||||||
|
:: 3. 将 ZIP 包传输到 Linux 服务器
|
||||||
|
echo Copying ZIP file to Linux server...
|
||||||
|
call scp -P %REMOTE_PORT% h5.zip syAdmin.zip %REMOTE_USER%@%REMOTE_IP%:%REMOTE_PATH%
|
||||||
|
|
||||||
|
:: 检查 SCP 命令是否成功
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo File transfer failed, exiting...
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
:: 4. 通过 SSH 运行 deploy.sh 脚本
|
||||||
|
echo Running deploy_html.sh script on Linux server...
|
||||||
|
call ssh -p %REMOTE_PORT% %REMOTE_USER%@%REMOTE_IP% "bash %DEPLOY_SCRIPT%"
|
||||||
|
|
||||||
|
:: 检查 SSH 命令是否成功
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo Failed to start the application, exiting...
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Deployment successful!
|
||||||
41
deploy_prod.bat
Normal file
41
deploy_prod.bat
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
:: 1. 设置动态参数
|
||||||
|
set REMOTE_IP=119.29.151.152
|
||||||
|
set REMOTE_PORT=22101
|
||||||
|
set REMOTE_PATH=/tmp
|
||||||
|
set REMOTE_USER=ubuntu
|
||||||
|
set DEPLOY_SCRIPT=/home/ubuntu/deploy_advisor.sh
|
||||||
|
|
||||||
|
:: 2. 运行 Maven 打包
|
||||||
|
echo Running mvn clean package...
|
||||||
|
:: call mvn clean package -P thin-jar
|
||||||
|
call mvn clean package
|
||||||
|
|
||||||
|
:: 检查是否打包成功
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo Maven build failed, exiting...
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
:: 3. 将 JAR 包传输到 Linux 服务器
|
||||||
|
echo Copying JAR file to Linux server...
|
||||||
|
call scp -P %REMOTE_PORT% target\AdvisorServer-2.6.7.jar %REMOTE_USER%@%REMOTE_IP%:%REMOTE_PATH%
|
||||||
|
|
||||||
|
:: 检查 SCP 命令是否成功
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo File transfer failed, exiting...
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
:: 4. 通过 SSH 运行 deploy.sh 脚本
|
||||||
|
echo Running deploy_advisor.sh script on Linux server...
|
||||||
|
call ssh -p %REMOTE_PORT% %REMOTE_USER%@%REMOTE_IP% "bash %DEPLOY_SCRIPT%"
|
||||||
|
|
||||||
|
:: 检查 SSH 命令是否成功
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo Failed to start the application, exiting...
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Deployment successful!
|
||||||
5
pom.xml
5
pom.xml
@ -64,6 +64,11 @@
|
|||||||
<artifactId>hazelcast-sql</artifactId>
|
<artifactId>hazelcast-sql</artifactId>
|
||||||
<version>5.3.8</version>
|
<version>5.3.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.hazelcast</groupId>
|
||||||
|
<artifactId>hazelcast-spring</artifactId>
|
||||||
|
<version>5.3.8</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
|
|||||||
56
shell/prod/deploy_advisor.sh
Normal file
56
shell/prod/deploy_advisor.sh
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 当前服务器上的文件路径
|
||||||
|
JAR_FILE="/tmp/AdvisorServer-2.6.7.jar"
|
||||||
|
|
||||||
|
# 目标服务器信息(格式:IP地址:端口)
|
||||||
|
SERVERS=(
|
||||||
|
"172.26.1.3:22"
|
||||||
|
"172.26.1.7:22"
|
||||||
|
"172.26.1.9:22"
|
||||||
|
"172.26.1.15:22"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 目标路径
|
||||||
|
TARGET_DIR="/home/ubuntu"
|
||||||
|
|
||||||
|
# 1. 循环拷贝文件到所有服务器
|
||||||
|
for SERVER in "${SERVERS[@]}"; do
|
||||||
|
# 获取 IP 和端口
|
||||||
|
IP=$(echo $SERVER | cut -d ':' -f 1)
|
||||||
|
PORT=$(echo $SERVER | cut -d ':' -f 2)
|
||||||
|
|
||||||
|
# 拷贝 JAR 文件到目标服务器
|
||||||
|
echo "Copying $JAR_FILE to $IP:$TARGET_DIR"
|
||||||
|
scp -P $PORT $JAR_FILE ubuntu@$IP:$TARGET_DIR
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Files copied to all servers."
|
||||||
|
|
||||||
|
# 2. 所有文件拷贝完成后,停止服务
|
||||||
|
for SERVER in "${SERVERS[@]}"; do
|
||||||
|
# 获取 IP 和端口
|
||||||
|
IP=$(echo $SERVER | cut -d ':' -f 1)
|
||||||
|
PORT=$(echo $SERVER | cut -d ':' -f 2)
|
||||||
|
|
||||||
|
# 执行 start.sh 脚本
|
||||||
|
echo "Stopping $START_SCRIPT on $IP"
|
||||||
|
ssh -p $PORT ubuntu@$IP "sudo systemctl stop advisor-server"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All services stopped."
|
||||||
|
|
||||||
|
# 3. 所有文件拷贝完成后,启动服务
|
||||||
|
for SERVER in "${SERVERS[@]}"; do
|
||||||
|
# 获取 IP 和端口
|
||||||
|
IP=$(echo $SERVER | cut -d ':' -f 1)
|
||||||
|
PORT=$(echo $SERVER | cut -d ':' -f 2)
|
||||||
|
|
||||||
|
# 执行 start.sh 脚本
|
||||||
|
echo "Starting $START_SCRIPT on $IP"
|
||||||
|
ssh -p $PORT ubuntu@$IP "sudo systemctl start advisor-server"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All services started."
|
||||||
|
|
||||||
|
echo "All tasks completed."
|
||||||
@ -92,6 +92,9 @@ public class AdvisorInfoService {
|
|||||||
@Resource
|
@Resource
|
||||||
private AdvertService advertService;
|
private AdvertService advertService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Value("${advisor.roleId}")
|
@Value("${advisor.roleId}")
|
||||||
private Integer advisorRoleId;
|
private Integer advisorRoleId;
|
||||||
|
|
||||||
@ -100,8 +103,6 @@ public class AdvisorInfoService {
|
|||||||
AdvisorInfoStatus.EVENT_SUBMIT.value,
|
AdvisorInfoStatus.EVENT_SUBMIT.value,
|
||||||
AdvisorInfoStatus.EVENT_PASS.value
|
AdvisorInfoStatus.EVENT_PASS.value
|
||||||
);
|
);
|
||||||
@Autowired
|
|
||||||
private UserService userService;
|
|
||||||
|
|
||||||
public Map<Integer, AdvisorBasic> getAdvisorMap() {
|
public Map<Integer, AdvisorBasic> getAdvisorMap() {
|
||||||
return cacheService.get(ADVISOR_INFO, AdvisorInfoKey.ADVISOR_MAP, () -> {
|
return cacheService.get(ADVISOR_INFO, AdvisorInfoKey.ADVISOR_MAP, () -> {
|
||||||
|
|||||||
@ -9,8 +9,10 @@ import com.syzb.business.vo.*;
|
|||||||
import com.syzb.common.handler.BizException;
|
import com.syzb.common.handler.BizException;
|
||||||
import com.syzb.common.result.ResponseStatus;
|
import com.syzb.common.result.ResponseStatus;
|
||||||
import com.syzb.common.util.logger.LoggerUtil;
|
import com.syzb.common.util.logger.LoggerUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
@ -24,28 +26,33 @@ import java.util.Map;
|
|||||||
// business信息Service
|
// business信息Service
|
||||||
@Service
|
@Service
|
||||||
public class BusinessApiService {
|
public class BusinessApiService {
|
||||||
|
|
||||||
private String host = "https://webdzapi.ceniu.sztg.com";
|
|
||||||
|
|
||||||
private String loginUrl = "/common/loginByUserName";
|
@Value("${business.api.host}")
|
||||||
|
private String host;
|
||||||
|
|
||||||
private String getUserUrl = "/common/getUserByToken";
|
@Value("${business.api.url.loginUrl}")
|
||||||
|
private String loginUrl;
|
||||||
|
|
||||||
private String getModuleListUrl = "/user/getUserModuleList";
|
@Value("${business.api.url.getUserUrl}")
|
||||||
|
private String getUserUrl;
|
||||||
|
|
||||||
private String getOrderListUrl = "/order/getAllBatchOrderListByPage";
|
@Value("${business.api.url.getModuleListUrl}")
|
||||||
|
private String getModuleListUrl;
|
||||||
|
|
||||||
private String getModuleUserListUrl = "/order/getUserModuleListByPage";
|
@Value("${business.api.url.getOrderListUrl}")
|
||||||
|
private String getOrderListUrl;
|
||||||
|
|
||||||
private String authorizationDeptId = "16";
|
@Value("${business.api.url.getModuleUserListUrl}")
|
||||||
|
private String getModuleUserListUrl;
|
||||||
|
|
||||||
private String authorizationKey = "56e670eea5ff3a1aebbc02820e908ceb56e670eea5ff3a1aebbc02820e908ceb";
|
@Value("${business.api.authorizationDeptId}")
|
||||||
|
private String authorizationDeptId;
|
||||||
|
|
||||||
// private String authorizationDeptId = "33";
|
@Value("${business.api.authorizationKey}")
|
||||||
//
|
private String authorizationKey;
|
||||||
// private String authorizationKey = "90804bd6089d950e8804c6d7cad7558a90804bd6089d950e8804c6d7cad7558a";
|
|
||||||
|
|
||||||
private static final int timeout = 10000;
|
@Value("${business.api.timeout}")
|
||||||
|
private int timeout = 10000;
|
||||||
|
|
||||||
private static final int SUCCESS_CODE = 200;
|
private static final int SUCCESS_CODE = 200;
|
||||||
|
|
||||||
@ -134,20 +141,6 @@ public class BusinessApiService {
|
|||||||
return vo.getData();
|
return vo.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
BusinessApiService service = new BusinessApiService();
|
|
||||||
// BusinessLoginVO loginVO = service.loginByUserName("sz545138", "Abc@123");
|
|
||||||
// String token = loginVO.getToken();
|
|
||||||
// String token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1NDUxMzgiLCJpYXQiOjE3Mzk5NTcxMjYsImV4cCI6MTczOTk2MDcyNn0.02FnOeW7RnIeI7sqwTTw0H9NPj03iFRAkr9PPXwpaDMgRTK2v7krDqAYa6dSIkuGx8wnKWPp-kcA4Ajr_MLjdw";
|
|
||||||
// BusinessUserVO userVO = service.getUser(token);
|
|
||||||
// System.out.println(JSONUtil.toJsonStr(userVO));
|
|
||||||
// service.getModuleList(userVO.getUserId().toString());
|
|
||||||
// List<BusinessOrderVO> orderList = service.getOrderList(LocalDate.now().withDayOfYear(1).atStartOfDay(), LocalDateTime.now());
|
|
||||||
// System.out.println(JSONUtil.toJsonStr(orderList));
|
|
||||||
List<BusinessModuleUserVO> moduleUserList = service.getModuleUserList(1000, LocalDate.now().withDayOfYear(1).atStartOfDay(), LocalDateTime.now());
|
|
||||||
System.out.println(JSONUtil.toJsonStr(moduleUserList));
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T extends BusinessVO> T post(String url, Map<String, Object> params, Class<T> type) {
|
private <T extends BusinessVO> T post(String url, Map<String, Object> params, Class<T> type) {
|
||||||
T vo;
|
T vo;
|
||||||
try {
|
try {
|
||||||
@ -213,4 +206,19 @@ public class BusinessApiService {
|
|||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @PostConstruct
|
||||||
|
// public void test() {
|
||||||
|
// BusinessLoginVO loginVO = login("sz545138", "Abc@123");
|
||||||
|
// String token = loginVO.getToken();
|
||||||
|
//// String token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1NDUxMzgiLCJpYXQiOjE3Mzk5NTcxMjYsImV4cCI6MTczOTk2MDcyNn0.02FnOeW7RnIeI7sqwTTw0H9NPj03iFRAkr9PPXwpaDMgRTK2v7krDqAYa6dSIkuGx8wnKWPp-kcA4Ajr_MLjdw";
|
||||||
|
// BusinessUserVO userVO = getUser(token);
|
||||||
|
// System.out.println(JSONUtil.toJsonStr(userVO));
|
||||||
|
// List<BusinessModuleVO> moduleList = getModuleList(userVO.getUserId().toString());
|
||||||
|
// System.out.println(JSONUtil.toJsonStr(moduleList));
|
||||||
|
// List<BusinessOrderVO> orderList = getOrderList(LocalDate.now().withDayOfYear(1).atStartOfDay(), LocalDateTime.now());
|
||||||
|
// System.out.println(JSONUtil.toJsonStr(orderList));
|
||||||
|
// List<BusinessModuleUserVO> moduleUserList = getModuleUserList(1000, LocalDate.now().withDayOfYear(1).atStartOfDay(), LocalDateTime.now());
|
||||||
|
// System.out.println(JSONUtil.toJsonStr(moduleUserList));
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class BusinessDataService {
|
public class BusinessDataService {
|
||||||
|
|
||||||
private LocalDateTime INIT_SYNC_TIME = LocalDateTime.of(2025, 1, 1, 0, 0, 0);
|
private final LocalDateTime INIT_SYNC_TIME = LocalDateTime.of(2025, 1, 1, 0, 0, 0);
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessApiService businessApiService;
|
private BusinessApiService businessApiService;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class OrderQueryService {
|
|||||||
.select("distinct user_id")
|
.select("distinct user_id")
|
||||||
.eq(saleUserId != null && saleUserId != 0, "sale_user_id", saleUserId);
|
.eq(saleUserId != null && saleUserId != 0, "sale_user_id", saleUserId);
|
||||||
List<AppOrder> orders = appOrderMapper.selectList(wrapper);
|
List<AppOrder> orders = appOrderMapper.selectList(wrapper);
|
||||||
return orders.stream().map(order -> order.getUserId().toString()).collect(Collectors.toSet());
|
return orders.stream().map(order -> order.getUserId()).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,7 +110,7 @@ public class OrderQueryService {
|
|||||||
.eq("pay_status", IsOrNot.IS.value)
|
.eq("pay_status", IsOrNot.IS.value)
|
||||||
.groupBy("user_name");
|
.groupBy("user_name");
|
||||||
List<AppOrder> orders = appOrderMapper.selectList(wrapper);
|
List<AppOrder> orders = appOrderMapper.selectList(wrapper);
|
||||||
return orders.stream().collect(Collectors.toMap(order -> order.getUserId().toString(), order -> {
|
return orders.stream().collect(Collectors.toMap(order -> order.getUserId(), order -> {
|
||||||
OrderStatCollect orderStatCollect = new OrderStatCollect();
|
OrderStatCollect orderStatCollect = new OrderStatCollect();
|
||||||
orderStatCollect.setOrderAmount(order.getOriginalPrice());
|
orderStatCollect.setOrderAmount(order.getOriginalPrice());
|
||||||
orderStatCollect.setPayAmount(order.getReceivedAmount());
|
orderStatCollect.setPayAmount(order.getReceivedAmount());
|
||||||
@ -251,7 +251,7 @@ public class OrderQueryService {
|
|||||||
.isNotNull(IsOrNot.IS.value.equals(payStatus), AppOrder::getReceivedAmount);
|
.isNotNull(IsOrNot.IS.value.equals(payStatus), AppOrder::getReceivedAmount);
|
||||||
List<AppOrder> orderList = appOrderMapper.selectList(wrapper);
|
List<AppOrder> orderList = appOrderMapper.selectList(wrapper);
|
||||||
return orderList.stream()
|
return orderList.stream()
|
||||||
.collect(Collectors.groupingBy(order -> order.getUserId().toString(),
|
.collect(Collectors.groupingBy(order -> order.getUserId(),
|
||||||
Collectors.mapping(AppOrder::getProductName, Collectors.toList())));
|
Collectors.mapping(AppOrder::getProductName, Collectors.toList())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -105,4 +106,9 @@ public class HazelcastConfiguration {
|
|||||||
instance.getMap(CacheKey.GROUP_ONLINE_USER).addIndex(groupIndexConfig);
|
instance.getMap(CacheKey.GROUP_ONLINE_USER).addIndex(groupIndexConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
public void destroy() {
|
||||||
|
hazelcastInstance().shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class Save extends AbstractMethod {
|
public class Save extends AbstractMethod {
|
||||||
|
|
||||||
public static String saveSql = "<script>\nINSERT INTO %s %s VALUES %s ON DUPLICATE KEY UPDATE %s\n</script>";
|
public static final String saveSql = "<script>\nINSERT INTO %s %s VALUES %s ON DUPLICATE KEY UPDATE %s\n</script>";
|
||||||
|
|
||||||
public static final String methodName = "save";
|
public static final String methodName = "save";
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public enum ClientType {
|
|||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
private ClientType(int value) {
|
ClientType(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ public enum ClientType {
|
|||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.name() + ":" + this.value;
|
return this.name() + ":" + this.value;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class ScheduleLog implements Serializable {
|
|||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ScheduleLog success(int id, String ext) {
|
public static ScheduleLog success(Integer id, String ext) {
|
||||||
ScheduleLog log = new ScheduleLog();
|
ScheduleLog log = new ScheduleLog();
|
||||||
log.setId(id);
|
log.setId(id);
|
||||||
log.setEndTime(LocalDateTime.now());
|
log.setEndTime(LocalDateTime.now());
|
||||||
@ -99,7 +99,7 @@ public class ScheduleLog implements Serializable {
|
|||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ScheduleLog error(int id, String error) {
|
public static ScheduleLog error(Integer id, String error) {
|
||||||
ScheduleLog log = new ScheduleLog();
|
ScheduleLog log = new ScheduleLog();
|
||||||
log.setId(id);
|
log.setId(id);
|
||||||
log.setEndTime(LocalDateTime.now());
|
log.setEndTime(LocalDateTime.now());
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import org.springframework.messaging.support.ChannelInterceptor;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -45,7 +46,7 @@ public class WebSocketAuthChannelInterceptor implements ChannelInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
|
public void postSend(@NotNull Message<?> message, @NotNull MessageChannel channel, boolean sent) {
|
||||||
StompHeaderAccessor header = StompHeaderAccessor.wrap(message);
|
StompHeaderAccessor header = StompHeaderAccessor.wrap(message);
|
||||||
if (!isValidHeader(header)) {
|
if (!isValidHeader(header)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public class WebSocketAuthHandler {
|
|||||||
@Resource
|
@Resource
|
||||||
private AuthFilter authFilter;
|
private AuthFilter authFilter;
|
||||||
|
|
||||||
private Set<Integer> VALID_PRODUCT_TYPES = ImmutableSet.of(ProductType.VIDEO_SINGLE.value, ProductType.GROUP.value);
|
private final Set<Integer> VALID_PRODUCT_TYPES = ImmutableSet.of(ProductType.VIDEO_SINGLE.value, ProductType.GROUP.value);
|
||||||
|
|
||||||
public Message<?> handleConnect(Message<?> message, StompHeaderAccessor header) {
|
public Message<?> handleConnect(Message<?> message, StompHeaderAccessor header) {
|
||||||
Map<String, Object> attributes = header.getSessionAttributes();
|
Map<String, Object> attributes = header.getSessionAttributes();
|
||||||
@ -43,7 +43,7 @@ public class WebSocketAuthHandler {
|
|||||||
}
|
}
|
||||||
Integer productId = getInteger(header, "productId");
|
Integer productId = getInteger(header, "productId");
|
||||||
if (productId == null) {
|
if (productId == null) {
|
||||||
throw new BizException(ResponseStatus.PARM_ERROR, "产品ID错误" + productId);
|
throw new BizException(ResponseStatus.PARM_ERROR, "产品ID错误");
|
||||||
}
|
}
|
||||||
attributes.put("userId", userId);
|
attributes.put("userId", userId);
|
||||||
attributes.put("sessionId", sessionId);
|
attributes.put("sessionId", sessionId);
|
||||||
|
|||||||
@ -94,48 +94,31 @@ public enum ResponseStatus {
|
|||||||
BUILT_IN_CAN_NOT_MODIFY(4018, "内置角色不可修改或删除"),
|
BUILT_IN_CAN_NOT_MODIFY(4018, "内置角色不可修改或删除"),
|
||||||
VIEW_COLUMN_UPDATE_ERROR(4019, "该栏目已被观点、观点包使用,不得隐藏"),
|
VIEW_COLUMN_UPDATE_ERROR(4019, "该栏目已被观点、观点包使用,不得隐藏"),
|
||||||
COURSE_COLUMN_UPDATE_ERROR(4020, "该栏目已被课程、课程包使用,不得隐藏"),
|
COURSE_COLUMN_UPDATE_ERROR(4020, "该栏目已被课程、课程包使用,不得隐藏"),
|
||||||
|
|
||||||
TRANSACTION_NOT_COMPLETED(4034, "该标的已有持仓,请清仓后再调入"),
|
TRANSACTION_NOT_COMPLETED(4034, "该标的已有持仓,请清仓后再调入"),
|
||||||
|
|
||||||
TAG_IS_USING_ERROR(4035, "该标签已被使用,无法下架/删除"),
|
TAG_IS_USING_ERROR(4035, "该标签已被使用,无法下架/删除"),
|
||||||
|
|
||||||
STRATEGY_NAME_EXIST_ERROR(4036, "定价策略名称重复"),
|
STRATEGY_NAME_EXIST_ERROR(4036, "定价策略名称重复"),
|
||||||
|
|
||||||
PACKAGE_SUB_PRODUCT_EXIST_ERROR(4037, "加入套餐的产品,不允许下架,请先下架套餐产品"),
|
PACKAGE_SUB_PRODUCT_EXIST_ERROR(4037, "加入套餐的产品,不允许下架,请先下架套餐产品"),
|
||||||
|
|
||||||
VIEW_NOT_SOLD_OUT(4038, "观点在观点包中需先下架观点包"),
|
VIEW_NOT_SOLD_OUT(4038, "观点在观点包中需先下架观点包"),
|
||||||
|
|
||||||
BE_USED_NOT_MODIFY(4039, "被引用角色不可删除"),
|
BE_USED_NOT_MODIFY(4039, "被引用角色不可删除"),
|
||||||
|
|
||||||
SIM_ACCOUNT_NOT_REGISTERED_ERROR(4040, "未注册模拟交易帐号,禁止下单或撤单"),
|
SIM_ACCOUNT_NOT_REGISTERED_ERROR(4040, "未注册模拟交易帐号,禁止下单或撤单"),
|
||||||
ILLEGAL_OPERATION(4041, "非法操作"),
|
ILLEGAL_OPERATION(4041, "非法操作"),
|
||||||
TY_NOT_OPEN_ERROR(4042, "全局提拥支付未开启,不允许提交"),
|
TY_NOT_OPEN_ERROR(4042, "全局提拥支付未开启,不允许提交"),
|
||||||
TY_DEPT_NOT_OPEN_ERROR(4043, "营业部提拥支付未开启,不允许提交"),
|
TY_DEPT_NOT_OPEN_ERROR(4043, "营业部提拥支付未开启,不允许提交"),
|
||||||
|
|
||||||
COURSE_IS_IN_PACKAGE(4017, "课程已在其他课程包中"),
|
COURSE_IS_IN_PACKAGE(4017, "课程已在其他课程包中"),
|
||||||
COURSE_NOT_SOLD_OUT(4038, "课程在课程包中需先下架课程包"),
|
COURSE_NOT_SOLD_OUT(4038, "课程在课程包中需先下架课程包"),
|
||||||
COURSE_PACKAGE_NAME_EXIST(6010, "课程包名称已存在"),
|
COURSE_PACKAGE_NAME_EXIST(6010, "课程包名称已存在"),
|
||||||
|
|
||||||
AUDIT_LEFT_PRODUCT_ERROR(4055, "不能审核自己或者自己团队创建的产品"),
|
AUDIT_LEFT_PRODUCT_ERROR(4055, "不能审核自己或者自己团队创建的产品"),
|
||||||
|
|
||||||
DATA_DELETED_ERROR(4056, "数据已删除,禁止操作"),
|
DATA_DELETED_ERROR(4056, "数据已删除,禁止操作"),
|
||||||
|
|
||||||
REMOVE_BLACK_USER_ERROR(4057, "非禁言用户,无须解除禁言"),
|
REMOVE_BLACK_USER_ERROR(4057, "非禁言用户,无须解除禁言"),
|
||||||
|
|
||||||
COMMENT_BLACK_USER_ERROR(4058, "禁言用户,禁止发言"),
|
COMMENT_BLACK_USER_ERROR(4058, "禁言用户,禁止发言"),
|
||||||
|
|
||||||
DECRYPT_ERROR(4059, "AES解密失败"),
|
DECRYPT_ERROR(4059, "AES解密失败"),
|
||||||
|
|
||||||
SECRET_ACQUIRE_FAIL(4060, "获取加密推送地址失败"),
|
SECRET_ACQUIRE_FAIL(4060, "获取加密推送地址失败"),
|
||||||
MESSAGE_PERMISSION_ERROR(4061, "消息权限错误"),
|
MESSAGE_PERMISSION_ERROR(4061, "消息权限错误"),
|
||||||
|
|
||||||
/*********************内部系统***********************/
|
/*********************内部系统***********************/
|
||||||
SYS_BUSY(5000, "系统忙,请稍后重试"),
|
SYS_BUSY(5000, "系统忙,请稍后重试"),
|
||||||
|
|
||||||
MICRO_APP_BUSY(5001, "服务忙,请稍后重试"),
|
MICRO_APP_BUSY(5001, "服务忙,请稍后重试"),
|
||||||
|
|
||||||
HYSTRIX_FALLBACK(5002, "接口调用失败,被熔断,请稍后重试"),
|
HYSTRIX_FALLBACK(5002, "接口调用失败,被熔断,请稍后重试"),
|
||||||
|
|
||||||
UNSUPPORTED_ENCODING(5003, "不支持的编码异常"),
|
UNSUPPORTED_ENCODING(5003, "不支持的编码异常"),
|
||||||
DB_SAVE_ERROR(5004, "数据库保存异常"),
|
DB_SAVE_ERROR(5004, "数据库保存异常"),
|
||||||
MESSAGE_SEND_ERROR(5005, "短信发送失败,请稍后重试"),
|
MESSAGE_SEND_ERROR(5005, "短信发送失败,请稍后重试"),
|
||||||
@ -151,11 +134,8 @@ public enum ResponseStatus {
|
|||||||
STAFF_NO_EXIST(6009, "登录账号或者UP号已存在"),
|
STAFF_NO_EXIST(6009, "登录账号或者UP号已存在"),
|
||||||
VIEW_PACKAGE_NAME_EXIST(6010, "观点包名称已存在"),
|
VIEW_PACKAGE_NAME_EXIST(6010, "观点包名称已存在"),
|
||||||
DEPT_EXIST(6011, "用户部门已存在"),
|
DEPT_EXIST(6011, "用户部门已存在"),
|
||||||
|
|
||||||
COUNTER_ERROR(6011, "柜台接口异常"),
|
COUNTER_ERROR(6011, "柜台接口异常"),
|
||||||
|
|
||||||
TENCENT_ERROR(6012, "腾讯云任务流接口异常"),
|
TENCENT_ERROR(6012, "腾讯云任务流接口异常"),
|
||||||
|
|
||||||
NOT_PRODUCT_AUTH(6013, "无产品权限"),
|
NOT_PRODUCT_AUTH(6013, "无产品权限"),
|
||||||
TOKEN_DATA_ERROR(6014, "token错误,请重新登录"),
|
TOKEN_DATA_ERROR(6014, "token错误,请重新登录"),
|
||||||
;
|
;
|
||||||
|
|||||||
@ -15,16 +15,16 @@ public class IPUtil {
|
|||||||
*/
|
*/
|
||||||
public static String getIpAddr(HttpServletRequest request) {
|
public static String getIpAddr(HttpServletRequest request) {
|
||||||
String ip = request.getHeader("x-forwarded-for");
|
String ip = request.getHeader("x-forwarded-for");
|
||||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||||
ip = request.getHeader("X-Real-IP");
|
ip = request.getHeader("X-Real-IP");
|
||||||
}
|
}
|
||||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||||
ip = request.getHeader("Proxy-Client-IP");
|
ip = request.getHeader("Proxy-Client-IP");
|
||||||
}
|
}
|
||||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||||
}
|
}
|
||||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
|
||||||
ip = request.getRemoteAddr();
|
ip = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
if ("0:0:0:0:0:0:0:1".equals(ip)) {
|
if ("0:0:0:0:0:0:0:1".equals(ip)) {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
|
|||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.KeyFactory;
|
import java.security.KeyFactory;
|
||||||
import java.security.PrivateKey;
|
import java.security.PrivateKey;
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
@ -106,7 +107,7 @@ public class RsaUtil {
|
|||||||
offSet = i * MAX_DECRYPT_BLOCK;
|
offSet = i * MAX_DECRYPT_BLOCK;
|
||||||
}
|
}
|
||||||
out.close();
|
out.close();
|
||||||
return out.toString("UTF-8");
|
return out.toString(StandardCharsets.UTF_8);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
LoggerUtil.info("RsaUtil.priKeyDecryption异常:" + ExceptionUtils.getStackTrace(exception));
|
LoggerUtil.info("RsaUtil.priKeyDecryption异常:" + ExceptionUtils.getStackTrace(exception));
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.syzb.common.util;
|
package com.syzb.common.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||||
|
import com.syzb.common.util.logger.LoggerUtil;
|
||||||
import org.springframework.boot.web.context.WebServerApplicationContext;
|
import org.springframework.boot.web.context.WebServerApplicationContext;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -19,7 +21,7 @@ public class WebServerInfo {
|
|||||||
InetAddress inetAddress = InetAddress.getLocalHost();
|
InetAddress inetAddress = InetAddress.getLocalHost();
|
||||||
return inetAddress.getHostAddress();
|
return inetAddress.getHostAddress();
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
e.printStackTrace();
|
LoggerUtil.error(ExceptionUtil.stacktraceToString(e));
|
||||||
}
|
}
|
||||||
return "0.0.0.0";
|
return "0.0.0.0";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class LoggerAgent {
|
public class LoggerAgent {
|
||||||
|
|
||||||
private Logger logger;
|
private final Logger logger;
|
||||||
|
|
||||||
private LoggerAgent(String name) {
|
private LoggerAgent(String name) {
|
||||||
logger = LoggerFactory.getLogger(name);
|
logger = LoggerFactory.getLogger(name);
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
package com.syzb.course.controller.pc;
|
|
||||||
|
|
||||||
import com.syzb.common.query.OnlyIdQuery;
|
|
||||||
import com.syzb.common.result.CommonResult;
|
|
||||||
import com.syzb.common.vo.FrontUserVO;
|
|
||||||
import com.syzb.course.service.CoursePcService;
|
|
||||||
import com.syzb.course.vo.CourseContentVO;
|
|
||||||
import com.syzb.course.vo.CourseVO;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Api(tags = "课程pc接口")
|
|
||||||
@RestController
|
|
||||||
public class PcCourseController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CoursePcService coursePcService;
|
|
||||||
|
|
||||||
@ApiOperation("pc查询课程详情")
|
|
||||||
@PostMapping("/pc/course/info/get")
|
|
||||||
public CommonResult<CourseVO> get(@Validated @RequestBody @ApiParam(required = true) OnlyIdQuery query,
|
|
||||||
@RequestAttribute(value = "frontUser", required = false) FrontUserVO frontUserVO) {
|
|
||||||
CourseVO vo = coursePcService.getForPc(query, frontUserVO);
|
|
||||||
return CommonResult.success(vo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("pc查询课程内容列表")
|
|
||||||
@PostMapping("/pc/course/content/list")
|
|
||||||
public CommonResult<List<CourseContentVO>> listContent(@Validated @RequestBody @ApiParam(required = true) OnlyIdQuery query,
|
|
||||||
@RequestAttribute(value = "frontUser", required = false) FrontUserVO frontUserVO) {
|
|
||||||
List<CourseContentVO> list = coursePcService.listContentForPc(query, frontUserVO);
|
|
||||||
return CommonResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("pc更多系列课查询列表")
|
|
||||||
@PostMapping("/pc/course/info/list")
|
|
||||||
public CommonResult<List<CourseVO>> list(@Validated @RequestBody @ApiParam(required = true) OnlyIdQuery query,
|
|
||||||
@RequestAttribute(value = "frontUser", required = false) FrontUserVO frontUserVO) {
|
|
||||||
List<CourseVO> list = coursePcService.listForPc(query, frontUserVO);
|
|
||||||
return CommonResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
package com.syzb.course.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.hazelcast.map.IMap;
|
|
||||||
import com.syzb.common.config.cache.CacheKey;
|
|
||||||
import com.syzb.common.constant.IsDisplay;
|
|
||||||
import com.syzb.common.query.OnlyIdQuery;
|
|
||||||
import com.syzb.common.service.CacheService;
|
|
||||||
import com.syzb.common.vo.FrontUserVO;
|
|
||||||
import com.syzb.course.constant.CourseStatus;
|
|
||||||
import com.syzb.course.entity.Course;
|
|
||||||
import com.syzb.course.mapper.CourseMapper;
|
|
||||||
import com.syzb.course.vo.CourseContentVO;
|
|
||||||
import com.syzb.course.vo.CourseVO;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
// 课程PC端Service
|
|
||||||
@Service
|
|
||||||
public class CoursePcService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseMapper courseMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CourseService courseService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CacheService cacheService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IMap<String, Object> courseCache;
|
|
||||||
|
|
||||||
@Value("${pc.courseRecommendSize}")
|
|
||||||
private Integer courseRecommendSize;
|
|
||||||
|
|
||||||
@Value("${pc.url.liveUrl}")
|
|
||||||
private String liveUrl;
|
|
||||||
|
|
||||||
public CourseVO getForPc(OnlyIdQuery query, FrontUserVO frontUserVO) {
|
|
||||||
return courseService.getForApp(query, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CourseContentVO> listContentForPc(OnlyIdQuery query, FrontUserVO frontUserVO) {
|
|
||||||
List<CourseContentVO> list = courseService.listContentForApp(query, null);
|
|
||||||
return list.stream().filter(courseContentVO -> courseContentVO.getVideo() != null)
|
|
||||||
.peek(content -> content.setPcUrl(String.format(liveUrl, content.getContentId(), content.getCourseId())))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CourseVO> listForPc(OnlyIdQuery query, FrontUserVO frontUserVO) {
|
|
||||||
Integer excludeId = query.getId();
|
|
||||||
List<Integer> ids = cacheService.get(courseCache, CacheKey.CourseKey.PC_COURSE_LIST + query.getId(), () -> {
|
|
||||||
LambdaQueryWrapper<Course> wrapper = Wrappers.<Course>lambdaQuery()
|
|
||||||
.select(Course::getId)
|
|
||||||
.eq(Course::getStatus, CourseStatus.AUDITED.value)
|
|
||||||
.eq(Course::getIsDisplay, IsDisplay.YES.value)
|
|
||||||
.orderByDesc(Course::getIsRecommend, Course::getAuditTime)
|
|
||||||
.last("limit " + (courseRecommendSize + 1));
|
|
||||||
List<Course> list = courseMapper.selectList(wrapper);
|
|
||||||
List<Integer> idList = list.stream().map(Course::getId).collect(Collectors.toList());
|
|
||||||
idList.remove(excludeId);
|
|
||||||
if (idList.size() > courseRecommendSize) {
|
|
||||||
idList.remove(idList.size() - 1);
|
|
||||||
}
|
|
||||||
return idList;
|
|
||||||
});
|
|
||||||
return ids.stream().map(id -> getForPc(new OnlyIdQuery(id), null)).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,166 +0,0 @@
|
|||||||
package com.syzb.crm.query;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ProductQuery {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单产品id", name = "authorityId")
|
|
||||||
private Integer authorityId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "产品id", name = "productId")
|
|
||||||
private Integer productId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "产品类型:1观点包 2单篇观点 3视频 5交易圈 6图文直播间 7组合 8锦囊", name = "productType")
|
|
||||||
private Integer productType;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "产品名称", name = "productName")
|
|
||||||
private String productName;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "价格策略id,为null代表免费但需要签约的产品", name = "strategyId")
|
|
||||||
private Integer strategyId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "风险等级:1低风险 2中低风险 3中风险 4中高风险 5高风险", name = "riskLevel")
|
|
||||||
private Integer riskLevel;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "投顾id", name = "advisorId")
|
|
||||||
private Integer advisorId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "投顾名称", name = "tgName")
|
|
||||||
private String tgName;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "投顾营业部id", name = "orgId")
|
|
||||||
private String orgId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "子产品权限号,只有套餐产品需要传", name = "authIds")
|
|
||||||
private List<String> authIds;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否走适当性:0否 1是", name = "iAppropriateness")
|
|
||||||
private Integer iAppropriateness = 1;
|
|
||||||
|
|
||||||
@ApiModelProperty("柜台整体提拥费率编码")
|
|
||||||
private String supportCode;
|
|
||||||
|
|
||||||
@ApiModelProperty("柜台整体提拥费率")
|
|
||||||
private BigDecimal supportRate;
|
|
||||||
|
|
||||||
@ApiModelProperty("签约门槛(元)")
|
|
||||||
private BigDecimal signThreshold;
|
|
||||||
|
|
||||||
public ProductQuery() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProductId() {
|
|
||||||
return productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductId(Integer productId) {
|
|
||||||
this.productId = productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProductType() {
|
|
||||||
return productType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductType(Integer productType) {
|
|
||||||
this.productType = productType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProductName() {
|
|
||||||
return productName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductName(String productName) {
|
|
||||||
this.productName = productName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getStrategyId() {
|
|
||||||
return strategyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStrategyId(Integer strategyId) {
|
|
||||||
this.strategyId = strategyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getRiskLevel() {
|
|
||||||
return riskLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRiskLevel(Integer riskLevel) {
|
|
||||||
this.riskLevel = riskLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAdvisorId() {
|
|
||||||
return advisorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdvisorId(Integer advisorId) {
|
|
||||||
this.advisorId = advisorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTgName() {
|
|
||||||
return tgName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTgName(String tgName) {
|
|
||||||
this.tgName = tgName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrgId() {
|
|
||||||
return orgId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrgId(String orgId) {
|
|
||||||
this.orgId = orgId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAuthIds() {
|
|
||||||
return authIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthIds(List<String> authIds) {
|
|
||||||
this.authIds = authIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getiAppropriateness() {
|
|
||||||
return iAppropriateness;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setiAppropriateness(Integer iAppropriateness) {
|
|
||||||
this.iAppropriateness = iAppropriateness;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSupportCode() {
|
|
||||||
return supportCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportCode(String supportCode) {
|
|
||||||
this.supportCode = supportCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getSupportRate() {
|
|
||||||
return supportRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportRate(BigDecimal supportRate) {
|
|
||||||
this.supportRate = supportRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getSignThreshold() {
|
|
||||||
return signThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSignThreshold(BigDecimal signThreshold) {
|
|
||||||
this.signThreshold = signThreshold;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAuthorityId() {
|
|
||||||
return authorityId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthorityId(Integer authorityId) {
|
|
||||||
this.authorityId = authorityId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
package com.syzb.crm.service;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ProductService {
|
|
||||||
|
|
||||||
public List<Object> getLiveCouponStatByMin() {
|
|
||||||
// 优惠券
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -4,7 +4,7 @@ package com.syzb.group.constant;
|
|||||||
public enum GroupMessageChannel {
|
public enum GroupMessageChannel {
|
||||||
APP(1, "APP"),
|
APP(1, "APP"),
|
||||||
ADMIN(2, "ADMIN"),
|
ADMIN(2, "ADMIN"),
|
||||||
ALL(3, "ALL");
|
ALL(3, "ALL"),
|
||||||
;
|
;
|
||||||
|
|
||||||
public final Integer value;
|
public final Integer value;
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package com.syzb.group.entity;
|
package com.syzb.group.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.syzb.group.mapper;
|
|||||||
|
|
||||||
import com.syzb.common.mapper.EasyBaseMapper;
|
import com.syzb.common.mapper.EasyBaseMapper;
|
||||||
import com.syzb.group.entity.GroupUserCollect;
|
import com.syzb.group.entity.GroupUserCollect;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.syzb.common.vo.BackendUserVO;
|
import com.syzb.common.vo.BackendUserVO;
|
||||||
import com.syzb.group.constant.GroupInfoStatus;
|
import com.syzb.group.constant.GroupInfoStatus;
|
||||||
import com.syzb.group.entity.GroupInfo;
|
import com.syzb.group.entity.GroupInfo;
|
||||||
import com.syzb.video.constant.VideoLimitType;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.syzb.group.schedule;
|
|||||||
|
|
||||||
import com.syzb.common.config.cache.CacheKey;
|
import com.syzb.common.config.cache.CacheKey;
|
||||||
import com.syzb.common.service.CacheService;
|
import com.syzb.common.service.CacheService;
|
||||||
import com.syzb.group.mapper.GroupMessageMapper;
|
|
||||||
import com.syzb.group.service.admin.AdminGroupCollectService;
|
import com.syzb.group.service.admin.AdminGroupCollectService;
|
||||||
import com.syzb.group.service.admin.AdminGroupMessageService;
|
import com.syzb.group.service.admin.AdminGroupMessageService;
|
||||||
import com.syzb.group.service.common.GroupCommonService;
|
import com.syzb.group.service.common.GroupCommonService;
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.hazelcast.map.IMap;
|
import com.hazelcast.map.IMap;
|
||||||
import com.syzb.business.entity.ModuleUser;
|
import com.syzb.business.entity.ModuleUser;
|
||||||
import com.syzb.business.mapper.ModuleUserMapper;
|
import com.syzb.business.mapper.ModuleUserMapper;
|
||||||
import com.syzb.common.config.cache.CacheKey;
|
|
||||||
import com.syzb.common.constant.IsOrNot;
|
import com.syzb.common.constant.IsOrNot;
|
||||||
import com.syzb.common.constant.ProductType;
|
import com.syzb.common.constant.ProductType;
|
||||||
import com.syzb.common.query.OnlyIdQuery;
|
import com.syzb.common.query.OnlyIdQuery;
|
||||||
@ -34,7 +33,6 @@ import com.syzb.rbac.entity.WxUser;
|
|||||||
import com.syzb.rbac.mapper.WxUserMapper;
|
import com.syzb.rbac.mapper.WxUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -325,8 +323,7 @@ public class AdminGroupCollectService {
|
|||||||
if (CollUtil.isEmpty(groups)) {
|
if (CollUtil.isEmpty(groups)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<Integer> groupIds = groups.stream().map(GroupInfo::getId).collect(Collectors.toList());
|
return groups.stream().map(GroupInfo::getId).collect(Collectors.toList());
|
||||||
return groupIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class GroupCacheService {
|
|||||||
LambdaQueryWrapper<GroupMessage> wrapper = buildWrapper(groupId, userId, type);
|
LambdaQueryWrapper<GroupMessage> wrapper = buildWrapper(groupId, userId, type);
|
||||||
List<DateIdVO> dateIdList = groupMessageMapper.selectDateIdList(wrapper);
|
List<DateIdVO> dateIdList = groupMessageMapper.selectDateIdList(wrapper);
|
||||||
TreeMap<LocalDate, Integer> map = new TreeMap<>();
|
TreeMap<LocalDate, Integer> map = new TreeMap<>();
|
||||||
dateIdList.stream().forEach(vo -> map.put(vo.getDate(), vo.getId()));
|
dateIdList.forEach(vo -> map.put(vo.getDate(), vo.getId()));
|
||||||
return map;
|
return map;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,23 +4,17 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.hazelcast.core.HazelcastInstance;
|
|
||||||
import com.hazelcast.map.IMap;
|
import com.hazelcast.map.IMap;
|
||||||
import com.syzb.business.entity.ModuleUser;
|
import com.syzb.business.entity.ModuleUser;
|
||||||
import com.syzb.business.mapper.ModuleUserMapper;
|
import com.syzb.business.mapper.ModuleUserMapper;
|
||||||
import com.syzb.common.config.cache.CacheKey;
|
|
||||||
import com.syzb.common.constant.IsOrNot;
|
import com.syzb.common.constant.IsOrNot;
|
||||||
import com.syzb.common.entity.OnlineUser;
|
import com.syzb.common.entity.OnlineUser;
|
||||||
import com.syzb.common.util.logger.LoggerUtil;
|
import com.syzb.common.util.logger.LoggerUtil;
|
||||||
import com.syzb.common.vo.IdCountVO;
|
import com.syzb.group.entity.GroupInfo;
|
||||||
import com.syzb.group.constant.GroupInteractiveType;
|
import com.syzb.group.entity.GroupUserFlow;
|
||||||
import com.syzb.group.constant.GroupMessageUserType;
|
import com.syzb.group.mapper.GroupInfoMapper;
|
||||||
import com.syzb.group.entity.*;
|
import com.syzb.group.mapper.GroupUserFlowMapper;
|
||||||
import com.syzb.group.mapper.*;
|
|
||||||
import com.syzb.group.vo.message.GroupMessageReadVO;
|
|
||||||
import com.syzb.group.vo.message.GroupMessageVO;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|||||||
@ -349,6 +349,10 @@ public class AuthService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(CodecUtil.md5("ad123456"));
|
||||||
|
}
|
||||||
|
|
||||||
private AuthVO getDeptAuthVO(Integer loginId, String deptId, boolean isLogin) {
|
private AuthVO getDeptAuthVO(Integer loginId, String deptId, boolean isLogin) {
|
||||||
// 校验用户
|
// 校验用户
|
||||||
UserLogin userLogin = userLoginMapper.selectById(loginId);
|
UserLogin userLogin = userLoginMapper.selectById(loginId);
|
||||||
|
|||||||
@ -17,7 +17,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Main.class, args);
|
SpringApplication app = new SpringApplication(Main.class);
|
||||||
|
app.setRegisterShutdownHook(true);
|
||||||
|
app.run(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -268,7 +268,7 @@ public class PushLiveImgAuditQuery {
|
|||||||
Details = details;
|
Details = details;
|
||||||
}
|
}
|
||||||
|
|
||||||
class OcrTextDetail {
|
static class OcrTextDetail {
|
||||||
/**
|
/**
|
||||||
* 返回 OCR 识别出的文本内容(OCR 文本识别上限在5000字节内) 。
|
* 返回 OCR 识别出的文本内容(OCR 文本识别上限在5000字节内) 。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -135,12 +135,10 @@ public class AdminVideoCustomerService {
|
|||||||
return Pager.emptyPager();
|
return Pager.emptyPager();
|
||||||
}
|
}
|
||||||
String existSubSQL = "select 1 from app_order o where o.user_id = video_live_customer.user_id";
|
String existSubSQL = "select 1 from app_order o where o.user_id = video_live_customer.user_id";
|
||||||
if (authSet != null) {
|
if (CollUtil.isEmpty(authSet)) {
|
||||||
if (authSet.isEmpty()) {
|
return Pager.emptyPager();
|
||||||
return Pager.emptyPager();
|
|
||||||
}
|
|
||||||
existSubSQL += " and o.sale_user_id in (" + CollUtil.join(authSet, ",") + ")";
|
|
||||||
}
|
}
|
||||||
|
existSubSQL += " and o.sale_user_id in (" + CollUtil.join(authSet, ",") + ")";
|
||||||
LambdaQueryWrapper<VideoLiveCustomer> wrapper = Wrappers.<VideoLiveCustomer>lambdaQuery()
|
LambdaQueryWrapper<VideoLiveCustomer> wrapper = Wrappers.<VideoLiveCustomer>lambdaQuery()
|
||||||
.like(StrUtil.isNotBlank(query.getNickName()), VideoLiveCustomer::getUserName, query.getNickName())
|
.like(StrUtil.isNotBlank(query.getNickName()), VideoLiveCustomer::getUserName, query.getNickName())
|
||||||
.eq(StrUtil.isNotBlank(query.getComId()), VideoLiveCustomer::getComId, query.getComId())
|
.eq(StrUtil.isNotBlank(query.getComId()), VideoLiveCustomer::getComId, query.getComId())
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import com.syzb.common.result.Pager;
|
|||||||
import com.syzb.common.result.ResponseStatus;
|
import com.syzb.common.result.ResponseStatus;
|
||||||
import com.syzb.common.service.CacheService;
|
import com.syzb.common.service.CacheService;
|
||||||
import com.syzb.common.vo.BackendUserVO;
|
import com.syzb.common.vo.BackendUserVO;
|
||||||
import com.syzb.crm.service.ProductService;
|
|
||||||
import com.syzb.rbac.entity.Dept;
|
import com.syzb.rbac.entity.Dept;
|
||||||
import com.syzb.rbac.entity.UserDept;
|
import com.syzb.rbac.entity.UserDept;
|
||||||
import com.syzb.rbac.service.AuthService;
|
import com.syzb.rbac.service.AuthService;
|
||||||
@ -67,9 +66,6 @@ public class AdminVideoStatisticService {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ProductService productService;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private VideoCacheService videoCacheService;
|
private VideoCacheService videoCacheService;
|
||||||
|
|
||||||
|
|||||||
10
src/main/resources/application-dev.yaml
Normal file
10
src/main/resources/application-dev.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: dev
|
||||||
|
# 引入开发环境配置文件
|
||||||
|
import:
|
||||||
|
- optional:classpath:/dev/advisorServer.yaml
|
||||||
|
- optional:classpath:/dev/application.yaml
|
||||||
|
- optional:classpath:/dev/tencentConfig.yaml
|
||||||
|
- optional:classpath:/dev/business.yaml
|
||||||
10
src/main/resources/application-prod-admin.yaml
Normal file
10
src/main/resources/application-prod-admin.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: prod-admin
|
||||||
|
import:
|
||||||
|
- optional:classpath:/prod/advisorServer.yaml
|
||||||
|
- optional:classpath:/prod/application.yaml
|
||||||
|
- optional:classpath:/prod/tencentConfig.yaml
|
||||||
|
- optional:classpath:/prod/business.yaml
|
||||||
|
- optional:classpath:/prod/admin.yaml
|
||||||
9
src/main/resources/application-prod-customer.yaml
Normal file
9
src/main/resources/application-prod-customer.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: prod-customer
|
||||||
|
import:
|
||||||
|
- optional:classpath:/prod/advisorServer.yaml
|
||||||
|
- optional:classpath:/prod/application.yaml
|
||||||
|
- optional:classpath:/prod/tencentConfig.yaml
|
||||||
|
- optional:classpath:/prod/business.yaml
|
||||||
10
src/main/resources/application-test.yaml
Normal file
10
src/main/resources/application-test.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: test
|
||||||
|
# 引入开发环境配置文件
|
||||||
|
import:
|
||||||
|
- optional:classpath:/dev/advisorServer.yaml
|
||||||
|
- optional:classpath:/dev/application.yaml
|
||||||
|
- optional:classpath:/dev/tencentConfig.yaml
|
||||||
|
- optional:classpath:/dev/business.yaml
|
||||||
@ -1,8 +1,3 @@
|
|||||||
spring:
|
spring:
|
||||||
config:
|
|
||||||
import:
|
|
||||||
- optional:classpath:/conf/application.yaml
|
|
||||||
- optional:classpath:/conf/advisorServer.yaml
|
|
||||||
- optional:classpath:/conf/tencentConfig.yaml
|
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev # 默认使用开发环境配置
|
||||||
@ -10,9 +10,6 @@ file:
|
|||||||
domain:
|
domain:
|
||||||
prefix: http://47.96.178.171:8080/
|
prefix: http://47.96.178.171:8080/
|
||||||
resizePrefix: http://47.96.178.171:8080/resize/
|
resizePrefix: http://47.96.178.171:8080/resize/
|
||||||
hazelcast:
|
|
||||||
members: 127.0.0.1:5709 #缓存集群的ip端口号
|
|
||||||
serverPort: 5709 #自己作为缓存服务器监听的端口号
|
|
||||||
scheduledEnable: true
|
scheduledEnable: true
|
||||||
cron:
|
cron:
|
||||||
collectLivingVideo: "20 0/5 * * * ?" #每分钟统计已开始但未结束的视频直播数据
|
collectLivingVideo: "20 0/5 * * * ?" #每分钟统计已开始但未结束的视频直播数据
|
||||||
@ -45,20 +42,8 @@ video:
|
|||||||
finishReadRatio: 0.9 #计算视频完播率(完成人数/总人数)大于等于该值即未完成观看
|
finishReadRatio: 0.9 #计算视频完播率(完成人数/总人数)大于等于该值即未完成观看
|
||||||
websocket:
|
websocket:
|
||||||
brokerHost: ws://47.96.178.171:8080/tgim
|
brokerHost: ws://47.96.178.171:8080/tgim
|
||||||
aes:
|
|
||||||
key: ew0ov3n1xurvhlhl
|
|
||||||
iv: gbb9qknndntteqc1
|
|
||||||
resizeUrl:
|
resizeUrl:
|
||||||
main: http://47.96.178.171:8080/s/
|
main: http://47.96.178.171:8080/s/
|
||||||
original: http://47.96.178.171:8080/h5
|
original: http://47.96.178.171:8080/h5
|
||||||
urlMain: /videoPlay?id=
|
urlMain: /videoPlay?id=
|
||||||
shortVideoUrl: /shotVideoPlay?id=
|
shortVideoUrl: /shotVideoPlay?id=
|
||||||
pc:
|
|
||||||
courseRecommendSize: 5
|
|
||||||
url:
|
|
||||||
liveUrl: http://47.96.178.171:8080/syzbpc/videoDetail?id=%d&courseId=%d
|
|
||||||
app:
|
|
||||||
url:
|
|
||||||
liveUrl: https://47.96.178.171:8080/h5/videoPlay?id=%d
|
|
||||||
advisorListUrl: https://47.96.178.171:8080/h5/videoList?advisorId=%d
|
|
||||||
deptListUrl: https://47.96.178.171:8080/h5/videoList?deptId=%s
|
|
||||||
@ -1,3 +1,6 @@
|
|||||||
|
hazelcast:
|
||||||
|
members: 127.0.0.1:5709 #缓存集群的ip端口号
|
||||||
|
serverPort: 5709 #自己作为缓存服务器监听的端口号
|
||||||
fastdfs:
|
fastdfs:
|
||||||
connect_timeout_in_seconds: 10
|
connect_timeout_in_seconds: 10
|
||||||
network_timeout_in_seconds: 30
|
network_timeout_in_seconds: 30
|
||||||
@ -44,10 +47,13 @@ spring:
|
|||||||
mvc:
|
mvc:
|
||||||
pathmatch:
|
pathmatch:
|
||||||
matching-strategy: ant_path_matcher #Springfox 使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
|
matching-strategy: ant_path_matcher #Springfox 使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
|
||||||
|
lifecycle:
|
||||||
|
timeout-per-shutdown-phase: "10s"
|
||||||
springfox:
|
springfox:
|
||||||
documentation:
|
documentation:
|
||||||
enabled: true #是否开启swagger
|
enabled: true #是否开启swagger
|
||||||
server:
|
server:
|
||||||
|
shutdown: graceful
|
||||||
tomcat:
|
tomcat:
|
||||||
max-connections: 16384
|
max-connections: 16384
|
||||||
accept-count: 1024
|
accept-count: 1024
|
||||||
19
src/main/resources/dev/business.yaml
Normal file
19
src/main/resources/dev/business.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
business:
|
||||||
|
api:
|
||||||
|
host: https://webdzapi.ceniu.sztg.com
|
||||||
|
authorizationDeptId: 16
|
||||||
|
# authorizationDeptId: 33
|
||||||
|
authorizationKey: 56e670eea5ff3a1aebbc02820e908ceb56e670eea5ff3a1aebbc02820e908ceb
|
||||||
|
# authorizationKey: 90804bd6089d950e8804c6d7cad7558a90804bd6089d950e8804c6d7cad7558a
|
||||||
|
timeout: 10000
|
||||||
|
url:
|
||||||
|
loginUrl: /common/loginByUserName
|
||||||
|
getUserUrl: /common/getUserByToken
|
||||||
|
getModuleListUrl: /user/getUserModuleList
|
||||||
|
getOrderListUrl: /order/getAllBatchOrderListByPage
|
||||||
|
getModuleUserListUrl: /order/getUserModuleListByPage
|
||||||
|
ssoCheckToken: /sso/checkToken
|
||||||
|
checkLabelRole: /thirdapi/user/checkLabelRole
|
||||||
|
receiveCouponUrl: /user/coupon/receiveCoupon
|
||||||
|
backend:
|
||||||
|
tokenKey: 281ffabc
|
||||||
@ -1,24 +1,24 @@
|
|||||||
tencent: #腾讯云配置
|
tencent: #腾讯云配置 测试环境
|
||||||
vodEndpoint: vod.tencentcloudapi.com #点播请求域名
|
vodEndpoint: vod.tencentcloudapi.com #点播请求域名
|
||||||
liveEndpoint: live.tencentcloudapi.com #直播请求域名
|
liveEndpoint: live.tencentcloudapi.com #直播请求域名
|
||||||
region: ap-guangzhou #地域参数
|
region: ap-guangzhou #地域参数
|
||||||
secretId: AKID7ADA6wqiZJ9weJ50sfUDADJMWi8WsFc0 #用于标识 API 调用者身份,可以简单类比为用户名
|
secretId: AKIDdBbry19D9uRp23rStAIKQPEtMelgS6ax #用于标识 API 调用者身份,可以简单类比为用户名
|
||||||
secretKey: NuRzRzbJA895BENSbnffVRUi2IYkyETl #用于验证 API 调用者的身份,可以简单类比为密码
|
secretKey: HNKG4vjMzSo02unbCdu20lLn5QFysfIj #用于验证 API 调用者的身份,可以简单类比为密码
|
||||||
appId: 1500031629 #当前账号AppId
|
appId: 1500036562 #当前账号AppId
|
||||||
appName: live #推流路径
|
appName: live #推流路径
|
||||||
pushHost: pushtest.product.com #推流域名
|
pushHost: pushtest.sztg.com #推流域名
|
||||||
pushUrl: rtmp://pushtest.product.com #推流地址
|
pushUrl: rtmp://pushtest.sztg.com #推流地址
|
||||||
pushKey: fe2c8058428ef795eafed81cd1846818 #鉴权Key
|
pushKey: 163b37d858df8a6136f613ebcb067b37 #鉴权Key
|
||||||
liveHost: livevideo.product.com #播流域名
|
liveHost: livetest.sztg.com #播流域名
|
||||||
liveUrl: webrtc://livevideo.product.com #播流地址
|
liveUrl: webrtc://livetest.sztg.com #播流地址
|
||||||
liveKey: "video_dev" #鉴权Key
|
liveKey: "video_dev" #鉴权Key
|
||||||
liveFormat: m3u8 #直播格式
|
liveFormat: m3u8 #直播格式
|
||||||
key: oQHVxPW1xfDSQl3YhlY8 #防盗链Key
|
key: 2wKfFwRB2FNzPJrhMKms #防盗链Key
|
||||||
expireHours: 12 #有效时间,单位小时
|
expireHours: 12 #有效时间,单位小时
|
||||||
callbackKey: video_dev #直播推流、断流、录制回调key,验证回调来源
|
callbackKey: video_dev #直播推流、断流、录制回调key,验证回调来源
|
||||||
taskStream: "普通转码" #自动转码任务流(转自适应码流)
|
taskStream: "普通转码" #自动转码任务流(转自适应码流)
|
||||||
audioVideoType: Transcode #原始流
|
audioVideoType: Transcode #原始流
|
||||||
rawAdaptiveDefinition: 100020 #允许输出的未加密的 转自适应码流模板 ID
|
rawAdaptiveDefinition: 100020 #允许输出的未加密的 转自适应码流模板 ID
|
||||||
playKey: 27sYN83sbR8nUMxtv8ba #播放密钥
|
playKey: ill7YChtUgS2FhcNdNQR #播放密钥
|
||||||
templateId: 1524021
|
templateId: 1563635
|
||||||
downloadDefinition: 100030 #下载转码视频清晰度
|
downloadDefinition: 100030 #下载转码视频清晰度
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<included>
|
<included>
|
||||||
|
|
||||||
<!-- 设置日志文件路径 -->
|
<!-- 设置日志文件路径 -->
|
||||||
<property name="LOG_PATH" value="/root/logs"/>
|
<property name="LOG_PATH" value="/data/logs/advisor"/>
|
||||||
|
|
||||||
<!-- 定义多个 appender,根据日志记录器的名称来决定输出的文件 -->
|
<!-- 定义多个 appender,根据日志记录器的名称来决定输出的文件 -->
|
||||||
<appender name="default" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="default" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
|||||||
@ -5,10 +5,18 @@
|
|||||||
|
|
||||||
<!-- 根据环境加载不同的配置 -->
|
<!-- 根据环境加载不同的配置 -->
|
||||||
<springProfile name="dev">
|
<springProfile name="dev">
|
||||||
<include resource="logback-console.xml"/>
|
<include resource="logback-dev.xml"/>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
<springProfile name="test,prod">
|
<springProfile name="test">
|
||||||
|
<include resource="logback-tst.xml"/>
|
||||||
|
</springProfile>
|
||||||
|
|
||||||
|
<springProfile name="prod-admin">
|
||||||
|
<include resource="logback-prod.xml"/>
|
||||||
|
</springProfile>
|
||||||
|
|
||||||
|
<springProfile name="prod-customer">
|
||||||
<include resource="logback-prod.xml"/>
|
<include resource="logback-prod.xml"/>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
</configuration>
|
</configuration>
|
||||||
116
src/main/resources/logback-tst.xml
Normal file
116
src/main/resources/logback-tst.xml
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
|
||||||
|
<!-- 设置日志文件路径 -->
|
||||||
|
<property name="LOG_PATH" value="/root/logs"/>
|
||||||
|
|
||||||
|
<!-- 定义多个 appender,根据日志记录器的名称来决定输出的文件 -->
|
||||||
|
<appender name="default" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 定义多个 appender,根据日志记录器的名称来决定输出的文件 -->
|
||||||
|
<appender name="video" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-video-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="data" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-data-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-error-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="websocket" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-websocket-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="auth" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-auth-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="api" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_PATH}/advisor_server-api-%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 保留最多30天的日志 -->
|
||||||
|
<totalSizeCap>1GB</totalSizeCap> <!-- 限制日志总大小 -->
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}|%-4.5level|%X{requestId}|%msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 配置日志记录器,按业务模块使用不同的 appender -->
|
||||||
|
<logger name="video" level="INFO" additivity="false">
|
||||||
|
<appender-ref ref="video"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="data" level="INFO" additivity="false">
|
||||||
|
<appender-ref ref="data"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="error" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="error"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="websocket" level="INFO" additivity="false">
|
||||||
|
<appender-ref ref="websocket"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="auth" level="INFO" additivity="false">
|
||||||
|
<appender-ref ref="auth"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="api" level="INFO" additivity="false">
|
||||||
|
<appender-ref ref="api"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 根 Logger 配置 (可以定义默认的日志记录器) -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="default"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</included>
|
||||||
1
src/main/resources/prod/admin.yaml
Normal file
1
src/main/resources/prod/admin.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
scheduledEnable: true
|
||||||
49
src/main/resources/prod/advisorServer.yaml
Normal file
49
src/main/resources/prod/advisorServer.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
jwt:
|
||||||
|
key: backendUser
|
||||||
|
secret: hello12345
|
||||||
|
rsa:
|
||||||
|
pubKey: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZAOgJVSyQuU452OaQG3XwONd0dsyfPvtAMZugDi9knoR9fhJrUU3IZHNzz617tFP+nqiZrZaDR04d35g9YZaMMu3LnsDNpTT4n3eHWoEf2CJ6PHItbrE8TXfG7oDBEDfttLQS2q3KyJWNAQtotuQriusOcp0AgXi3XyeQL1FwGQIDAQAB"
|
||||||
|
priKey: "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANkA6AlVLJC5TjnY5pAbdfA413R2zJ8++0Axm6AOL2SehH1+EmtRTchkc3PPrXu0U/6eqJmtloNHTh3fmD1hlowy7cuewM2lNPifd4dagR/YIno8ci1usTxNd8bugMEQN+20tBLarcrIlY0BC2i25CuK6w5ynQCBeLdfJ5AvUXAZAgMBAAECgYEAusC18Lo1hUOEl/Ib0q9fW2J/wcIvrWjVb9SBm0g57z0gxqNGFMe+yhPw7B0xrwFtO/atILysiMRH7RuteD3RAbdZQl4r3Hz2jA/YjIgfu/KcdENvCYD5X5AhbflOSyvn4mzGvzyPmS6H6Hlr7UI3/dknq4OiTDXD9M06gNK53gECQQDwk/Ui7rtfo1TcCkyrTlirGy1kHDcl9EgPfcQSVlZJICTVmvT1d9MmLcVtFezadmWP/9QxdJtPbfWXMvby4ftBAkEA5uoTvl1girN9q8IIZ1PpcE17TASexzKcFIpweMVkXQEbTxq7ijqRAQ9MONjj2gtzaXB6c6P9sIOP/Pt74JP22QJAbd6Ec2GnvPOwy5UAkrODFxGgVznzjafUSQ7cvqsjWN4PNGZCPOBuU99PbJQ4yUSM+YiSdcuVKl9Da7vgv+eogQJBAKirbNaNoJpP98kBR2AqhAabIifp7Az3I9lBMlyVWvUwfMEwdrLGiuqqQPP5QZ4g5SGsnlVgAUvxHbkd/WOS0SkCQCK30/4rdyWTNvR38O8KYSx76Dxj7OKYO4xZGoQL9Pgv05Ua4LfyZHdNaPmspLNEqxfgKObzJWiTwic2+JDsG/w="
|
||||||
|
des:
|
||||||
|
key: hello123
|
||||||
|
file:
|
||||||
|
domain:
|
||||||
|
prefix: https://do.tgsys.sztg.com/
|
||||||
|
resizePrefix: https://do.tgsys.sztg.com/resize/
|
||||||
|
scheduledEnable: true
|
||||||
|
cron:
|
||||||
|
collectLivingVideo: "20 0/5 * * * ?" #每分钟统计已开始但未结束的视频直播数据
|
||||||
|
saveVideoCount: "20 1/5 * * * ?" #从cache刷新视频播放量到DB 每分钟的第10s执行
|
||||||
|
saveVideoUserDataToDB: "20 2/5 * * * ?"
|
||||||
|
saveCustomerDataToDB: "20 3/5 * * * ?" #收集用户信息
|
||||||
|
refreshTranscodeStatus: "20 4/5 * * * ?" #从腾讯云拉取录播上传视频信息更新到DB
|
||||||
|
updateLiveStatus: "0 1 * * * ?" #更新视频录播状态
|
||||||
|
stopLivingVideo: "0 1-5 0 * * ?" #结束前一天直播中/暂停中的视频直播
|
||||||
|
collectLastWeek: "0 30 3 * * ?" #统计一周内的数据
|
||||||
|
saveWatchSeconds: "0 0/5 * * * ?" #保存短视频观看时长
|
||||||
|
collectRecentEndVideo: "0 1/5 * * * ?" #每5分钟统计已结束48小时以内的视频直播数据
|
||||||
|
saveGroupMessageRead: "0 2/5 * * * ?" #每5分钟统计已结束48小时以内的视频直播数据
|
||||||
|
saveGroupUser: "0 3/5 * * * ?"
|
||||||
|
collectGroupData: "0 4/5 * * * ?"
|
||||||
|
syncOrder: "40 0/5 * * * ?"
|
||||||
|
syncModuleUser: "40 1/5 * * * ?"
|
||||||
|
user:
|
||||||
|
admin:
|
||||||
|
roles: 1,3,4,5 #管理员角色id,用逗号隔开
|
||||||
|
defaultPwd: syzb.hello.dev
|
||||||
|
dept:
|
||||||
|
head:
|
||||||
|
id: "1" #总部营业部ID
|
||||||
|
advisor:
|
||||||
|
roleId: 2
|
||||||
|
sale:
|
||||||
|
roleId: 17
|
||||||
|
video:
|
||||||
|
finishReadRatio: 0.9 #计算视频完播率(完成人数/总人数)大于等于该值即未完成观看
|
||||||
|
websocket:
|
||||||
|
brokerHost: wss://do.tgsys.sztg.com/tgim
|
||||||
|
resizeUrl:
|
||||||
|
main: https://do.tgsys.sztg.com/s/
|
||||||
|
original: https://do.tgsys.sztg.com/h5
|
||||||
|
urlMain: /videoPlay?id=
|
||||||
|
shortVideoUrl: /shotVideoPlay?id=
|
||||||
62
src/main/resources/prod/application.yaml
Normal file
62
src/main/resources/prod/application.yaml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
hazelcast:
|
||||||
|
members: 172.26.1.3,172.26.1.7,172.26.1.9,172.26.1.15 #缓存集群的ip端口号
|
||||||
|
serverPort: 5709 #自己作为缓存服务器监听的端口号
|
||||||
|
fastdfs:
|
||||||
|
connect_timeout_in_seconds: 10
|
||||||
|
network_timeout_in_seconds: 30
|
||||||
|
charset: UTF-8
|
||||||
|
tracker_servers: 172.26.1.9:22122,172.26.1.15:22122
|
||||||
|
connection_pool:
|
||||||
|
enabled: true
|
||||||
|
max_count_per_entry: 500
|
||||||
|
max_idle_time: 3600
|
||||||
|
max_wait_time_in_ms: 1000
|
||||||
|
mybatis-plus:
|
||||||
|
configuration:
|
||||||
|
call-setters-on-nulls: true #如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||||
|
map-underscore-to-camel-case: true #是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
|
||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
|
application:
|
||||||
|
name: DemoVideoDev-advisor-server
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
maxFileSize: 10MB
|
||||||
|
maxRequestSize: 20MB
|
||||||
|
datasource: #初始化连接池的连接数量
|
||||||
|
dynamic:
|
||||||
|
primary: master
|
||||||
|
strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
|
||||||
|
hikari:
|
||||||
|
min-idle: 5 #最小空闲连接数量
|
||||||
|
max-pool-size: 25 #连接池最大连接数,默认是10
|
||||||
|
idle-timeout: 100000 #空闲连接存活最大时间,默认600000(10分钟)
|
||||||
|
is_auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
|
||||||
|
max-lifetime: 600000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
|
||||||
|
connection-timeout: 15000 #数据库连接超时时间,默认30秒,即30000
|
||||||
|
connection-test-query: SELECT 1 FROM DUAL
|
||||||
|
validation-timeout: 30000
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.26.1.2:3306/advisor_video?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
|
||||||
|
username: tgdba
|
||||||
|
password: szTGdb@20250210
|
||||||
|
mvc:
|
||||||
|
pathmatch:
|
||||||
|
matching-strategy: ant_path_matcher #Springfox 使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
|
||||||
|
lifecycle:
|
||||||
|
timeout-per-shutdown-phase: "10s"
|
||||||
|
springfox:
|
||||||
|
documentation:
|
||||||
|
enabled: false #是否开启swagger
|
||||||
|
server:
|
||||||
|
shutdown: graceful
|
||||||
|
tomcat:
|
||||||
|
max-connections: 16384
|
||||||
|
accept-count: 1024
|
||||||
|
threads:
|
||||||
|
max: 1024
|
||||||
|
min-spare: 128
|
||||||
19
src/main/resources/prod/business.yaml
Normal file
19
src/main/resources/prod/business.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
business:
|
||||||
|
api:
|
||||||
|
host: https://webdzapi.ceniu.sztg.com
|
||||||
|
authorizationDeptId: 16
|
||||||
|
# authorizationDeptId: 33
|
||||||
|
authorizationKey: 56e670eea5ff3a1aebbc02820e908ceb56e670eea5ff3a1aebbc02820e908ceb
|
||||||
|
# authorizationKey: 90804bd6089d950e8804c6d7cad7558a90804bd6089d950e8804c6d7cad7558a
|
||||||
|
timeout: 10000
|
||||||
|
url:
|
||||||
|
loginUrl: /common/loginByUserName
|
||||||
|
getUserUrl: /common/getUserByToken
|
||||||
|
getModuleListUrl: /user/getUserModuleList
|
||||||
|
getOrderListUrl: /order/getAllBatchOrderListByPage
|
||||||
|
getModuleUserListUrl: /order/getUserModuleListByPage
|
||||||
|
ssoCheckToken: /sso/checkToken
|
||||||
|
checkLabelRole: /thirdapi/user/checkLabelRole
|
||||||
|
receiveCouponUrl: /user/coupon/receiveCoupon
|
||||||
|
backend:
|
||||||
|
tokenKey: 281ffabc
|
||||||
24
src/main/resources/prod/tencentConfig.yaml
Normal file
24
src/main/resources/prod/tencentConfig.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
tencent: #腾讯云配置
|
||||||
|
vodEndpoint: vod.tencentcloudapi.com #点播请求域名
|
||||||
|
liveEndpoint: live.tencentcloudapi.com #直播请求域名
|
||||||
|
region: ap-guangzhou #地域参数
|
||||||
|
secretId: AKIDdBbry19D9uRp23rStAIKQPEtMelgS6ax #用于标识 API 调用者身份,可以简单类比为用户名
|
||||||
|
secretKey: HNKG4vjMzSo02unbCdu20lLn5QFysfIj #用于验证 API 调用者的身份,可以简单类比为密码
|
||||||
|
appId: 1332258372 #当前账号AppId
|
||||||
|
appName: live #推流路径
|
||||||
|
pushHost: push.tgsys.sztg.com #推流域名
|
||||||
|
pushUrl: rtmp://push.tgsys.sztg.com #推流地址
|
||||||
|
pushKey: 163b37d858df8a6136f613ebcb067b37 #鉴权Key
|
||||||
|
liveHost: live.tgsys.sztg.com #播流域名
|
||||||
|
liveUrl: webrtc://live.tgsys.sztg.com #播流地址
|
||||||
|
liveKey: "video_pro" #鉴权Key
|
||||||
|
liveFormat: m3u8 #直播格式
|
||||||
|
key: nJTCJ3mdAMtkKwBxj53a #防盗链Key
|
||||||
|
expireHours: 48 #有效时间,单位小时
|
||||||
|
callbackKey: video_pro #直播推流、断流、录制回调key,验证回调来源
|
||||||
|
taskStream: "自适应码流" #自动转码任务流(转自适应码流)
|
||||||
|
audioVideoType: Transcode #原始流
|
||||||
|
rawAdaptiveDefinition: 10 #允许输出的未加密的 转自适应码流模板 ID
|
||||||
|
playKey: bsMetagPJRID1W7lXQz4 #播放密钥
|
||||||
|
templateId: 1563626
|
||||||
|
downloadDefinition: 100030 #下载转码视频清晰度
|
||||||
Loading…
x
Reference in New Issue
Block a user