diff --git a/DJI-Cloud-API-Demo-main/pom.xml b/DJI-Cloud-API-Demo-main/pom.xml index 65db1ed..1dccfbd 100644 --- a/DJI-Cloud-API-Demo-main/pom.xml +++ b/DJI-Cloud-API-Demo-main/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.springframework.boot @@ -195,6 +196,7 @@ + dj6789 org.springframework.boot diff --git a/DJI-Cloud-API-Demo-main/pom.xml b/DJI-Cloud-API-Demo-main/pom.xml index 65db1ed..1dccfbd 100644 --- a/DJI-Cloud-API-Demo-main/pom.xml +++ b/DJI-Cloud-API-Demo-main/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.springframework.boot @@ -195,6 +196,7 @@ + dj6789 org.springframework.boot diff --git a/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java b/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java index bb03a1d..e5cc89b 100644 --- a/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java +++ b/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java @@ -1,40 +1,49 @@ package com.dji.sample.configuration.mvc; import com.dji.sample.component.AuthInterceptor; +import java.util.ArrayList; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.util.ArrayList; -import java.util.List; - @Configuration public class GlobalMVCConfigurer implements WebMvcConfigurer { - @Autowired - private AuthInterceptor authInterceptor; + @Autowired + private AuthInterceptor authInterceptor; - private static List excludePaths = new ArrayList<>(); + private static List excludePaths = new ArrayList<>(); - @Value("${url.manage.prefix}") - private String managePrefix; + @Value("${url.manage.prefix}") + private String managePrefix; - @Value("${url.manage.version}") - private String manageVersion; + @Value("${url.manage.version}") + private String manageVersion; - @Override - public void addInterceptors(InterceptorRegistry registry) { - // Exclude the login interface. - excludePaths.add("/" + managePrefix + manageVersion + "/login"); - excludePaths.add("/" + managePrefix + manageVersion + "/token/refresh"); - excludePaths.add("/swagger-ui.html"); - excludePaths.add("/swagger-ui/**"); - excludePaths.add("/v3/**"); - excludePaths.add("/ui/**"); - // Intercept for all request interfaces. - registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths); - } + @Override + public void addInterceptors(InterceptorRegistry registry) { + // Exclude the login interface. + excludePaths.add("/" + managePrefix + manageVersion + "/login"); + excludePaths.add("/" + managePrefix + manageVersion + "/token/refresh"); + excludePaths.add("/swagger-ui.html"); + excludePaths.add("/swagger-ui/**"); + excludePaths.add("/v3/**"); + excludePaths.add("/ui/**"); + + excludePaths.add("/prod-api/" + managePrefix + manageVersion + "/login"); + excludePaths.add("/prod-api/" + managePrefix + manageVersion + "/token/refresh"); + excludePaths.add("/prod-api/swagger-ui.html"); + excludePaths.add("/prod-api/swagger-ui/**"); + excludePaths.add("/prod-api/v3/**"); + excludePaths.add("/prod-api/ui/**"); + + excludePaths.add("/error"); + // Intercept for all request interfaces. + registry.addInterceptor(authInterceptor).addPathPatterns("/**") + .excludePathPatterns(excludePaths); + } } diff --git a/DJI-Cloud-API-Demo-main/pom.xml b/DJI-Cloud-API-Demo-main/pom.xml index 65db1ed..1dccfbd 100644 --- a/DJI-Cloud-API-Demo-main/pom.xml +++ b/DJI-Cloud-API-Demo-main/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.springframework.boot @@ -195,6 +196,7 @@ + dj6789 org.springframework.boot diff --git a/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java b/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java index bb03a1d..e5cc89b 100644 --- a/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java +++ b/DJI-Cloud-API-Demo-main/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java @@ -1,40 +1,49 @@ package com.dji.sample.configuration.mvc; import com.dji.sample.component.AuthInterceptor; +import java.util.ArrayList; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.util.ArrayList; -import java.util.List; - @Configuration public class GlobalMVCConfigurer implements WebMvcConfigurer { - @Autowired - private AuthInterceptor authInterceptor; + @Autowired + private AuthInterceptor authInterceptor; - private static List excludePaths = new ArrayList<>(); + private static List excludePaths = new ArrayList<>(); - @Value("${url.manage.prefix}") - private String managePrefix; + @Value("${url.manage.prefix}") + private String managePrefix; - @Value("${url.manage.version}") - private String manageVersion; + @Value("${url.manage.version}") + private String manageVersion; - @Override - public void addInterceptors(InterceptorRegistry registry) { - // Exclude the login interface. - excludePaths.add("/" + managePrefix + manageVersion + "/login"); - excludePaths.add("/" + managePrefix + manageVersion + "/token/refresh"); - excludePaths.add("/swagger-ui.html"); - excludePaths.add("/swagger-ui/**"); - excludePaths.add("/v3/**"); - excludePaths.add("/ui/**"); - // Intercept for all request interfaces. - registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths); - } + @Override + public void addInterceptors(InterceptorRegistry registry) { + // Exclude the login interface. + excludePaths.add("/" + managePrefix + manageVersion + "/login"); + excludePaths.add("/" + managePrefix + manageVersion + "/token/refresh"); + excludePaths.add("/swagger-ui.html"); + excludePaths.add("/swagger-ui/**"); + excludePaths.add("/v3/**"); + excludePaths.add("/ui/**"); + + excludePaths.add("/prod-api/" + managePrefix + manageVersion + "/login"); + excludePaths.add("/prod-api/" + managePrefix + manageVersion + "/token/refresh"); + excludePaths.add("/prod-api/swagger-ui.html"); + excludePaths.add("/prod-api/swagger-ui/**"); + excludePaths.add("/prod-api/v3/**"); + excludePaths.add("/prod-api/ui/**"); + + excludePaths.add("/error"); + // Intercept for all request interfaces. + registry.addInterceptor(authInterceptor).addPathPatterns("/**") + .excludePathPatterns(excludePaths); + } } diff --git a/DJI-Cloud-API-Demo-main/src/main/resources/application.yml b/DJI-Cloud-API-Demo-main/src/main/resources/application.yml index 087e01f..307c9e2 100644 --- a/DJI-Cloud-API-Demo-main/src/main/resources/application.yml +++ b/DJI-Cloud-API-Demo-main/src/main/resources/application.yml @@ -41,8 +41,8 @@ age: 8640000 mqtt: -# # @see com.dji.sample.component.mqtt.model.MqttUseEnum -# # BASIC parameters are required. + # # @see com.dji.sample.component.mqtt.model.MqttUseEnum + # # BASIC parameters are required. BASIC: protocol: MQTT # @see com.dji.sample.component.mqtt.model.MqttProtocolEnum host: 192.168.127.102 @@ -118,7 +118,7 @@ endpoint: http://192.168.127.102:9008 access-key: minioadmin secret-key: minioadmin - bucket: cloud-bucket + bucket: newfiber-standard expire: 3600 region: us-east-1 object-dir-prefix: wayline