Browse Source

feat: 添加免费用户字段并优化请求体处理

- 在AppletUser类中添加freeUser字段以支持免费用户标识
- 移除pom.xml中过时的Java 9编译配置
- 修改AppletApiTTSController中的请求体读取方式,使用缓冲区提高处理大请求体的性能
master
主管理员 2 days ago
parent
commit
355662530d
3 changed files with 21 additions and 13 deletions
  1. +2
    -0
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java
  2. +12
    -12
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml
  3. +7
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiTTSController.java

+ 2
- 0
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java View File

@ -83,6 +83,8 @@ public class AppletUser implements Serializable {
private String unionId;//同平id
private String freeUser;//免费用户
/**
* 手机号
*/


+ 12
- 12
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/pom.xml View File

@ -3,18 +3,18 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jeecgboot-boot-applet</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
</build>
<!-- <build>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <source>8</source>-->
<!-- <target>8</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
<parent>
<artifactId>jeecg-boot-module</artifactId>


+ 7
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiTTSController.java View File

@ -134,7 +134,13 @@ public class AppletApiTTSController {
// 直接从 InputStream 读取原始字节避免 Spring 的参数解析
try (java.io.InputStream is = request.getInputStream()) {
byte[] bytes = is.readAllBytes();
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
while ((length = is.read(buffer)) != -1) {
baos.write(buffer, 0, length);
}
byte[] bytes = baos.toByteArray();
raw = new String(bytes, java.nio.charset.StandardCharsets.UTF_8);
log.info("原始请求体长度: {} 字节", bytes.length);
}


Loading…
Cancel
Save