Merge remote-tracking branch 'origin/dev_2.1.0' into dev_2.1.0

dev_2.1.0
xueqingkun 1 year ago
commit 4bd880f4e9

@ -31,6 +31,10 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<alibaba.cloud.version>2.2.5.RELEASE</alibaba.cloud.version>
<spring.cloud.version>Hoxton.SR6</spring.cloud.version>
<nacos.common.version>1.4.1</nacos.common.version>
<spring.boot.version>2.3.5.RELEASE</spring.boot.version>
<fastjson.version>1.2.76</fastjson.version>
<mybatis-puls-spring-boot.version>3.3.1</mybatis-puls-spring-boot.version>
@ -52,6 +56,28 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${alibaba.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--spring-cloud-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
<version>${nacos.common.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>

@ -14,6 +14,36 @@
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</exclusion>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>com.supervision</groupId>
<artifactId>virtual-patient-model</artifactId>
@ -40,9 +70,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-base:latest</builder>
</image>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>

@ -3,12 +3,16 @@ package com.supervision.manage;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
@SpringBootApplication
@MapperScan(basePackages = {"com.supervision.**.mapper"})
@ComponentScan(basePackages = {"com.supervision.**"})
@EnableFeignClients(basePackages = "com.supervision")
@EnableDiscoveryClient
public class VirtualPatientManageApplication {
public static void main(String[] args) {

@ -1,63 +0,0 @@
#服务器端口
server:
port: 8891
servlet:
context-path: /virtual-patient-manage
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
application:
name: virtual-patient-manage
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.137:3306/virtual_patient?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
redis:
host: 192.168.10.137
port: 6379
password: 123456
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
minio:
url: http://192.168.10.137:9002
accessKey: admin
secretKey: 12345678
bucketName: virtual-patient-bucket-dev

@ -1,63 +0,0 @@
#服务器端口
server:
port: 8891
servlet:
context-path: /virtual-patient-manage
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
application:
name: virtual-patient-manage
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.138:3306/virtual_patient_test?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
redis:
host: 192.168.10.138
port: 6379
password: 123456
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
minio:
url: http://192.168.10.138:9002
accessKey: admin
secretKey: 12345678
bucketName: virtual-patient-bucket-test

@ -1,3 +1,48 @@
#服务器端口
server:
port: 8891
servlet:
context-path: /virtual-patient-manage
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
profiles:
active: test
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e
discovery:
server-addr: 192.168.10.137:8848
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0
discovery:
server-addr: 192.168.10.137:8848
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0

@ -0,0 +1,5 @@
spring:
profiles:
active: test
application:
name: virtual-patient-manage

@ -19,6 +19,6 @@ public class RasaTalkVo {
* id
*/
@ApiModelProperty(hidden = true)
private String modelId;
private String modelId = "1";
}

@ -21,6 +21,35 @@
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</exclusion>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>com.supervision</groupId>
<artifactId>virtual-patient-common</artifactId>

@ -6,6 +6,7 @@ import com.supervision.rasa.service.Text2vecService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@MapperScan(basePackages = {"com.supervision.**.mapper"})
// 排除JWT权限校验
@ComponentScan(basePackages = {"com.supervision"},excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {WebConfig.class}))
@EnableDiscoveryClient
public class VirtualPatientRasaApplication {
public static void main(String[] args) {

@ -1,66 +0,0 @@
server:
port: 8890
servlet:
context-path: /virtual-patient-rasa
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
rasa:
data-path: /data/vp/rasa/model_resource/ # 文件解压后存放位置
models-path: /data/vp/rasa/models/
endpoints: /rasa/endpoints.yml # 启动的配置项,应该是写在配置文件里面
config: /rasa/config.yml # 启动rasa需要的配置文件在配置文件中配置
url: 127.0.0.1:{}/webhooks/rest/webhook
wakeup:
cron: 0 */10 * * * ? #每十分钟执行一次
text2vec:
service:
domain: http://127.0.0.1:5000/
spring:
application:
name: virtual-patient
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.137:3306/virtual_patient?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

@ -1,66 +0,0 @@
server:
port: 8890
servlet:
context-path: /virtual-patient-rasa
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
rasa:
data-path: /data/vp/rasa/model_resource/ # 文件解压后存放位置
models-path: /data/vp/rasa/models/
endpoints: /rasa/endpoints.yml # 启动的配置项,应该是写在配置文件里面
config: /rasa/config.yml # 启动rasa需要的配置文件在配置文件中配置
url: 127.0.0.1:{}/webhooks/rest/webhook
wakeup:
cron: 0 */10 * * * ? #每十分钟执行一次
text2vec:
service:
domain: http://127.0.0.1:5000/
spring:
application:
name: virtual-patient
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.138:3306/virtual_patient_test?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

@ -1,3 +1,46 @@
server:
port: 8890
servlet:
context-path: /virtual-patient-rasa
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
profiles:
active: dev
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e
discovery:
server-addr: 192.168.10.137:8848
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0
discovery:
server-addr: 192.168.10.137:8848
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0

@ -0,0 +1,5 @@
spring:
profiles:
active: test
application:
name: virtual-patient-rasa

@ -18,6 +18,37 @@
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</exclusion>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.supervision</groupId>
<artifactId>virtual-patient-model</artifactId>

@ -4,6 +4,8 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.scheduling.annotation.EnableScheduling;
@ -11,8 +13,9 @@ import org.springframework.web.socket.config.annotation.EnableWebSocket;
@SpringBootApplication
@MapperScan(basePackages = {"com.supervision.**.mapper"})
@EnableWebSocket
@EnableScheduling
@EnableFeignClients(basePackages = "com.supervision")
@EnableDiscoveryClient
public class VirtualPatientApplication {
public static void main(String[] args) {

@ -31,11 +31,6 @@ public class AskController {
return askService.receiveVoiceFile(file);
}
@ApiOperation("使用京东数字人进行对话(这个接口使用京东数字人接口来做)")
@PostMapping("/talk")
public TalkResultResVO talk(@RequestBody TalkReqVO talkReqVO) throws IOException {
return askService.talk(talkReqVO);
}
@ApiOperation("使用本地视频的形式来做")
@PostMapping("/talkByVideo")

@ -1,44 +0,0 @@
package com.supervision.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.supervision.domain.GlobalResult;
import com.supervision.service.RasaService;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description: @since 2.0.0rasaManage RasaCmdService.deployRasa
*/
@Deprecated
@RestController
@RequestMapping("rasa")
@RequiredArgsConstructor
public class RasaController {
private final RasaService rasaService;
@ApiOperation("生成rasa的yml文件")
@GetMapping("generateRasaYml")
public GlobalResult<String> generateRasaYml(String patientId) {
return rasaService.generateRasaYml(patientId);
}
@ApiOperation("训练rasa")
@GetMapping("trainRasa")
public GlobalResult<String> trainRasa(String patientId) throws JsonProcessingException {
return rasaService.trainRasa(patientId);
}
@ApiOperation("运行Rasa")
@GetMapping("runRasa")
public GlobalResult<String> runRasa(String patientId) throws JsonProcessingException {
return rasaService.runRasa(patientId);
}
}

@ -0,0 +1,17 @@
package com.supervision.feign;
import com.supervision.domain.GlobalResult;
import com.supervision.vo.rasa.RasaTalkVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = "virtual-patient-rasa", contextId = "VirtualPatientRasa")
public interface RasaManageFeignClient {
@PostMapping("/virtual-patient-rasa/rasa/talkRasa")
GlobalResult<List<String>> talk(@RequestBody RasaTalkVo rasaTalkVo);
}

@ -15,8 +15,6 @@ public interface AskService {
String receiveVoiceFile(MultipartFile file);
TalkResultResVO talk(TalkReqVO talkReqVO) throws IOException;
TalkResultResVO talkByVideo(TalkVideoReqVO talkReqVO) throws IOException;

@ -1,13 +0,0 @@
package com.supervision.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.supervision.domain.GlobalResult;
public interface RasaService {
GlobalResult<String> generateRasaYml(String diseaseId);
GlobalResult<String> trainRasa(String patientId) throws JsonProcessingException;
GlobalResult<String> runRasa(String patientId) throws JsonProcessingException;
}

@ -1,13 +1,19 @@
package com.supervision.service.impl;
import cn.hutool.core.codec.Base64Encoder;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.setting.dialect.Props;
import com.supervision.domain.GlobalResult;
import com.supervision.exception.BusinessException;
import com.supervision.feign.RasaManageFeignClient;
import com.supervision.model.Process;
import com.supervision.model.*;
import com.supervision.pojo.vo.TalkReqVO;
@ -15,6 +21,7 @@ import com.supervision.pojo.vo.TalkResultResVO;
import com.supervision.pojo.vo.TalkVideoReqVO;
import com.supervision.service.*;
import com.supervision.util.*;
import com.supervision.vo.rasa.RasaTalkVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -46,6 +53,8 @@ public class AskServiceImpl implements AskService {
private final FileResourceService fileResourceService;
private final RasaManageFeignClient rasaManageFeignClient;
@Value("${answer.defaultNoMatchId}")
private String defaultNoMatchId;
@ -70,87 +79,6 @@ public class AskServiceImpl implements AskService {
return text;
}
@Override
@Transactional(rollbackFor = Exception.class)
public TalkResultResVO talk(TalkReqVO talkReqVO) {
// 根据processId找到对应的病人
Process process = Optional.ofNullable(processService.getById(talkReqVO.getProcessId())).orElseThrow(() -> new BusinessException("未找到诊疗进程"));
// 调用rasa获取文字内容
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId());
// 如果rasa没有识别出来,则返回默认值
if (StrUtil.isBlank(rasaResult)) {
// 这里调用京东数字人接口首先根据token获取房间号
String roomId = HumanUtil.queryRoomId(talkReqVO.getRoomKey(), talkReqVO.getRoomToken());
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
saveQaRecord(talkReqVO.getProcessId(), "default", null, talkReqVO.getText(), null, "您好,我没有听懂您说什么");
}
TalkResultResVO talkResultResVO = new TalkResultResVO();
// 这里校验,rasa回复的结果是不是action
// 这里设置的模板,对于action的动作全部是用ancillary_ | tool_进行标记,详情看生成rasa的yml的代码:RasaServiceImpl.generateDomain
// ancillary_ | tool_
if (rasaResult.startsWith("ancillary_") || rasaResult.startsWith("tool_")) {
log.info("呼出语句:{}", rasaResult);
List<String> actionList = StrUtil.split(rasaResult, '_');
if (actionList.size() > 1) {
// 在这里给socket回复,设置为动作
talkResultResVO.setActionId(actionList.get(1));
talkResultResVO.setType("ancillary".equals(actionList.get(0)) ? 3 : 2);
setActionRelation(talkResultResVO);
return talkResultResVO;
}
} else {
String roomId = HumanUtil.queryRoomId(talkReqVO.getRoomKey(), talkReqVO.getRoomToken());
AskTemplateQuestionLibrary library = askTemplateQuestionLibraryService.getById(rasaResult);
if (ObjectUtil.isEmpty(library)) {
log.info("{}:未从问题库中找到,回答未识别语句", rasaResult);
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
saveQaRecord(talkReqVO.getProcessId(), "default", null, talkReqVO.getText(), null, "您好,我没有听懂您说什么");
} else {
AskPatientAnswer askPatientAnswer = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getMedicalId, process.getMedicalRecId())
.eq(AskPatientAnswer::getLibraryQuestionId, library.getId()).last("limit 1").one();
// 如果没有找到回答,去默认回答里面看看有没有
if (ObjectUtil.isEmpty(askPatientAnswer)) {
log.info("{}:病历配置,未从AskPatientAnswer中找到回答结果,尝试回答默认答案", rasaResult);
// 首先看看default里面是不是存在,如果存在,就从default里面去找
if (StrUtil.isNotEmpty(library.getDefaultAnswer())) {
String resText = library.getDefaultAnswer();
HumanUtil.textDriven(resText, roomId);
// 保存记录
saveQaRecord(talkReqVO.getProcessId(), "default", library.getId(), talkReqVO.getText(), library, resText);
log.info("{}:找到了默认答案:{}", rasaResult, talkReqVO.getText());
} else {
log.info("{}:没有从默认答案中找到找到默认内容,回复未识别语句", rasaResult);
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
saveQaRecord(talkReqVO.getProcessId(), "default", null, talkReqVO.getText(), library, "您好,我没有听懂您说什么");
}
} else {
if (StrUtil.isEmpty(askPatientAnswer.getAnswer())) {
log.info("{}:病历配置的回答:{}:为空不为空,但在获取的时候,答案为空,尝试回复默认语句", rasaResult, askPatientAnswer.getId());
if (StrUtil.isNotEmpty(library.getDefaultAnswer())) {
String resText = library.getDefaultAnswer();
log.info("{}:病历配置的回答:{}:为空不为空不为空,但在获取的时候,答案为空,开始回复默认语句,默认语句内容:{}", rasaResult, askPatientAnswer.getId(), resText);
HumanUtil.textDriven(resText, roomId);
// 保存记录
saveQaRecord(talkReqVO.getProcessId(), "default", library.getId(), talkReqVO.getText(), library, resText);
} else {
log.info("{}:病历配置的回答:{}:为空不为空,但在获取的时候,答案为空,但是获取默认语句也为空,那么回复未识别语句", rasaResult, askPatientAnswer.getId());
HumanUtil.textDriven("您好,我没有听懂您说什么", roomId);
}
} else {
String resText = askPatientAnswer.getAnswer();
log.info("{}:找到了病历配置的回答语句:{},回答内容:{}", rasaResult, askPatientAnswer.getId(), resText);
HumanUtil.textDriven(resText, roomId);
// 保存记录
saveQaRecord(talkReqVO.getProcessId(), "patient", askPatientAnswer.getId(), talkReqVO.getText(), library, resText);
}
}
}
}
talkResultResVO.setType(1);
return talkResultResVO;
}
private void saveQaRecord(String processId, String answerType, String answerId, String question, AskTemplateQuestionLibrary library, String resText) {
DiagnosisQaRecord record = new DiagnosisQaRecord();
@ -195,7 +123,6 @@ public class AskServiceImpl implements AskService {
talkResultResVO.setActionType(new MD5().digestHex16(configAncillaryItem.getType()));
}
}
}
@Override
@ -203,7 +130,7 @@ public class AskServiceImpl implements AskService {
// 根据processId找到对应的病人
Process process = Optional.ofNullable(processService.getById(talkReqVO.getProcessId())).orElseThrow(() -> new BusinessException("未找到诊疗进程"));
// 调用rasa获取文字内容
String rasaResult = RasaUtil.talkRasa(talkReqVO.getText(), UserUtil.getUser().getId());
String rasaResult = talkRasa(talkReqVO.getText(), UserUtil.getUser().getId());
log.info("rasa的回复是:{}", rasaResult);
TalkResultResVO talkResultResVO = new TalkResultResVO();
// 如果rasa没有识别出来,则返回默认值
@ -287,6 +214,25 @@ public class AskServiceImpl implements AskService {
return talkResultResVO;
}
public String talkRasa(String question, String sessionId) {
RasaTalkVo rasaTalkVo = new RasaTalkVo();
rasaTalkVo.setQuestion(question);
rasaTalkVo.setSessionId(sessionId);
// 默认为1
rasaTalkVo.setModelId("1");
GlobalResult<List<String>> talk = rasaManageFeignClient.talk(rasaTalkVo);
log.info("调用rasa对话返回结果:{}", talk);
try {
if (talk.getCode() != 200 || CollUtil.isEmpty(talk.getData())) {
return "对不起,我没有听懂您说的是什么意思";
}
return CollUtil.getFirst(talk.getData());
} catch (Exception e) {
log.error("talkRasa error ", e);
}
return "对不起,我没有听懂您说的是什么意思";
}
/**
* base64

@ -1,247 +0,0 @@
package com.supervision.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.supervision.domain.GlobalResult;
import com.supervision.exception.BusinessException;
import com.supervision.model.*;
import com.supervision.pojo.rasa.train.DomainYmlTemplate;
import com.supervision.pojo.rasa.train.NluYmlTemplate;
import com.supervision.pojo.rasa.train.QuestionAnswerDTO;
import com.supervision.pojo.rasa.train.RuleYmlTemplate;
import com.supervision.service.*;
import freemarker.template.Configuration;
import freemarker.template.Template;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@Slf4j
@Service
@RequiredArgsConstructor
public class RasaServiceImpl implements RasaService {
private final ConfigPhysicalToolService configPhysicalToolService;
private final ConfigAncillaryItemService configAncillaryItemService;
private final AskTemplateQuestionLibraryService askTemplateQuestionLibraryService;
private static final ObjectMapper objectMapper = new ObjectMapper();
@Value("${rasa.base-url}${rasa.saveRasaFile}")
private String saveRasaFileUrl;
@Value("${rasa.base-url}${rasa.train}")
private String trainRasaUrl;
@Value("${rasa.base-url}${rasa.run}")
private String runRasaUrl;
@Override
public GlobalResult<String> generateRasaYml(String patientId) {
Map<String, File> ymalFileMap = new HashMap<>();
// 默认问答MAP
Map<String, QuestionAnswerDTO> questionCodeAndIdMap = new HashMap<>();
List<RuleYmlTemplate.Rule> ruleList = new ArrayList<>();
// 开始生成各种yaml文件
generateNlu(patientId, questionCodeAndIdMap, ymalFileMap);
generateDomain(questionCodeAndIdMap, ruleList, ymalFileMap);
generateRule(ruleList, ymalFileMap);
// 生成压缩文件
List<File> tempFile = new ArrayList<>();
File tempZipFile = FileUtil.createTempFile(".zip", true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (ZipOutputStream zipOutputStream = new ZipOutputStream(bos)) {
for (Map.Entry<String, File> fileEntry : ymalFileMap.entrySet()) {
zipOutputStream.putNextEntry(new ZipEntry(fileEntry.getKey()));
IoUtil.copy(FileUtil.getInputStream(fileEntry.getValue()), zipOutputStream);
zipOutputStream.closeEntry();
tempFile.add(fileEntry.getValue());
}
zipOutputStream.finish();
// 调用接口传文件
HttpRequest request = HttpRequest.post(saveRasaFileUrl);
IoUtil.copy(new ByteArrayInputStream(bos.toByteArray()), FileUtil.getOutputStream(tempZipFile));
request.form("file", tempZipFile);
request.form("modelId", patientId);
HttpResponse response = request.execute();
String responseBody = response.body();
log.info(responseBody);
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
});
} catch (Exception e) {
log.error("生成ZIP文件失败", e);
throw new BusinessException("生成ZIP文件失败");
} finally {
// 最后把临时文件删除
tempFile.forEach(FileUtil::del);
FileUtil.del(tempZipFile);
}
}
private void generateNlu(String patientId,
Map<String, QuestionAnswerDTO> intentCodeAndIdMap,
Map<String, File> ymalFileMap) {
// 首先生成根据意图查找到nlu文件
List<NluYmlTemplate.Nlu> nluList = new ArrayList<>();
// 默认意图
List<AskTemplateQuestionLibrary> askTemplateQuestionLibraryList = askTemplateQuestionLibraryService.lambdaQuery().list();
// 生成默认意图的nlu
for (AskTemplateQuestionLibrary questionLibrary : askTemplateQuestionLibraryList) {
// 开始生成
NluYmlTemplate.Nlu nlu = new NluYmlTemplate.Nlu();
// 拼接格式:code_id(防止重复)
String intentCode = questionLibrary.getCode() + "_" + questionLibrary.getId();
nlu.setIntent(intentCode);
nlu.setExamples(questionLibrary.getQuestion());
nluList.add(nlu);
// 添加到map中,key为意图编码,value为意图ID
intentCodeAndIdMap.put(intentCode, new QuestionAnswerDTO(questionLibrary.getQuestion(), CollUtil.newArrayList( questionLibrary.getId()), questionLibrary.getDescription()));
}
// 这里处理呼出的问题(code和问题不能为空)
List<ConfigPhysicalTool> physicalToolList = configPhysicalToolService.lambdaQuery()
.isNotNull(ConfigPhysicalTool::getCode)
.isNotNull(ConfigPhysicalTool::getCallOutQuestion).list();
for (ConfigPhysicalTool tool : physicalToolList) {
// 把呼出的问题全部加进去
NluYmlTemplate.Nlu nlu = new NluYmlTemplate.Nlu();
String toolIntent = "tool_" + tool.getCode();
nlu.setIntent(toolIntent);
nlu.setExamples(tool.getCallOutQuestion());
nluList.add(nlu);
// answer格式为:---tool---工具ID
intentCodeAndIdMap.put(toolIntent,
new QuestionAnswerDTO(tool.getCallOutQuestion(),
CollUtil.newArrayList("tool_" + tool.getId()), "tool-" + tool.getToolName()));
}
// 生成呼出的辅助检查
List<ConfigAncillaryItem> ancillaryItemList = configAncillaryItemService.lambdaQuery()
.isNotNull(ConfigAncillaryItem::getCode)
.isNotNull(ConfigAncillaryItem::getCallOutQuestion).list();
for (ConfigAncillaryItem ancillary : ancillaryItemList) {
// 把辅助问诊的问题全部加进去
NluYmlTemplate.Nlu nlu = new NluYmlTemplate.Nlu();
String itemIntent = "ancillary_" + ancillary.getCode();
nlu.setIntent(itemIntent);
nlu.setExamples(ancillary.getCallOutQuestion());
nluList.add(nlu);
// answer格式为:---ancillary---工具ID
intentCodeAndIdMap.put(itemIntent,
new QuestionAnswerDTO(ancillary.getCallOutQuestion(),
CollUtil.newArrayList("ancillary_" + ancillary.getId()), "呼出-ancillary-" + ancillary.getItemName()));
}
NluYmlTemplate nluYmlTemplate = new NluYmlTemplate();
nluYmlTemplate.setNlu(nluList);
// 生成后生成yml文件
createYmlFile(NluYmlTemplate.class, "nlu.ftl", nluYmlTemplate, "nlu.yml", ymalFileMap);
}
public void generateDomain(Map<String, QuestionAnswerDTO> questionCodeAndIdMap,
List<RuleYmlTemplate.Rule> ruleList, Map<String, File> ymalFileMap) {
LinkedHashMap<String, List<String>> responses = new LinkedHashMap<>();
for (Map.Entry<String, QuestionAnswerDTO> entry : questionCodeAndIdMap.entrySet()) {
String intentCode = entry.getKey();
QuestionAnswerDTO value = entry.getValue();
String utter = "utter_" + intentCode;
responses.put(utter, CollUtil.newArrayList(value.getAnswerList()));
ruleList.add(new RuleYmlTemplate.Rule(value.getDesc(), intentCode, utter));
}
DomainYmlTemplate domainYmlTemplate = new DomainYmlTemplate();
// 意图
List<String> intentList = new ArrayList<>(questionCodeAndIdMap.keySet());
domainYmlTemplate.setIntents(intentList);
// 回复
domainYmlTemplate.setResponses(responses);
// action
List<String> actionList = new ArrayList<>(responses.keySet());
domainYmlTemplate.setActions(actionList);
// 生成yml文件
createYmlFile(DomainYmlTemplate.class, "domain.ftl", domainYmlTemplate, "domain.yml", ymalFileMap);
}
/**
* rule
*/
public void generateRule(List<RuleYmlTemplate.Rule> ruleList, Map<String, File> ymalFileMap) {
RuleYmlTemplate ruleYmlTemplate = new RuleYmlTemplate();
ruleYmlTemplate.setRules(ruleList);
// 生成yml文件
createYmlFile(RuleYmlTemplate.class, "rules.ftl", ruleYmlTemplate, "rules.yml", ymalFileMap);
}
private void createYmlFile(Class<?> clazz, String ftlName, Object data, String ymlName, Map<String, File> ymalFileMap) {
try {
// 这个版本和maven依赖的版本一致
Configuration configuration = new Configuration(Configuration.VERSION_2_3_31);
configuration.setClassForTemplateLoading(clazz, "/templates"); // 模板文件的所在目录
// 获取模板
Template template = configuration.getTemplate(ftlName);
File tempFile = FileUtil.createTempFile(".yml", true);
// 创建输出文件
try (PrintWriter out = new PrintWriter(tempFile);) {
// 填充并生成输出
template.process(data, out);
} catch (Exception e) {
log.error("文件生成失败");
}
ymalFileMap.put(ymlName, tempFile);
} catch (Exception e) {
log.error("导出模板失败", e);
}
}
@Override
public GlobalResult<String> trainRasa(String patientId) throws JsonProcessingException {
Map<String, Object> param = new HashMap<>();
param.put("modelId", patientId);
String responseBody = HttpUtil.post(trainRasaUrl, JSONUtil.toJsonStr(param));
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
});
}
@Override
public GlobalResult<String> runRasa(String patientId) throws JsonProcessingException {
Map<String, Object> param = new HashMap<>();
param.put("modelId", patientId);
String responseBody = HttpUtil.post(runRasaUrl, JSONUtil.toJsonStr(param));
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
});
}
}

@ -1,49 +0,0 @@
package com.supervision.util;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.supervision.pojo.paddlespeech.res.AsrResultDTO;
import com.supervision.pojo.paddlespeech.res.PaddleSpeechResDTO;
import com.supervision.pojo.rasa.train.dto.RasaReqDTO;
import com.supervision.pojo.rasa.train.dto.RasaResDTO;
import com.supervision.vo.rasa.RasaTalkVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.Environment;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
public class RasaUtil {
private static final Environment environment = SpringBeanUtil.getBean(Environment.class);
private static final String RASA_TALK_URL = environment.getProperty("rasa.base-url") + environment.getProperty("rasa.talk");
public static String talkRasa(String question, String sessionId) {
RasaTalkVo rasaTalkVo = new RasaTalkVo();
rasaTalkVo.setQuestion(question);
rasaTalkVo.setSessionId(sessionId);
// 默认为1
rasaTalkVo.setModelId("1");
String post = HttpUtil.post(RASA_TALK_URL, JSONUtil.toJsonStr(rasaTalkVo));
log.info("调用rasa对话返回结果:{}", post);
try {
JSONObject entries = JSONUtil.parseObj(post);
List<String> list = JSONUtil.toList(entries.getStr("data"), String.class);
if (CollUtil.isEmpty(list)) {
return "对不起,我没有听懂您说的是什么意思";
}
return CollUtil.getFirst(list);
} catch (Exception e) {
log.error("talkRasa error ", e);
}
return "对不起,我没有听懂您说的是什么意思";
}
}

@ -1,85 +0,0 @@
#服务器端口
server:
port: 8899
servlet:
context-path: /virtual-patient
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
application:
name: virtual-patient
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.137:3306/virtual_patient?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
redis:
host: 192.168.10.137
port: 6379
password: 123456
minio:
url: http://192.168.10.137:9002
accessKey: admin
secretKey: 12345678
bucketName: virtual-patient-bucket-dev
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
paddle-speech:
# https://github.com/PaddlePaddle/PaddleSpeech/wiki/PaddleSpeech-Server-RESTful-API
tts: http://192.168.10.137:8090/paddlespeech/tts
asr: http://192.168.10.137:8090/paddlespeech/asr
rasa:
base-url: http://192.168.10.137:8890/virtual-patient-rasa/
talk: rasa/talkRasa
saveRasaFile: rasaFile/saveRasaFile
train: rasaCmd/trainExec
run: rasaCmd/runExec
human:
base-url: https://digital-human.jd.com
room-id: /getRoomId
text-driven: /text_driven
talk-status: /talkStatus
resourceMaxNumber: 5
answer:
# 对于没有匹配上的缺省回答ID,关联的是vp_file_resource的ID
defaultNoMatchId: 1739173836351885313
defaultNoMatchAnswerMessage: 你好,医生

@ -1,85 +0,0 @@
#服务器端口
server:
port: 8899
servlet:
context-path: /virtual-patient
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
application:
name: virtual-patient
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.138:3306/virtual_patient?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
redis:
host: 192.168.10.137
port: 6379
password: 123456
minio:
url: http://192.168.10.138:9002
accessKey: admin
secretKey: 12345678
bucketName: virtual-patient-bucket-dev
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
paddle-speech:
# https://github.com/PaddlePaddle/PaddleSpeech/wiki/PaddleSpeech-Server-RESTful-API
tts: http://192.168.10.137:8090/paddlespeech/tts
asr: http://192.168.10.137:8090/paddlespeech/asr
rasa:
base-url: http://192.168.10.138:8890/virtual-patient-rasa/
talk: rasa/talkRasa
saveRasaFile: rasaFile/saveRasaFile
train: rasaCmd/trainExec
run: rasaCmd/runExec
human:
base-url: https://digital-human.jd.com
room-id: /getRoomId
text-driven: /text_driven
talk-status: /talkStatus
resourceMaxNumber: 5
answer:
# 对于没有匹配上的缺省回答ID,关联的是vp_file_resource的ID
defaultNoMatchId: 1739173836351885313
defaultNoMatchAnswerMessage: 你好,医生

@ -67,22 +67,7 @@ paddle-speech:
# https://github.com/PaddlePaddle/PaddleSpeech/wiki/PaddleSpeech-Server-RESTful-API
tts: http://virtual-patient-paddle-speech:8090/paddlespeech/tts
asr: http://virtual-patient-paddle-speech:8090/paddlespeech/asr
rasa:
base-url: http://virtual-patient-rasa:8890/virtual-patient-rasa/
talk: rasa/talkRasa
saveRasaFile: rasaFile/saveRasaFile
train: rasaCmd/trainExec
run: rasaCmd/runExec
human:
base-url: https://digital-human.jd.com
room-id: /getRoomId
text-driven: /text_driven
talk-status: /talkStatus
resourceMaxNumber: 5
ws:
# nginx的wss地址(如果是wss的,那么带不带s都可以访问)
nginx-ip: virtual-patient-nginx
nginx-port: 443
answer:
# 对于没有匹配上的缺省回答ID,关联的是vp_file_resource的ID
defaultNoMatchId: 1739173836351885313

@ -1,89 +0,0 @@
#服务器端口
server:
port: 8899
servlet:
context-path: /virtual-patient
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
application:
name: virtual-patient
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.138:3306/virtual_patient_test?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8
username: root
password: '123456'
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
redis:
host: 192.168.10.138
port: 6379
password: 123456
minio:
url: http://192.168.10.138:9002
accessKey: admin
secretKey: 12345678
bucketName: virtual-patient-bucket-test
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
paddle-speech:
# https://github.com/PaddlePaddle/PaddleSpeech/wiki/PaddleSpeech-Server-RESTful-API
tts: http://192.168.10.138:8090/paddlespeech/tts
asr: http://192.168.10.138:8090/paddlespeech/asr
rasa:
base-url: http://192.168.10.138:8790/virtual-patient-rasa/
talk: rasa/talkRasa
saveRasaFile: rasaFile/saveRasaFile
train: rasaCmd/trainExec
run: rasaCmd/runExec
human:
base-url: https://digital-human.jd.com
room-id: /getRoomId
text-driven: /text_driven
talk-status: /talkStatus
resourceMaxNumber: 5
ws:
# nginx的wss地址(如果是wss的,那么带不带s都可以访问)
nginx-ip: 192.168.10.138
nginx-port: 443
answer:
# 对于没有匹配上的缺省回答ID,关联的是vp_file_resource的ID
defaultNoMatchId: 1739945100730986498
defaultNoMatchAnswerMessage: 你好,医生

@ -1,3 +1,46 @@
#服务器端口
server:
port: 8899
servlet:
context-path: /virtual-patient
undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
spring:
profiles:
active: local
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
##数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5 # 初始化大小
min-idle: 10 # 最小连接数
max-active: 20 # 最大连接数
max-wait: 60000 # 获取连接时的最大等待时间
min-evictable-idle-time-millis: 300000 # 一个连接在池中最小生存的时间,单位是毫秒
time-between-eviction-runs-millis: 60000 # 多久才进行一次检测需要关闭的空闲连接,单位是毫秒
filters: stat,wall # 配置扩展插件stat-监控统计log4j-日志wall-防火墙防止SQL注入去掉后监控界面的sql无法统计
validation-query: SELECT 1 # 检测连接是否有效的 SQL语句为空时以下三个配置均无效
test-on-borrow: true # 申请连接时执行validationQuery检测连接是否有效默认true开启后会降低性能
test-on-return: true # 归还连接时执行validationQuery检测连接是否有效默认false开启后会降低性能
test-while-idle: true # 申请连接时如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效默认false建议开启不影响性能
stat-view-servlet:
enabled: false # 是否开启 StatViewServlet
filter:
stat:
enabled: true # 是否开启 FilterStat默认true
log-slow-sql: true # 是否开启 慢SQL 记录默认false
slow-sql-millis: 5000 # 慢 SQL 的标准,默认 3000单位毫秒
merge-sql: false # 合并多个连接池的监控数据默认false
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e
discovery:
server-addr: 192.168.10.137:8848
namespace: b9eea377-79ec-4ba5-9cc2-354f7bd5181e

@ -0,0 +1,10 @@
spring:
cloud:
nacos:
config:
server-addr: 192.168.10.137:8848
file-extension: yml
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0
discovery:
server-addr: 192.168.10.137:8848
namespace: 88e1f674-1fbc-4021-9ff1-60b94ee13ef0

@ -0,0 +1,5 @@
spring:
profiles:
active: test
application:
name: virtual-patient-web
Loading…
Cancel
Save