mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-15 21:03:40 +00:00
完成火山引擎适配
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<easyexcel.version>3.2.1</easyexcel.version>
|
<easyexcel.version>3.2.1</easyexcel.version>
|
||||||
<jna.version>5.13.0</jna.version>
|
<jna.version>5.13.0</jna.version>
|
||||||
|
<java-websocket.version>1.5.5</java-websocket.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 按照用户要求,不添加任何依赖 -->
|
<!-- 按照用户要求,不添加任何依赖 -->
|
||||||
@@ -84,5 +85,11 @@
|
|||||||
<version>${jna.version}</version>
|
<version>${jna.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.java-websocket</groupId>
|
||||||
|
<artifactId>Java-WebSocket</artifactId>
|
||||||
|
<version>${java-websocket.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
@@ -1,4 +1,16 @@
|
|||||||
package org.ruoyi.aihuman.config;
|
package org.ruoyi.aihuman.config;
|
||||||
|
|
||||||
public class WebConfig {
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
// 映射/voice/**路径到classpath:/voice/目录
|
||||||
|
registry.addResourceHandler("/voice/**")
|
||||||
|
.addResourceLocations("classpath:/voice/")
|
||||||
|
.setCachePeriod(3600);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,21 @@
|
|||||||
package org.ruoyi.aihuman.domain;
|
package org.ruoyi.aihuman.domain;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语音请求参数实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
public class VoiceRequest {
|
public class VoiceRequest {
|
||||||
|
|
||||||
|
@JsonProperty("ENDPOINT")
|
||||||
|
private String endpoint;
|
||||||
|
private String appId;
|
||||||
|
private String accessToken;
|
||||||
|
private String resourceId;
|
||||||
|
private String voice;
|
||||||
|
private String text;
|
||||||
|
private String encoding;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.java_websocket.client.WebSocketClient;
|
import org.java_websocket.client.WebSocketClient;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.speech.protocol;
|
package org.ruoyi.aihuman.protocol;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.speech.volcengine;
|
package org.ruoyi.aihuman.volcengine;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.speech.protocol.EventType;
|
import org.ruoyi.aihuman.protocol.EventType;
|
||||||
import com.speech.protocol.Message;
|
import org.ruoyi.aihuman.protocol.Message;
|
||||||
import com.speech.protocol.MsgType;
|
import org.ruoyi.aihuman.protocol.MsgType;
|
||||||
import com.speech.protocol.SpeechWebSocketClient;
|
import org.ruoyi.aihuman.protocol.SpeechWebSocketClient;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -40,7 +40,7 @@ public class Bidirection {
|
|||||||
String accessToken = System.getProperty("accessToken", "fOHuq4R4dirMYiOruCU3Ek9q75zV0KVW");
|
String accessToken = System.getProperty("accessToken", "fOHuq4R4dirMYiOruCU3Ek9q75zV0KVW");
|
||||||
String resourceId = System.getProperty("resourceId", "seed-tts-2.0");
|
String resourceId = System.getProperty("resourceId", "seed-tts-2.0");
|
||||||
String voice = System.getProperty("voice", "zh_female_vv_uranus_bigtts");
|
String voice = System.getProperty("voice", "zh_female_vv_uranus_bigtts");
|
||||||
String text = System.getProperty("text", "你好呀!如果你有关于老婆相关的问题,比如怎么让她开心、怎么照顾她等,都可以跟我说哦,我会根据【马斯克·陈】提供的关爱老婆百事通里的信息给你分析和建议哒。");
|
String text = System.getProperty("text", "你好呀!我是AI合成的语音,很高兴认识你。");
|
||||||
String encoding = System.getProperty("encoding", "mp3");
|
String encoding = System.getProperty("encoding", "mp3");
|
||||||
|
|
||||||
if (appId.isEmpty() || accessToken.isEmpty()) {
|
if (appId.isEmpty() || accessToken.isEmpty()) {
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# 代码生成
|
||||||
|
gen:
|
||||||
|
# 作者
|
||||||
|
author: ageerle
|
||||||
|
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||||
|
packageName: org.ruoyi.aihuman
|
||||||
|
# 自动去除表前缀,默认是false
|
||||||
|
autoRemovePre: false
|
||||||
|
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||||
|
tablePrefix: aihuman_
|
||||||
Reference in New Issue
Block a user