|
@@ -0,0 +1,21 @@
|
|
|
+package api.gateway.factory;
|
|
|
+
|
|
|
+import api.gateway.filters.CommonAuthFilter;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.cloud.gateway.filter.GatewayFilter;
|
|
|
+import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+@Component
|
|
|
+public class AuthFilterGatewayFilterFactory extends AbstractGatewayFilterFactory<Object> {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CommonAuthFilter commonAuthFilter;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public GatewayFilter apply(Object filter) {
|
|
|
+ return commonAuthFilter;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|