将检测任务迁移python
This commit is contained in:
9
.env
9
.env
@@ -22,7 +22,12 @@ FRONTEND_PORT=10080
|
||||
PYTHON_SERVICE_HOST=rtsp-python-service
|
||||
PYTHON_SERVICE_PORT=8000
|
||||
|
||||
# MinIO配置(外部服务)
|
||||
MINIO_ENABLED=true
|
||||
MINIO_ENDPOINT=http://49.232.154.205:10900
|
||||
MINIO_ACCESS_KEY=4EsLD9g9OM09DT0HaBKj
|
||||
MINIO_SECRET_KEY=05SFC5fleqTnaLRYBrxHiphMFYbGX5nYicj0WCHA
|
||||
MINIO_BUCKET=rtsp
|
||||
|
||||
# 时区配置
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# 备注:MinIO使用外部已部署的服务,配置在application.yml中
|
||||
|
||||
3
pom.xml
3
pom.xml
@@ -220,6 +220,9 @@
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -4,11 +4,11 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
# 主库数据源 - 支持环境变量配置
|
||||
master:
|
||||
url: jdbc:mysql://140.143.206.120:3306/fad_watch?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: klp
|
||||
password: KeLunPu123@
|
||||
url: ${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai}
|
||||
username: ${SPRING_DATASOURCE_USERNAME:root}
|
||||
password: ${SPRING_DATASOURCE_PASSWORD:password}
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -68,14 +68,14 @@ spring:
|
||||
data:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
# 地址 - 支持环境变量,Docker环境使用容器名
|
||||
host: ${SPRING_DATA_REDIS_HOST:localhost}
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
port: ${SPRING_DATA_REDIS_PORT:6379}
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password:
|
||||
password: ${SPRING_DATA_REDIS_PASSWORD:}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@@ -127,13 +127,13 @@ springdoc:
|
||||
paths-to-match: '/**'
|
||||
packages-to-scan: com.ruoyi.web.controller.tool
|
||||
|
||||
# MinIO配置
|
||||
# MinIO配置 - 支持环境变量配置
|
||||
minio:
|
||||
enabled: true
|
||||
endpoint: http://49.232.154.205:10900
|
||||
access-key: 4EsLD9g9OM09DT0HaBKj
|
||||
secret-key: 05SFC5fleqTnaLRYBrxHiphMFYbGX5nYicj0WCHA
|
||||
bucket: rtsp
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
endpoint: ${MINIO_ENDPOINT:http://49.232.154.205:10900}
|
||||
access-key: ${MINIO_ACCESS_KEY:4EsLD9g9OM09DT0HaBKj}
|
||||
secret-key: ${MINIO_SECRET_KEY:05SFC5fleqTnaLRYBrxHiphMFYbGX5nYicj0WCHA}
|
||||
bucket: ${MINIO_BUCKET:rtsp}
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
||||
@@ -37,7 +37,8 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
|
||||
@Override
|
||||
public void afterPropertiesSet()
|
||||
{
|
||||
RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class);
|
||||
// 使用bean名称获取,避免Actuator的HandlerMapping冲突
|
||||
RequestMappingHandlerMapping mapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class);
|
||||
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
|
||||
|
||||
map.keySet().forEach(info -> {
|
||||
|
||||
@@ -11,7 +11,8 @@ public final class ModelManager implements AutoCloseable {
|
||||
private final Map<String, YoloDetector> map = new LinkedHashMap<>();
|
||||
|
||||
// Python服务的默认API URL
|
||||
private static final String DEFAULT_PYTHON_API_URL = "http://localhost:8000/api/detect/file";
|
||||
// 支持环境变量配置,Docker环境使用容器名
|
||||
private static final String DEFAULT_PYTHON_API_URL = System.getenv().getOrDefault("PYTHON_API_URL", "http://localhost:8000") + "/api/detect/file";
|
||||
|
||||
/**
|
||||
* 从配置加载检测器
|
||||
|
||||
Reference in New Issue
Block a user