mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-09-13 00:14:59 +00:00
fix: 修复本地启动、数据库初始化与构建问题
This commit is contained in:
@@ -7,7 +7,7 @@ ENV TZ=Asia/Shanghai
|
|||||||
|
|
||||||
# 复制初始化脚本和SQL文件到镜像中
|
# 复制初始化脚本和SQL文件到镜像中
|
||||||
COPY docs/script/docker/mysql/init/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
|
COPY docs/script/docker/mysql/init/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
|
||||||
COPY docs/script/sql/ruoyi-ai-v3_mysql8.sql /docker-entrypoint-initdb.d/ruoyi-ai-v3_mysql8.sql
|
COPY docs/script/sql/ruoyi-ai.sql /docker-entrypoint-initdb.d/ruoyi-ai.sql
|
||||||
|
|
||||||
# 设置脚本可执行权限
|
# 设置脚本可执行权限
|
||||||
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
|
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
#
|
#
|
||||||
# 镜像仓库地址: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai
|
# 镜像仓库地址: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai
|
||||||
|
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# ==================== MySQL 数据库 ====================
|
# ==================== MySQL 数据库 ====================
|
||||||
mysql:
|
mysql:
|
||||||
@@ -30,7 +28,10 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- mysql-data:/var/lib/mysql
|
- mysql-data:/var/lib/mysql
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
|
# Force TCP: during first-time initialization MySQL exposes a temporary
|
||||||
|
# socket-only server. A socket ping would mark the service healthy before
|
||||||
|
# the real network listener (used by the backend) is ready.
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "--protocol=tcp", "-h", "127.0.0.1", "-u", "root", "-proot"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ services:
|
|||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
volumes:
|
volumes:
|
||||||
- ./docs/script/docker/mysql/init/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
|
- ./docs/script/docker/mysql/init/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
|
||||||
- ./docs/script/sql/ruoyi-ai-v3_mysql8.sql:/docker-entrypoint-initdb.d/ruoyi-ai-v3_mysql8.sql:ro
|
- ./docs/script/sql/ruoyi-ai.sql:/docker-entrypoint-initdb.d/ruoyi-ai.sql:ro
|
||||||
- mysql-data:/var/lib/mysql
|
- mysql-data:/var/lib/mysql
|
||||||
command:
|
command:
|
||||||
--default-authentication-plugin=mysql_native_password
|
--default-authentication-plugin=mysql_native_password
|
||||||
@@ -32,7 +32,9 @@ services:
|
|||||||
--lower_case_table_names=1
|
--lower_case_table_names=1
|
||||||
--skip-ssl
|
--skip-ssl
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
|
# Do not let the socket-only initialization server satisfy the check.
|
||||||
|
# The backend connects over TCP and must wait for that listener.
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "--protocol=tcp", "-h", "127.0.0.1", "-u", "root", "-proot"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
545
docs/script/sql/snail_job_mysql.sql
Normal file
545
docs/script/sql/snail_job_mysql.sql
Normal file
File diff suppressed because it is too large
Load Diff
1
pom.xml
1
pom.xml
@@ -70,6 +70,7 @@
|
|||||||
<commons-compress.version>1.27.1</commons-compress.version>
|
<commons-compress.version>1.27.1</commons-compress.version>
|
||||||
|
|
||||||
<avatar-generator.version>1.1.0</avatar-generator.version>
|
<avatar-generator.version>1.1.0</avatar-generator.version>
|
||||||
|
<javassist.version>3.30.2-GA</javassist.version>
|
||||||
<jsoup.version>1.21.2</jsoup.version>
|
<jsoup.version>1.21.2</jsoup.version>
|
||||||
<knife4j.version>4.4.0</knife4j.version>
|
<knife4j.version>4.4.0</knife4j.version>
|
||||||
<swagger-annotations.version>2.2.8</swagger-annotations.version>
|
<swagger-annotations.version>2.2.8</swagger-annotations.version>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: @monitor.username@
|
username: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
|
|
||||||
--- # mcp配置信息
|
--- # mcp配置信息
|
||||||
mcp:
|
mcp:
|
||||||
@@ -60,7 +60,7 @@ spring:
|
|||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: 123456
|
||||||
# agent:
|
# agent:
|
||||||
# url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
# url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# # url: jdbc:mysql://localhost:3306/agent_db
|
# # url: jdbc:mysql://localhost:3306/agent_db
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: @monitor.username@
|
username: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
|
|
||||||
--- # mcp配置信息
|
--- # mcp配置信息
|
||||||
mcp:
|
mcp:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ captcha:
|
|||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
org.ruoyi: @logging.level@
|
org.ruoyi: ${LOGGING_LEVEL_ORG_RUOYI:info}
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
org.mybatis.spring.mapper: error
|
org.mybatis.spring.mapper: error
|
||||||
org.apache.fury: warn
|
org.apache.fury: warn
|
||||||
@@ -79,7 +79,7 @@ spring:
|
|||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
profiles:
|
profiles:
|
||||||
active: @profiles.active@
|
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.ruoyi.common.chat.domain.bo.chat;
|
package org.ruoyi.common.chat.domain.bo.chat;
|
||||||
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatModel;
|
import org.ruoyi.common.chat.entity.chat.ChatModel;
|
||||||
|
import org.ruoyi.common.core.validate.AddGroup;
|
||||||
import org.ruoyi.common.core.validate.EditGroup;
|
import org.ruoyi.common.core.validate.EditGroup;
|
||||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
@@ -28,16 +30,19 @@ public class ChatModelBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 模型分类
|
* 模型分类
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "模型分类不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型名称
|
* 模型名称
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String modelName;
|
private String modelName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型供应商
|
* 模型供应商
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "模型供应商不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String providerCode;
|
private String providerCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: ruoyi-monitor-admin
|
name: ruoyi-monitor-admin
|
||||||
profiles:
|
profiles:
|
||||||
active: @profiles.active@
|
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
config: classpath:logback-plus.xml
|
config: classpath:logback-plus.xml
|
||||||
@@ -13,8 +13,8 @@ logging:
|
|||||||
spring:
|
spring:
|
||||||
security:
|
security:
|
||||||
user:
|
user:
|
||||||
name: @monitor.username@
|
name: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
boot:
|
boot:
|
||||||
admin:
|
admin:
|
||||||
ui:
|
ui:
|
||||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: @monitor.username@
|
username: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://localhost:3306/snail_job?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: 123456
|
||||||
hikari:
|
hikari:
|
||||||
connection-timeout: 30000
|
connection-timeout: 30000
|
||||||
validation-timeout: 5000
|
validation-timeout: 5000
|
||||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: @monitor.username@
|
username: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
|
|||||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
|||||||
metadata:
|
metadata:
|
||||||
username: ${spring.boot.admin.client.username}
|
username: ${spring.boot.admin.client.username}
|
||||||
userpassword: ${spring.boot.admin.client.password}
|
userpassword: ${spring.boot.admin.client.password}
|
||||||
username: @monitor.username@
|
username: ${MONITOR_USERNAME:ruoyi}
|
||||||
password: @monitor.password@
|
password: ${MONITOR_PASSWORD:123456}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: ruoyi-snailjob-server
|
name: ruoyi-snailjob-server
|
||||||
profiles:
|
profiles:
|
||||||
active: @profiles.active@
|
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||||
web:
|
web:
|
||||||
resources:
|
resources:
|
||||||
static-locations: classpath:admin/
|
static-locations: classpath:admin/
|
||||||
|
|||||||
@@ -72,6 +72,21 @@
|
|||||||
<groupId>com.talanlabs</groupId>
|
<groupId>com.talanlabs</groupId>
|
||||||
<artifactId>avatar-generator-cat</artifactId>
|
<artifactId>avatar-generator-cat</artifactId>
|
||||||
<version>${avatar-generator.version}</version>
|
<version>${avatar-generator.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.javassist</groupId>
|
||||||
|
<artifactId>javassist</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- avatar-generator-cat pulls an obsolete Javassist POM that Maven 3.9
|
||||||
|
warns about. Reflections 0.9.10 is compatible with the maintained
|
||||||
|
drop-in replacement. -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.javassist</groupId>
|
||||||
|
<artifactId>javassist</artifactId>
|
||||||
|
<version>${javassist.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class CompileNode {
|
public class CompileNode {
|
||||||
protected String id;
|
protected String id;
|
||||||
|
@Builder.Default
|
||||||
protected Boolean conditional = false;
|
protected Boolean conditional = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,5 +25,6 @@ public class CompileNode {
|
|||||||
* 2. 当前节点为条件分支节点,下游节点为多个节点,实际执行时只会执行一条
|
* 2. 当前节点为条件分支节点,下游节点为多个节点,实际执行时只会执行一条
|
||||||
* 两种节点根据是否GraphCompileNode来区分
|
* 两种节点根据是否GraphCompileNode来区分
|
||||||
*/
|
*/
|
||||||
|
@Builder.Default
|
||||||
protected List<CompileNode> nextNodes = new ArrayList<>();
|
protected List<CompileNode> nextNodes = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class NodeProcessResult {
|
public class NodeProcessResult {
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
private List<NodeIOData> content = new ArrayList<>();
|
private List<NodeIOData> content = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +26,7 @@ public class NodeProcessResult {
|
|||||||
/**
|
/**
|
||||||
* 是否发生错误
|
* 是否发生错误
|
||||||
*/
|
*/
|
||||||
|
@Builder.Default
|
||||||
private boolean error = false;
|
private boolean error = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ class FfmpegCommandBuilderTest {
|
|||||||
List.of(source),
|
List.of(source),
|
||||||
TransitionType.NONE,
|
TransitionType.NONE,
|
||||||
0,
|
0,
|
||||||
AspectRatio.PORTRAIT
|
AspectRatio.PORTRAIT,
|
||||||
|
null,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
FfmpegFilterGraph graph = new FfmpegFilterGraph(
|
FfmpegFilterGraph graph = new FfmpegFilterGraph(
|
||||||
"[0:v]null[v0]",
|
"[0:v]null[v0]",
|
||||||
|
|||||||
@@ -183,6 +183,6 @@ class FfmpegFilterGraphBuilderTest {
|
|||||||
List<CompositionSource> sources = java.util.stream.IntStream.range(0, sourceCount)
|
List<CompositionSource> sources = java.util.stream.IntStream.range(0, sourceCount)
|
||||||
.mapToObj(index -> new CompositionSource(Path.of("clip-" + index + ".mp4"), null))
|
.mapToObj(index -> new CompositionSource(Path.of("clip-" + index + ".mp4"), null))
|
||||||
.toList();
|
.toList();
|
||||||
return new CompositionSpec(sources, transition, duration, ratio);
|
return new CompositionSpec(sources, transition, duration, ratio, null, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user