liurunyu
3 天以前 8f66e45661acc949f86f8615ca871eaa5f1432fc
配置video.types配置解析重新实现
1个文件已修改
1个文件已添加
33 ■■■■ 已修改文件
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraCtrl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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() ;
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/video/CameraTypesConfig.java
New file
@@ -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 ;
    }
}