commit 3f58700b38f4aa95826591f65a5ed3bc98a5886d
Author: jiumikeji <929832497@qq.com>
Date: Tue Apr 22 19:56:52 2025 +0800
jiumi
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f55ffd8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/target/
+/.idea/
+/logs/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..dc9739c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 panll
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c748027
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# wvp-pro-assist
+
+wvp-pro-assist是wvp-pro的辅助录像程序,也可单独跟zlm一起使用,提供录像控制,录像合并下载接口
diff --git a/lib-arm/ffmpeg b/lib-arm/ffmpeg
new file mode 100644
index 0000000..fa7906e
Binary files /dev/null and b/lib-arm/ffmpeg differ
diff --git a/lib-arm/ffprobe b/lib-arm/ffprobe
new file mode 100644
index 0000000..7e38ff7
Binary files /dev/null and b/lib-arm/ffprobe differ
diff --git a/lib/ffmpeg b/lib/ffmpeg
new file mode 100644
index 0000000..13e56c8
Binary files /dev/null and b/lib/ffmpeg differ
diff --git a/lib/ffprobe b/lib/ffprobe
new file mode 100644
index 0000000..e6bd137
Binary files /dev/null and b/lib/ffprobe differ
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..166fe08
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,121 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.2
+
+ top.panll.assist
+ wvp-pro-assist
+ 2.6.9
+ wvp-pro-assist
+
+
+ 1.8
+ MMddHHmm
+
+
+
+
+
+ nexus-aliyun
+ Nexus aliyun
+ https://maven.aliyun.com/repository/public
+ default
+
+ false
+
+
+ true
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+ net.bramp.ffmpeg
+ ffmpeg
+ 0.6.2
+
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ 1.6.10
+
+
+ com.github.xiaoymin
+ knife4j-springdoc-ui
+ 3.0.3
+
+
+
+ org.mp4parser
+ muxer
+ 1.9.56
+
+
+ org.mp4parser
+ streaming
+ 1.9.56
+
+
+
+ org.mp4parser
+ isoparser
+ 1.9.27
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+ ${project.artifactId}-${project.version}-${maven.build.timestamp}
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+
+
+
+
+
+
diff --git a/src/main/java/top/panll/assist/WvpProAssistApplication.java b/src/main/java/top/panll/assist/WvpProAssistApplication.java
new file mode 100644
index 0000000..c19cadf
--- /dev/null
+++ b/src/main/java/top/panll/assist/WvpProAssistApplication.java
@@ -0,0 +1,15 @@
+package top.panll.assist;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@EnableScheduling
+public class WvpProAssistApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(WvpProAssistApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/top/panll/assist/config/FastJsonRedisSerializer.java b/src/main/java/top/panll/assist/config/FastJsonRedisSerializer.java
new file mode 100644
index 0000000..1d896c4
--- /dev/null
+++ b/src/main/java/top/panll/assist/config/FastJsonRedisSerializer.java
@@ -0,0 +1,44 @@
+package top.panll.assist.config;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.parser.ParserConfig;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.SerializationException;
+
+import java.nio.charset.Charset;
+
+public class FastJsonRedisSerializer implements RedisSerializer {
+ private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
+ private Class clazz;
+
+ /**
+ * 添加autotype白名单
+ * 解决redis反序列化对象时报错 :com.alibaba.fastjson.JSONException: autoType is not support
+ */
+ static {
+ ParserConfig.getGlobalInstance().addAccept("top.panll.assist");
+ }
+
+ public FastJsonRedisSerializer(Class clazz) {
+ super();
+ this.clazz = clazz;
+ }
+
+ @Override
+ public byte[] serialize(T t) throws SerializationException {
+ if (null == t) {
+ return new byte[0];
+ }
+ return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
+ }
+
+ @Override
+ public T deserialize(byte[] bytes) throws SerializationException {
+ if (null == bytes || bytes.length <= 0) {
+ return null;
+ }
+ String str = new String(bytes, DEFAULT_CHARSET);
+ return JSON.parseObject(str, clazz);
+ }
+}
diff --git a/src/main/java/top/panll/assist/config/GlobalExceptionHandler.java b/src/main/java/top/panll/assist/config/GlobalExceptionHandler.java
new file mode 100644
index 0000000..2a9d934
--- /dev/null
+++ b/src/main/java/top/panll/assist/config/GlobalExceptionHandler.java
@@ -0,0 +1,44 @@
+package top.panll.assist.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import top.panll.assist.controller.bean.ControllerException;
+import top.panll.assist.controller.bean.ErrorCode;
+import top.panll.assist.controller.bean.WVPResult;
+
+/**
+ * 全局异常处理
+ */
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+ private final static Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
+
+ /**
+ * 默认异常处理
+ * @param e 异常
+ * @return 统一返回结果
+ */
+ @ExceptionHandler(Exception.class)
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public WVPResult exceptionHandler(Exception e) {
+ logger.error("[全局异常]: ", e);
+ return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
+ }
+
+ /**
+ * 自定义异常处理, 处理controller中返回的错误
+ * @param e 异常
+ * @return 统一返回结果
+ */
+ @ExceptionHandler(ControllerException.class)
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public WVPResult exceptionHandler(ControllerException e) {
+ return WVPResult.fail(e.getCode(), e.getMsg());
+ }
+
+}
diff --git a/src/main/java/top/panll/assist/config/GlobalResponseAdvice.java b/src/main/java/top/panll/assist/config/GlobalResponseAdvice.java
new file mode 100644
index 0000000..52ee2d8
--- /dev/null
+++ b/src/main/java/top/panll/assist/config/GlobalResponseAdvice.java
@@ -0,0 +1,54 @@
+package top.panll.assist.config;
+
+import com.alibaba.fastjson.JSON;
+import org.springframework.core.MethodParameter;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.server.ServerHttpRequest;
+import org.springframework.http.server.ServerHttpResponse;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
+import top.panll.assist.controller.bean.ErrorCode;
+import top.panll.assist.controller.bean.WVPResult;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 全局统一返回结果
+ * @author lin
+ */
+@RestControllerAdvice
+public class GlobalResponseAdvice implements ResponseBodyAdvice