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