From 8f66e45661acc949f86f8615ca871eaa5f1432fc Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 09 六月 2025 14:25:23 +0800 Subject: [PATCH] 配置video.types配置解析重新实现 --- pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java | 6 ++---- pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java index d8a9fd3..39fdaa7 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java @@ -44,8 +44,6 @@ this.sv = sv ; } - @Value("${video.types}") - private String[] types; /** * 瀹㈡埛绔姹傚緱鍒版墍鏈夋憚鍍忔満绫诲瀷 * @return 鎵�鏈夋憚鍍忔満绫诲瀷 @@ -64,8 +62,8 @@ public BaseResponse<QueryResultVo<List<TypesVo>>> types() { try { List<TypesVo> list = new ArrayList<>() ; - if(types != null && types.length > 0){ - for (String type : types) { + if(CameraTypesConfig.types != null && CameraTypesConfig.types.size() > 0){ + for (String type : CameraTypesConfig.types) { String[] typeGrp = type.split(","); if(typeGrp.length == 2){ TypesVo vo = new TypesVo() ; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java new file mode 100644 index 0000000..e88e1ab --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java @@ -0,0 +1,27 @@ +package com.dy.pipIrrProject.video; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/9 14:21 + * @Description + */ +@Configuration +@ConfigurationProperties(prefix = "video") +public class CameraTypesConfig { + + public static List<String> types; + + public List<String> getTypes(){ + return types; + } + + public void setTypes(List<String> types){ + CameraTypesConfig.types = types ; + } + +} \ No newline at end of file -- Gitblit v1.8.0