初始化
93
easyflow-starter/easyflow-starter-all/pom.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-starter</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<name>easyflow-starter</name>
|
||||
<artifactId>easyflow-starter-all</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-api-admin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-api-usercenter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-api-public</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-module-job</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-module-ai</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-reload4j</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-module-auth</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tech.easyflow</groupId>
|
||||
<artifactId>easyflow-module-autoconfig</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package tech.easyflow.starter;
|
||||
|
||||
import org.dromara.x.file.storage.spring.EnableFileStorage;
|
||||
import tech.easyflow.common.spring.BaseApp;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableFileStorage
|
||||
public class MainApplication extends BaseApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
run(MainApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package tech.easyflow.starter;
|
||||
|
||||
import com.mybatisflex.core.FlexGlobalConfig;
|
||||
import com.mybatisflex.core.audit.AuditManager;
|
||||
import com.mybatisflex.core.audit.ConsoleMessageCollector;
|
||||
import com.mybatisflex.core.audit.MessageCollector;
|
||||
import com.mybatisflex.spring.boot.MyBatisFlexCustomizer;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisConfig implements MyBatisFlexCustomizer {
|
||||
|
||||
|
||||
@Override
|
||||
public void customize(FlexGlobalConfig flexGlobalConfig) {
|
||||
//开启审计功能
|
||||
AuditManager.setAuditEnable(true);
|
||||
|
||||
//取消控制台的 Banner 打印
|
||||
flexGlobalConfig.setPrintBanner(false);
|
||||
|
||||
//设置 SQL 审计收集器
|
||||
MessageCollector collector = new ConsoleMessageCollector();
|
||||
AuditManager.setMessageCollector(collector);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/easyflow?useInformationSchema=true&characterEncoding=utf-8
|
||||
username: easyflow
|
||||
password: 123456
|
||||
@@ -0,0 +1,146 @@
|
||||
server:
|
||||
port: 8111
|
||||
address: 0.0.0.0
|
||||
shutdown: graceful
|
||||
# 启用HTTP响应压缩
|
||||
compression:
|
||||
enabled: true
|
||||
servlet:
|
||||
encoding:
|
||||
enabled: true
|
||||
charset: UTF-8 # 必须设置 UTF-8,避免 WebFlux 流式返回(AI 场景)会乱码问题
|
||||
force: true
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
# !!! 注意:useInformationSchema=true 是必须的,用于支持 MyBatis-Flex 正确读取表注释。
|
||||
url: jdbc:mysql://127.0.0.1:23306/easyflow?useInformationSchema=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: root
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
web:
|
||||
resources:
|
||||
# 示例:windows【file: C:\easyflow\attachment】 linux【file: /www/easyflow/attachment】
|
||||
static-locations: file:/Users/slience/postgraduate/easyflow/attachment
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
# 静态资源路径,用于访问本地文件
|
||||
# !!! 注意,这里要和下面的 easyflow.storage.local.prefix 后面的路径 /attachment 保持一致!
|
||||
static-path-pattern: /attachment/**
|
||||
# quartz 相关配置
|
||||
quartz:
|
||||
startup-delay: 1
|
||||
job-store-type: jdbc
|
||||
jdbc:
|
||||
platform: mysql
|
||||
initialize-schema: never
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
jobStore:
|
||||
misfireThreshold: 1000
|
||||
# 如果数据库大小写敏感,可将ddl里的相关表名改为大写
|
||||
tablePrefix: TB_QRTZ_
|
||||
threadPool:
|
||||
threadCount: 20
|
||||
threadPriority: 5
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true
|
||||
easyflow:
|
||||
# 语音播放、识别服务(阿里云)
|
||||
audio:
|
||||
type: aliAudioService
|
||||
ali:
|
||||
access-key-id: xxx
|
||||
access-key-secret: xxx
|
||||
app-key: xxx
|
||||
voice: siyue
|
||||
login:
|
||||
# 放行接口路径
|
||||
excludes: /api/v1/auth/**, /static/**, /userCenter/auth/**, /userCenter/public/**
|
||||
storage:
|
||||
type: local # xFileStorage / local
|
||||
# 本地文件存储配置
|
||||
local:
|
||||
# 示例:windows【C:\easyflow\attachment】 linux【/www/easyflow/attachment】
|
||||
root: /Users/slience/postgraduate/easyflow/attachment
|
||||
# 后端接口地址,用于拼接完整 url
|
||||
prefix: http://localhost:8080/attachment
|
||||
# xFileStorage存储文件配置
|
||||
dromara:
|
||||
x-file-storage: #文件存储配置
|
||||
default-platform: aliyun-oss-1 #默认使用的存储平台
|
||||
aliyun-oss:
|
||||
- platform: aliyun-oss-1 # 存储平台标识
|
||||
enable-storage: true # 启用存储
|
||||
access-key: yourAccessKeyId
|
||||
secret-key: yourAccessKeySecret
|
||||
end-point: yourEndpoint # 示例:https://oss-cn-beijing.aliyuncs.com
|
||||
bucket-name: yourBucketName
|
||||
domain: yourDomain # 访问域名,注意“/”结尾,例如:https://bucketname.oss-cn-shanghai.aliyuncs.com/
|
||||
base-path: attachment # 基础路径
|
||||
# 自定义节点相关配置
|
||||
node:
|
||||
# 文件内容提取节点,默认使用简单文档读取器,可自行实现 ReadDocService
|
||||
reader: 'defaultReader'
|
||||
# gitee 文档读取的实现,需要配置gitee的appKey
|
||||
gitee:
|
||||
appKey: 'xxx'
|
||||
# 搜索引擎节点 - 目前只支持博查搜索
|
||||
bochaai:
|
||||
apiKey: 'xxx'
|
||||
jetcache:
|
||||
# 缓存类型,可选值:local/remote/both CacheConfig 类初始化
|
||||
cacheType: local
|
||||
statIntervalMinutes: 15
|
||||
areaInCacheName: false
|
||||
local:
|
||||
default:
|
||||
type: linkedhashmap
|
||||
keyConvertor: fastjson
|
||||
remote:
|
||||
default:
|
||||
type: redis
|
||||
keyConvertor: fastjson2
|
||||
broadcastChannel: projectA
|
||||
valueEncoder: java
|
||||
valueDecoder: java
|
||||
poolConfig:
|
||||
minIdle: 5
|
||||
maxIdle: 20
|
||||
maxTotal: 50
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: pwd
|
||||
database: 0
|
||||
# 多路召回搜索引擎配置
|
||||
rag:
|
||||
searcher:
|
||||
# 搜索方式 默认lucene
|
||||
lucene:
|
||||
indexDirPath: ./luceneKnowledge
|
||||
elastic:
|
||||
host: https://127.0.0.1:9200
|
||||
userName: elastic
|
||||
password: elastic
|
||||
indexName: easyflow
|
||||
logging:
|
||||
file:
|
||||
path: .logs/
|
||||
name: easyflow.log
|
||||
level:
|
||||
root: info
|
||||
tech.easyflow.ai: debug
|
||||
# 行为验证码配置
|
||||
captcha:
|
||||
# 初始化默认资源
|
||||
init-default-resource: true
|
||||
# 开启二次验证
|
||||
secondary:
|
||||
enabled: true
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<property name="LOG_HOME" value=".logs"/>
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
|
||||
<!-- 彩色日志 -->
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
|
||||
<!--输出到控制台-->
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
|
||||
<!--<filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
|
||||
<!--<level>info</level>-->
|
||||
<!--</filter>-->
|
||||
<encoder>
|
||||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
|
||||
<!-- 设置字符集 -->
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 日志文件 -->
|
||||
<appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${LOG_PATH}/${LOG_FILE}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/${LOG_FILE}-%i</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%d{MM-dd HH:mm:ss.SSS} |-%-5level %logger{36}:%L - %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="LOGFILE" />
|
||||
</root>
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="LOGFILE" />
|
||||
</root>
|
||||
</configuration>
|
||||