Sync develop

This commit is contained in:
hongqiaowei
2023-02-17 18:36:14 +08:00
committed by GitHub
376 changed files with 2874 additions and 2014 deletions

View File

@@ -4,7 +4,7 @@ English | [简体中文](./README.md)
<a href="https://www.fizzgate.com"><img src="https://raw.githubusercontent.com/wiki/fizzgate/fizz-gateway-community/img/icon-color.png" width="70%"></a>
</p>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.7.0-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.7.1-blue.svg?cacheSeconds=2592000" />
<a href="http://www.fizzgate.com/fizz-gateway-community/" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
@@ -128,6 +128,7 @@ Starting from v1.3.0, the frontend and backend of the management backend are mer
| v2.6.5 | v2.6.5 |
| v2.6.6 | v2.6.6 |
| v2.7.0 | v2.7.0 |
| v2.7.1 | v2.7.1 |
Please download the corresponding management backend version according to the version of the community version
@@ -242,7 +243,7 @@ docker run --rm -d -p 8600:8600 \
-v $PWD/logs:/opt/fizz-gateway-community/logs fizzgate/fizz-gateway-community:{version}
```
Finally visit the gateway, the address format is: http://127.0.0.1:8600/proxy/[Service name]/[API Path]
Finally visit the gateway, the address format is: http://127.0.0.1:8600/[Service name]/[API Path]
## Official technical exchange group

View File

@@ -3,7 +3,7 @@
<a href="https://www.fizzgate.com"><img src="https://raw.githubusercontent.com/wiki/fizzgate/fizz-gateway-community/img/icon-color.png" width="70%"></a>
</p>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.7.0-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.7.1-blue.svg?cacheSeconds=2592000" />
<a href="http://www.fizzgate.com/fizz-gateway-community/" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
@@ -130,6 +130,7 @@ API地址http://demo.fizzgate.com/proxy/[服务名]/[API_Path]
| v2.6.5 | v2.6.5 |
| v2.6.6 | v2.6.6 |
| v2.7.0 | v2.7.0 |
| v2.7.1 | v2.7.1 |
请根据社区版的版本下载对应的管理后台版本
@@ -243,7 +244,7 @@ docker run --rm -d -p 8600:8600 \
-v $PWD/logs:/opt/fizz-gateway-community/logs fizzgate/fizz-gateway-community:{version}
```
最后访问网关地址形式为http://127.0.0.1:8600/proxy/[服务名]/[API_Path]
最后访问网关地址形式为http://127.0.0.1:8600/[服务名]/[API_Path]
## 官方技术交流群

View File

@@ -2,7 +2,7 @@ version: "3.6"
services:
fizz-mysql:
image: "fizzgate/fizz-mysql:2.7.0"
image: "fizzgate/fizz-mysql:2.7.1"
container_name: fizz-mysql
restart: always
hostname: fizz-mysql
@@ -27,7 +27,7 @@ services:
- fizz
fizz-gateway-community:
image: "fizzgate/fizz-gateway-community:2.7.0"
image: "fizzgate/fizz-gateway-community:2.7.1"
container_name: fizz-gateway-community
restart: always
hostname: fizz-gateway-community
@@ -48,7 +48,7 @@ services:
- fizz
fizz-manager-professional:
image: "fizzgate/fizz-manager-professional:2.7.0"
image: "fizzgate/fizz-manager-professional:2.7.1"
container_name: fizz-manager-professional
restart: always
hostname: fizz-manager-professional

View File

@@ -6,7 +6,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -18,12 +18,12 @@
<spring-session-bom.version>Dragonfruit-SR3</spring-session-bom.version>
<reactor-bom.version>Dysprosium-SR25</reactor-bom.version>
<lettuce.version>5.3.7.RELEASE</lettuce.version>
<netty.version>4.1.82.Final</netty.version>
<httpcore.version>4.4.15</httpcore.version>
<netty.version>4.1.89.Final</netty.version>
<httpcore.version>4.4.16</httpcore.version>
<log4j2.version>2.17.2</log4j2.version>
<slf4j.version>1.7.36</slf4j.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<lombok.version>1.18.24</lombok.version>
<lombok.version>1.18.26</lombok.version>
<apache.dubbo.version>2.7.7</apache.dubbo.version>
<grpc.version>1.16.1</grpc.version>
<mockito.version>3.4.6</mockito.version>
@@ -32,9 +32,9 @@
<commons-codec.version>1.15</commons-codec.version>
<commons-pool2.version>2.11.1</commons-pool2.version>
<gson.version>2.8.9</gson.version>
<netty-tcnative.version>2.0.54.Final</netty-tcnative.version>
<netty-tcnative.version>2.0.58.Final</netty-tcnative.version>
<spring-cloud.version>2.2.9.RELEASE</spring-cloud.version>
<snakeyaml.version>1.31</snakeyaml.version>
<snakeyaml.version>1.33</snakeyaml.version>
<spring-data-releasetrain.version>Moore-SR13</spring-data-releasetrain.version>-->
</properties>
@@ -60,7 +60,7 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator-i18n-support</artifactId>
<version>1.0.39_5</version>
<version>1.0.39_6</version>
</dependency>
<!-- import fizz-input-mysql -->

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we;
package com.fizzgate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -83,9 +83,12 @@ import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfigurati
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import we.config.AggregateRedisConfig;
import we.log.LogSendAppender;
import we.util.FileUtils;
import com.fizzgate.Fizz;
import com.fizzgate.FizzAppContext;
import com.fizzgate.config.AggregateRedisConfig;
import com.fizzgate.log.LogSendAppender;
import com.fizzgate.util.FileUtils;
/**
* fizz gateway application boot entrance

View File

@@ -125,6 +125,11 @@ fizz:
fast-fail-when-registry-center-down: false
web-client:
x-forwarded-for:
enable: true # default
append-gateway-ip: true # default
# dedicated-line:
# server:
# enable: true

View File

@@ -29,7 +29,7 @@
</Root>
<!-- suppress the warn 'No URLs will be polled as dynamic configuration sources.' -->
<logger name="com.netflix.config.sources.URLConfigurationSource" level="ERROR" includeLocation="false"/>
<Logger name="we" level="info" includeLocation="false" additivity="false">
<Logger name="com.fizzgate" level="info" includeLocation="false" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="LogSend" level="warn"/>
</Logger>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -44,7 +44,7 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator-i18n-support</artifactId>
<version>1.0.39_5</version>
<version>1.0.39_6</version>
</dependency>
<dependency>
@@ -163,7 +163,7 @@
<relocations>
<relocation>
<pattern>com.networknt</pattern>
<shadedPattern>we.repackaged.com.networknt</shadedPattern>
<shadedPattern>com.fizzgate.repackaged.com.networknt</shadedPattern>
</relocation>
</relocations>
</configuration>

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import io.lettuce.core.ClientOptions;
import io.lettuce.core.ReadFrom;

View File

@@ -15,13 +15,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import io.lettuce.core.ReadFrom;
import org.springframework.data.redis.connection.RedisNode;
import we.util.Consts;
import we.util.StringUtils;
import we.util.Utils;
import com.fizzgate.util.Consts;
import com.fizzgate.util.StringUtils;
import com.fizzgate.util.Utils;
import java.time.Duration;
import java.util.ArrayList;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import java.util.Date;
import java.util.concurrent.Executor;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import io.netty.channel.ChannelOption;
import io.netty.handler.ssl.SslContext;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.constants;
package com.fizzgate.constants;
/**
* @author unknown

View File

@@ -15,11 +15,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.flume.clients.log4j2appender;
package com.fizzgate.flume.clients.log4j2appender;
import org.apache.logging.log4j.ThreadContext;
import we.constants.CommonConstants;
import we.util.Consts;
import com.fizzgate.constants.CommonConstants;
import com.fizzgate.util.Consts;
public enum LogService {

View File

@@ -0,0 +1,2 @@
package com.fizzgate.flume.clients.log4j2appender;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.spring.http.server.reactive.ext;
package com.fizzgate.spring.http.server.reactive.ext;
import io.netty.handler.codec.http.cookie.Cookie;
import org.springframework.core.io.buffer.DataBuffer;
@@ -30,9 +30,11 @@ import org.springframework.lang.Nullable;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import com.fizzgate.util.NettyDataBufferUtils;
import reactor.core.publisher.Flux;
import reactor.netty.http.server.HttpServerRequest;
import we.util.NettyDataBufferUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

View File

@@ -15,15 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.spring.http.server.reactive.ext;
package com.fizzgate.spring.http.server.reactive.ext;
import org.reactivestreams.Publisher;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.PooledDataBuffer;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.http.server.reactive.ServerHttpResponseDecorator;
import com.fizzgate.util.NettyDataBufferUtils;
import reactor.core.publisher.Mono;
import we.util.NettyDataBufferUtils;
/**
* @author hongqiaowei

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.spring.web.server.ext;
package com.fizzgate.spring.web.server.ext;
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.ServerHttpRequest;
@@ -26,11 +26,13 @@ import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.ServerWebExchangeDecorator;
import com.fizzgate.spring.http.server.reactive.ext.FizzServerHttpRequestDecorator;
import com.fizzgate.util.Consts;
import com.fizzgate.util.NettyDataBufferUtils;
import com.fizzgate.util.ThreadContext;
import reactor.core.publisher.Mono;
import we.spring.http.server.reactive.ext.FizzServerHttpRequestDecorator;
import we.util.Consts;
import we.util.NettyDataBufferUtils;
import we.util.ThreadContext;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

View File

@@ -15,13 +15,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.apache.commons.lang3.SystemUtils;
/**
* @author hongqiaowei
* @deprecated and use {@link we.util.Consts} instead
* @deprecated and use {@link com.fizzgate.util.Consts} instead
*/
@Deprecated

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
/**
* @author hongqiaowei

View File

@@ -15,9 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
import we.util.Consts.DP;
package com.fizzgate.util;
import java.time.Instant;
import java.time.LocalDate;
@@ -31,34 +29,43 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import com.fizzgate.util.Consts.DP;
/**
* @author hongqiaowei
*/
public abstract class DateTimeUtils {
private static Map<String, DateTimeFormatter> dateTimeFormatters = new HashMap<>();
private static Map<String, DateTimeFormatter> dateTimeFormatterMap = new HashMap<>();
private static ZoneId defaultZone = ZoneId.systemDefault();
@Deprecated
private static final String zeroTimeSuffix = " 00:00:00.000";
private DateTimeUtils() {
}
public static DateTimeFormatter getDateTimeFormatter(String pattern) {
DateTimeFormatter f = dateTimeFormatters.get(pattern);
DateTimeFormatter f = dateTimeFormatterMap.get(pattern);
if (f == null) {
f = DateTimeFormatter.ofPattern(pattern);
dateTimeFormatters.put(pattern, f);
dateTimeFormatterMap.put(pattern, f);
}
return f;
}
public static long toMillis(LocalDate ld) {
LocalDateTime ldt = ld.atStartOfDay();
return toMillis(ldt);
}
public static long toMillis(LocalDateTime ldt) {
return ldt.atZone(defaultZone).toInstant().toEpochMilli();
}
@Deprecated
public static long toMillis(String dateTime, String... pattern) {
if (dateTime.length() == 10) {
dateTime += zeroTimeSuffix;
@@ -72,6 +79,12 @@ public abstract class DateTimeUtils {
return toMillis(ldt);
}
public static long toMillis(String dateTime, String pattern) {
DateTimeFormatter f = getDateTimeFormatter(pattern);
LocalDateTime ldt = LocalDateTime.parse(dateTime, f);
return toMillis(ldt);
}
public static LocalDate transform(Date date) {
return date.toInstant().atZone(defaultZone).toLocalDate();
}
@@ -96,6 +109,7 @@ public abstract class DateTimeUtils {
return Date.from(localDateTime.atZone(defaultZone).toInstant());
}
@Deprecated
public static String convert(long mills, String... pattern) {
String p = DP.DP10;
if (pattern.length != 0) {
@@ -106,6 +120,13 @@ public abstract class DateTimeUtils {
return ldt.format(f);
}
public static String convert(long mills, String pattern) {
LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(mills), defaultZone);
DateTimeFormatter f = getDateTimeFormatter(pattern);
return ldt.format(f);
}
@Deprecated
public static String convert(LocalDate date, String... pattern) {
String p = DP.DP10;
if (pattern.length != 0) {
@@ -115,6 +136,12 @@ public abstract class DateTimeUtils {
return date.format(f);
}
public static String convert(LocalDate date, String pattern) {
DateTimeFormatter f = getDateTimeFormatter(pattern);
return date.format(f);
}
@Deprecated
public static String convert(LocalDateTime localDateTime, String... pattern) {
String p = DP.DP23;
if (pattern.length != 0) {
@@ -124,6 +151,11 @@ public abstract class DateTimeUtils {
return localDateTime.format(f);
}
public static String convert(LocalDateTime localDateTime, String pattern) {
DateTimeFormatter f = getDateTimeFormatter(pattern);
return localDateTime.format(f);
}
public static List<String> datesBetween(String start, String end) {
LocalDate sd = LocalDate.parse(start);
LocalDate ed = LocalDate.parse(end);
@@ -146,7 +178,7 @@ public abstract class DateTimeUtils {
long numOfDaysBetween = ChronoUnit.DAYS.between(sd, ed);
return IntStream.iterate(0, i -> i + 1)
.limit(numOfDaysBetween)
.mapToObj(i -> sd.plusDays(i))
.mapToObj(sd::plusDays)
.collect(Collectors.toList());
}
@@ -155,19 +187,14 @@ public abstract class DateTimeUtils {
}
public static LocalDateTime beforeNowNoTime(long offsetDays) {
return LocalDate.now().minusDays(offsetDays).atTime(0, 0, 0, 0);
return LocalDate.now().minusDays(offsetDays).atStartOfDay();
}
@Deprecated
public static LocalDateTime time2zero(LocalDateTime ldt) {
return ldt.withHour(0).withMinute(0).withSecond(0).with(ChronoField.MILLI_OF_SECOND, 0);
}
public static boolean isSameDay(Date date1, Date date2) {
LocalDate localDate1 = date1.toInstant().atZone(defaultZone).toLocalDate();
LocalDate localDate2 = date2.toInstant().atZone(defaultZone).toLocalDate();
return localDate1.isEqual(localDate2);
}
public static long get10sTimeWinStart(int n) {
LocalDateTime now = LocalDateTime.now().with(ChronoField.MILLI_OF_SECOND, 0);
int sec = now.getSecond();

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.apache.commons.codec.binary.Hex;

View File

@@ -1,4 +1,4 @@
package we.util;
package com.fizzgate.util;
import java.io.File;
import java.util.Objects;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonFactory;
@@ -26,7 +26,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.TypeFactory;
import we.util.Consts.DP;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fizzgate.util.Consts.DP;
import java.io.IOException;
import java.time.LocalDate;
@@ -58,21 +59,24 @@ public abstract class JacksonUtils {
m.configure( DeserializationFeature. FAIL_ON_UNKNOWN_PROPERTIES, false);
m.configure( JsonParser.Feature. ALLOW_UNQUOTED_CONTROL_CHARS, true);
SimpleModule m0 = new SimpleModule();
m0.addDeserializer(Date.class, new DateDeseralizer());
m.registerModule(m0);
JavaTimeModule javaTimeModule = new JavaTimeModule();
m.registerModule(javaTimeModule);
SimpleModule m1 = new SimpleModule();
m1.addDeserializer(LocalDate.class, new LocalDateDeseralizer());
m.registerModule(m1);
SimpleModule m2 = new SimpleModule();
m2.addDeserializer(LocalDateTime.class, new LocalDateTimeDeseralizer());
m.registerModule(m2);
SimpleModule m3 = new SimpleModule();
m3.addSerializer(LocalDateTime.class, new LocalDateTimeSeralizer());
m.registerModule(m3);
// SimpleModule m0 = new SimpleModule();
// m0.addDeserializer(Date.class, new DateDeseralizer());
// m.registerModule(m0);
//
// SimpleModule m1 = new SimpleModule();
// m1.addDeserializer(LocalDate.class, new LocalDateDeseralizer());
// m.registerModule(m1);
//
// SimpleModule m2 = new SimpleModule();
// m2.addDeserializer(LocalDateTime.class, new LocalDateTimeDeseralizer());
// m.registerModule(m2);
//
// SimpleModule m3 = new SimpleModule();
// m3.addSerializer(LocalDateTime.class, new LocalDateTimeSeralizer());
// m.registerModule(m3);
}
private JacksonUtils() {
@@ -157,79 +161,79 @@ public abstract class JacksonUtils {
}
}
class DateDeseralizer extends JsonDeserializer<Date> {
public Date deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
String s = jp.getText();
int sl = s.length();
if (sl == DP.MILLS_LEN) {
return new Date(Long.parseLong(s));
} else {
String dtp = DP.DP10;
DateTimeFormatter dtf = null;
if (sl == DP.DP10.length()) {
} else if (sl == DP.DP14.length()) {
dtp = DP.DP14;
} else if (sl == DP.DP19.length()) {
dtp = DP.DP19;
} else if (sl == DP.DP23.length()) {
dtp = DP.DP23;
} else {
throw new IOException("invalid datetime pattern: " + s);
}
dtf = DateTimeUtils.getDateTimeFormatter(dtp);
LocalDateTime ldt = LocalDateTime.parse(s, dtf);
return DateTimeUtils.from(ldt);
}
}
}
class LocalDateDeseralizer extends JsonDeserializer<LocalDate> {
public LocalDate deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
String s = jp.getText();
if (s.length() == DP.DP10.length()) {
DateTimeFormatter dtf = DateTimeUtils.getDateTimeFormatter(DP.DP10);
return LocalDate.parse(s, dtf);
} else {
throw new IOException("invalid datetime pattern: " + s);
}
}
}
class LocalDateTimeDeseralizer extends JsonDeserializer<LocalDateTime> {
public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
String s = jp.getText();
int sl = s.length();
if (sl == DP.MILLS_LEN) {
return DateTimeUtils.transform(Long.parseLong(s));
} else {
String dtp = DP.DP10;
DateTimeFormatter dtf = null;
if (sl == DP.DP10.length()) {
} else if (sl == DP.DP14.length()) {
dtp = DP.DP14;
} else if (sl == DP.DP19.length()) {
dtp = DP.DP19;
} else if (sl == DP.DP23.length()) {
dtp = DP.DP23;
} else {
throw new IOException("invalid datetime pattern: " + s);
}
dtf = DateTimeUtils.getDateTimeFormatter(dtp);
return LocalDateTime.parse(s, dtf);
}
}
}
class LocalDateTimeSeralizer extends JsonSerializer<LocalDateTime> {
@Override
public void serialize(LocalDateTime ldt, JsonGenerator jg, SerializerProvider sp) throws IOException {
jg.writeNumber(DateTimeUtils.toMillis(ldt));
}
}
//class DateDeseralizer extends JsonDeserializer<Date> {
//
// public Date deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
//
// String s = jp.getText();
// int sl = s.length();
// if (sl == DP.MILLS_LEN) {
// return new Date(Long.parseLong(s));
// } else {
// String dtp = DP.DP10;
// DateTimeFormatter dtf = null;
// if (sl == DP.DP10.length()) {
// } else if (sl == DP.DP14.length()) {
// dtp = DP.DP14;
// } else if (sl == DP.DP19.length()) {
// dtp = DP.DP19;
// } else if (sl == DP.DP23.length()) {
// dtp = DP.DP23;
// } else {
// throw new IOException("invalid datetime pattern: " + s);
// }
// dtf = DateTimeUtils.getDateTimeFormatter(dtp);
// LocalDateTime ldt = LocalDateTime.parse(s, dtf);
// return DateTimeUtils.from(ldt);
// }
// }
//}
//
//class LocalDateDeseralizer extends JsonDeserializer<LocalDate> {
//
// public LocalDate deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
//
// String s = jp.getText();
// if (s.length() == DP.DP10.length()) {
// DateTimeFormatter dtf = DateTimeUtils.getDateTimeFormatter(DP.DP10);
// return LocalDate.parse(s, dtf);
// } else {
// throw new IOException("invalid datetime pattern: " + s);
// }
// }
//}
//
//class LocalDateTimeDeseralizer extends JsonDeserializer<LocalDateTime> {
//
// public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
//
// String s = jp.getText();
// int sl = s.length();
// if (sl == DP.MILLS_LEN) {
// return DateTimeUtils.transform(Long.parseLong(s));
// } else {
// String dtp = DP.DP10;
// DateTimeFormatter dtf = null;
// if (sl == DP.DP10.length()) {
// } else if (sl == DP.DP14.length()) {
// dtp = DP.DP14;
// } else if (sl == DP.DP19.length()) {
// dtp = DP.DP19;
// } else if (sl == DP.DP23.length()) {
// dtp = DP.DP23;
// } else {
// throw new IOException("invalid datetime pattern: " + s);
// }
// dtf = DateTimeUtils.getDateTimeFormatter(dtp);
// return LocalDateTime.parse(s, dtf);
// }
// }
//}
//
//class LocalDateTimeSeralizer extends JsonSerializer<LocalDateTime> {
//
// @Override
// public void serialize(LocalDateTime ldt, JsonGenerator jg, SerializerProvider sp) throws IOException {
// jg.writeNumber(DateTimeUtils.toMillis(ldt));
// }
//}

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -0,0 +1,16 @@
package com.fizzgate.util;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.time.LocalDate;
public class LocalDate2millsSerializer extends JsonSerializer<LocalDate> {
@Override
public void serialize(LocalDate ld, JsonGenerator jg, SerializerProvider sp) throws IOException {
jg.writeNumber(DateTimeUtils.toMillis(ld));
}
}

View File

@@ -0,0 +1,16 @@
package com.fizzgate.util;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.time.LocalDateTime;
public class LocalDateTime2millsSerializer extends JsonSerializer<LocalDateTime> {
@Override
public void serialize(LocalDateTime ldt, JsonGenerator jg, SerializerProvider sp) throws IOException {
jg.writeNumber(DateTimeUtils.toMillis(ldt));
}
}

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.util.ArrayList;
import java.util.Collection;

View File

@@ -0,0 +1,21 @@
package com.fizzgate.util;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class Mills2localDateDeserializer extends JsonDeserializer<LocalDate> {
public LocalDate deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
String text = jp.getText();
if (StringUtils.isBlank(text)) {
return null;
}
LocalDateTime ldt = DateTimeUtils.transform(Long.parseLong(text));
return ldt.toLocalDate();
}
}

View File

@@ -0,0 +1,19 @@
package com.fizzgate.util;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.time.LocalDateTime;
public class Mills2localDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
public LocalDateTime deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
String text = jp.getText();
if (StringUtils.isBlank(text)) {
return null;
}
return DateTimeUtils.transform(Long.parseLong(text));
}
}

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import io.netty.buffer.ByteBufAllocator;
import org.springframework.core.io.buffer.DataBuffer;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

View File

@@ -3,7 +3,7 @@
//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.
package we.util;
package com.fizzgate.util;
import org.bouncycastle.util.io.pem.PemObject;
import org.bouncycastle.util.io.pem.PemReader;

View File

@@ -1,4 +1,4 @@
package we.util;
package com.fizzgate.util;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.PropertyAccessor;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import io.lettuce.core.ClientOptions;
import io.lettuce.core.TimeoutOptions;
@@ -29,8 +29,9 @@ import org.springframework.data.redis.connection.lettuce.LettuceClientConfigurat
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import we.config.RedisReactiveConfig;
import we.config.RedisReactiveProperties;
import com.fizzgate.config.RedisReactiveConfig;
import com.fizzgate.config.RedisReactiveProperties;
import java.time.Duration;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.util.Collections;
import java.util.Map;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
/**
* @author hongqiaowei

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.ClassPathResource;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.util.Objects;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.RandomUtil;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.CharsetUtil;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.text.SimpleDateFormat;
import java.util.ArrayList;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.math.BigDecimal;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import java.util.UUID;

View File

@@ -1,4 +1,4 @@
package we.util;
package com.fizzgate.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.apache.commons.lang3.StringUtils;

View File

@@ -1,4 +1,4 @@
package we.util;
package com.fizzgate.util;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ByteArrayResource;

View File

@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package we.xml;
package com.fizzgate.xml;
import java.io.BufferedReader;
import java.io.FileInputStream;

View File

@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package we.xml;
package com.fizzgate.xml;
//import android.util.Xml;

View File

@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package we.xml;
package com.fizzgate.xml;
import java.util.ArrayList;

View File

@@ -1,4 +1,4 @@
package we.xml;
package com.fizzgate.xml;
/*
Copyright 2016 Arnaud Guyon

View File

@@ -1,4 +1,4 @@
package we.xml;
package com.fizzgate.xml;
/*
Copyright 2016 Arnaud Guyon

View File

@@ -1,90 +0,0 @@
///*
// * Copyright (C) 2020 the original author or authors.
// *
// * This program is free software: you can redistribute it and/or modify
// * it under the terms of the GNU General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or
// * any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see <https://www.gnu.org/licenses/>.
// */
//
//package we.flume.clients.log4j2appender;
//
//import java.text.SimpleDateFormat;
//import java.util.HashMap;
//import java.util.Map;
//
///** for internal use */
//public abstract class ThreadContext {
//
// private static ThreadLocal<Map<String, Object>> tl = new ThreadLocal<>();
// private static final int mapCap = 32;
//
// private static final String sb = "sb";
// private static final int sbCap = 256;
//
// public static StringBuilder getStringBuilder() {
// return getStringBuilder(true);
// }
//
// public static StringBuilder getStringBuilder(boolean clean) {
// Map<String, Object> m = getMap();
// StringBuilder b = (StringBuilder) m.get(sb);
// if (b == null) {
// b = new StringBuilder(sbCap);
// m.put(sb, b);
// } else {
// if (clean) {
// b.delete(0, b.length());
// }
// }
// return b;
// }
//
// public static SimpleDateFormat getSimpleDateFormat(String pattern) {
// Map<String, Object> m = getMap();
// SimpleDateFormat sdf = (SimpleDateFormat) m.get(pattern);
// if (sdf == null) {
// sdf = new SimpleDateFormat(pattern);
// m.put(pattern, sdf);
// }
// return sdf;
// }
//
// public static Object get(String key, Class<?> clz) {
// Object obj = get(key);
// if (obj == null) {
// try {
// obj = clz.newInstance();
// set(key, obj);
// } catch (InstantiationException | IllegalAccessException e) {
// throw new RuntimeException(e);
// }
// }
// return obj;
// }
//
// private static Map<String, Object> getMap() {
// Map<String, Object> m = tl.get();
// if (m == null) {
// m = new HashMap<>(mapCap);
// tl.set(m);
// }
// return m;
// }
//
// public static Object get(String key) {
// return getMap().get(key);
// }
//
// public static void set(String key, Object obj) {
// getMap().put(key, obj);
// }
//}

View File

@@ -1,4 +1,4 @@
package we;
package com.fizzgate;
import ognl.Ognl;
import org.junit.jupiter.api.Test;

View File

@@ -15,11 +15,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import org.junit.jupiter.api.Test;
import we.schema.util.I18nUtils;
import com.fizzgate.schema.util.I18nUtils;
import java.util.List;
import java.util.Locale;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.util;
package com.fizzgate.util;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -26,6 +26,8 @@ import java.util.Map;
import org.junit.jupiter.api.Test;
import com.fizzgate.util.MapUtil;
/**
*
* @author Francis Dong

View File

@@ -1,9 +1,12 @@
package we.util;
package com.fizzgate.util;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.fizzgate.util.SymmetricDecryptor;
import com.fizzgate.util.SymmetricEncryptor;
public class SymmetricCryptoTests {
@Test

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.xml;
package com.fizzgate.xml;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -23,6 +23,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import com.fizzgate.xml.JsonToXml;
import com.fizzgate.xml.XmlToJson;
public class XmlTests {
private String xmlStr = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<library>\n"

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -24,7 +24,7 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator-i18n-support</artifactId>
<version>1.0.39_5</version>
<version>1.0.39_6</version>
<scope>provided</scope>
</dependency>

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we;
package com.fizzgate;
import org.springframework.context.ConfigurableApplicationContext;

View File

@@ -15,12 +15,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we;
package com.fizzgate;
import org.springframework.context.ConfigurableApplicationContext;
/**
* @deprecated and use {@link we.Fizz} instead
* @deprecated and use {@link com.fizzgate.Fizz} instead
*/
@Deprecated

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.apollo;
package com.fizzgate.apollo;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;

View File

@@ -15,9 +15,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.beans.factory.config;
package com.fizzgate.beans.factory.config;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fizzgate.config.FizzConfigConfiguration;
import com.fizzgate.context.config.annotation.FizzRefreshScope;
import com.fizzgate.util.Consts;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.ReflectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
@@ -35,15 +39,10 @@ import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import we.config.FizzConfigConfiguration;
import we.config.RedisReactiveProperties;
import we.context.config.annotation.FizzRefreshScope;
import we.context.event.FizzRefreshEvent;
import we.util.*;
import java.util.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* @author hongqiaowei
@@ -53,7 +52,8 @@ public class FizzBeanFactoryPostProcessor implements BeanFactoryPostProcessor, E
private static final Logger LOGGER = LoggerFactory.getLogger(FizzBeanFactoryPostProcessor.class);
private ApplicationContext applicationContext;
private static ApplicationContext applicationContext;
private ConfigurableEnvironment environment;
@@ -61,17 +61,27 @@ public class FizzBeanFactoryPostProcessor implements BeanFactoryPostProcessor, E
private ReactiveStringRedisTemplate reactiveStringRedisTemplate;
protected static ApplicationContext getApplicationContext() {
return applicationContext;
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
String fizzConfigEnable = environment.getProperty("fizz.config.enable", Consts.S.TRUE);
if (fizzConfigEnable.equals(Consts.S.TRUE)) {
initReactiveStringRedisTemplate();
initFizzPropertySource();
// initReactiveStringRedisTemplate();
// initFizzPropertySource();
Map<String, Object> sources = FizzEnvironmentPostProcessor.getSources();
MapPropertySource fizzPropertySource = new MapPropertySource(FizzConfigConfiguration.PROPERTY_SOURCE + "AfterBeanFactory", sources);
environment.getPropertySources().addFirst(fizzPropertySource);
initBeanProperty2beanMap(beanFactory);
}
}
private void initReactiveStringRedisTemplate() {
/* private void initReactiveStringRedisTemplate() {
RedisReactiveProperties redisReactiveProperties = new RedisReactiveProperties() {
};
@@ -91,9 +101,9 @@ public class FizzBeanFactoryPostProcessor implements BeanFactoryPostProcessor, E
}
reactiveStringRedisTemplate = ReactiveRedisHelper.getStringRedisTemplate(redisReactiveProperties);
}
} */
private void initFizzPropertySource() {
/* private void initFizzPropertySource() {
MutablePropertySources propertySources = environment.getPropertySources();
Map<String, Object> sources = new HashMap<>();
MapPropertySource fizzPropertySource = new MapPropertySource(FizzConfigConfiguration.PROPERTY_SOURCE, sources);
@@ -190,7 +200,7 @@ public class FizzBeanFactoryPostProcessor implements BeanFactoryPostProcessor, E
if (result.code == Result.FAIL) {
throw new RuntimeException(result.msg, result.t);
}
}
} */
private void initBeanProperty2beanMap(ConfigurableListableBeanFactory beanFactory) {
ClassLoader beanClassLoader = beanFactory.getBeanClassLoader();

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.beans.factory.config;
package com.fizzgate.beans.factory.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -0,0 +1,209 @@
package com.fizzgate.beans.factory.config;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fizzgate.config.FizzConfigConfiguration;
import com.fizzgate.config.RedisReactiveProperties;
import com.fizzgate.context.event.FizzRefreshEvent;
import com.fizzgate.util.Consts;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.ReactiveRedisHelper;
import com.fizzgate.util.Result;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.logging.DeferredLog;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.SmartApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author hongqiaowei
*/
public class FizzEnvironmentPostProcessor implements EnvironmentPostProcessor, SmartApplicationListener, Ordered {
private static final DeferredLog LOGGER = new DeferredLog();
private static Logger LOG = null;
private static final Map<String, Object> sources = new HashMap<>();
private ConfigurableEnvironment environment;
private ReactiveStringRedisTemplate reactiveStringRedisTemplate;
protected static Map<String, Object> getSources() {
return sources;
}
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
}
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
String fizzConfigEnable = environment.getProperty("fizz.config.enable", Consts.S.TRUE);
if (fizzConfigEnable.equals(Consts.S.TRUE)) {
String host = environment.getProperty("aggregate.redis.host");
String clusterNodes = environment.getProperty("aggregate.redis.clusterNodes");
if (StringUtils.isNotBlank(host) || StringUtils.isNotBlank(clusterNodes)) {
this.environment = environment;
initReactiveStringRedisTemplate();
initFizzPropertySource();
}
}
}
private void initReactiveStringRedisTemplate() {
RedisReactiveProperties redisReactiveProperties = new RedisReactiveProperties() {
};
String host = environment.getProperty("aggregate.redis.host");
if (StringUtils.isBlank(host)) {
redisReactiveProperties.setType(RedisReactiveProperties.CLUSTER);
redisReactiveProperties.setClusterNodes(environment.getProperty("aggregate.redis.clusterNodes"));
} else {
redisReactiveProperties.setHost(host);
redisReactiveProperties.setPort(Integer.parseInt(environment.getProperty("aggregate.redis.port")));
redisReactiveProperties.setDatabase(Integer.parseInt(environment.getProperty("aggregate.redis.database")));
}
String password = environment.getProperty("aggregate.redis.password");
if (StringUtils.isNotBlank(password)) {
redisReactiveProperties.setPassword(password);
}
reactiveStringRedisTemplate = ReactiveRedisHelper.getStringRedisTemplate(redisReactiveProperties);
}
private void initFizzPropertySource() {
MutablePropertySources propertySources = environment.getPropertySources();
MapPropertySource fizzPropertySource = new MapPropertySource(FizzConfigConfiguration.PROPERTY_SOURCE + "AfterEnv", sources);
propertySources.addFirst(fizzPropertySource);
Result<?> result = Result.succ();
Flux<Map.Entry<Object, Object>> fizzConfigs = reactiveStringRedisTemplate.opsForHash().entries("fizz_config");
fizzConfigs.collectList()
.defaultIfEmpty(Collections.emptyList())
.flatMap(
es -> {
if (es.isEmpty()) {
LOGGER.info("no fizz configs");
} else {
String value = null;
try {
for (Map.Entry<Object, Object> e : es) {
String key = (String) e.getKey();
value = (String) e.getValue();
Map<String, Object> config = JacksonUtils.readValue(value, new TypeReference<Map<String, Object>>(){});
sources.put(key, config.get(key));
}
} catch (Throwable t) {
result.code = Result.FAIL;
result.msg = "init fizz configs error, json: " + value;
result.t = t;
}
}
return Mono.empty();
}
)
.onErrorReturn(
throwable -> {
result.code = Result.FAIL;
result.msg = "init fizz configs error";
result.t = throwable;
return true;
},
result
)
.block();
if (result.code == Result.FAIL) {
throw new RuntimeException(result.msg, result.t);
}
if (!sources.isEmpty()) {
LOGGER.info("fizz configs: " + JacksonUtils.writeValueAsString(sources));
}
String channel = "fizz_config_channel";
reactiveStringRedisTemplate.listenToChannel(channel)
.doOnError(
t -> {
result.code = Result.FAIL;
result.msg = "lsn " + channel + " channel error";
result.t = t;
LOGGER.error("lsn channel " + channel + " error", t);
}
)
.doOnSubscribe(
s -> {
LOGGER.info("success to lsn on " + channel);
}
)
.doOnNext(
msg -> {
if (LOG == null) {
LOG = LoggerFactory.getLogger(FizzEnvironmentPostProcessor.class);
}
String message = msg.getMessage();
try {
Map<String, Object> changedPropertyValueMap = new HashMap<>();
List<Map<String, Object>> changes = JacksonUtils.readValue(message, new TypeReference<List<Map<String, Object>>>(){});
for (Map<String, Object> change : changes) {
int isDeleted = (int) change.remove("isDeleted");
Map.Entry<String, Object> propertyValue = change.entrySet().iterator().next();
String property = propertyValue.getKey();
Object v = null;
if (isDeleted == 1) {
sources.remove(property);
} else {
v = propertyValue.getValue();
sources.put(property, v);
}
changedPropertyValueMap.put(property, v);
}
LOG.info("new fizz configs: " + JacksonUtils.writeValueAsString(sources));
ApplicationContext applicationContext = FizzBeanFactoryPostProcessor.getApplicationContext();
FizzRefreshEvent refreshEvent = new FizzRefreshEvent(applicationContext, FizzRefreshEvent.ENV_CHANGE, changedPropertyValueMap);
applicationContext.publishEvent(refreshEvent);
} catch (Throwable t) {
LOG.error("update fizz config " + message + " error", t);
}
}
)
.subscribe();
if (result.code == Result.FAIL) {
throw new RuntimeException(result.msg, result.t);
}
}
@Override
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
return ApplicationPreparedEvent.class.isAssignableFrom(eventType);
}
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (event instanceof ApplicationPreparedEvent) {
LOGGER.replayTo(FizzEnvironmentPostProcessor.class);
}
}
}

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -32,8 +32,11 @@ import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSeriali
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.session.data.redis.config.annotation.SpringSessionRedisConnectionFactory;
import we.log.LogSendAppender;
import we.log.RedisLogSendServiceImpl;
import com.fizzgate.config.RedisReactiveConfig;
import com.fizzgate.config.RedisReactiveProperties;
import com.fizzgate.log.LogSendAppender;
import com.fizzgate.log.RedisLogSendServiceImpl;
import javax.annotation.Resource;

View File

@@ -15,13 +15,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
import we.context.config.annotation.FizzRefreshScope;
import com.fizzgate.context.config.annotation.FizzRefreshScope;
/**
* {@link AggregateRedisConfig} properties

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

View File

@@ -15,13 +15,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import we.beans.factory.config.FizzBeanFactoryPostProcessor;
import we.context.event.FizzRefreshEventListener;
import we.context.scope.refresh.FizzRefreshScope;
import com.fizzgate.beans.factory.config.FizzBeanFactoryPostProcessor;
import com.fizzgate.context.event.FizzRefreshEventListener;
import com.fizzgate.context.scope.refresh.FizzRefreshScope;
import java.util.HashMap;
import java.util.Map;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,12 +27,14 @@ import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.CollectionUtils;
import we.stats.FlowStat;
import we.stats.ResourceTimeWindowStat;
import we.stats.TimeWindowStat;
import we.util.JacksonUtils;
import we.util.NetworkUtils;
import we.util.ResourceIdUtils;
import com.fizzgate.config.SchedConfig;
import com.fizzgate.stats.FlowStat;
import com.fizzgate.stats.ResourceTimeWindowStat;
import com.fizzgate.stats.TimeWindowStat;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.NetworkUtils;
import com.fizzgate.util.ResourceIdUtils;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;

View File

@@ -15,15 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import com.fizzgate.util.Consts;
import com.fizzgate.util.Result;
import reactor.core.publisher.Mono;
import we.util.Consts;
import we.util.Result;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;

View File

@@ -15,13 +15,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import we.stats.FlowStat;
import we.stats.circuitbreaker.CircuitBreakManager;
import com.fizzgate.stats.FlowStat;
import com.fizzgate.stats.circuitbreaker.CircuitBreakManager;
/**
* @author hongqiaowei

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -23,12 +23,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import we.stats.FlowStat;
import we.stats.ResourceTimeWindowStat;
import we.stats.TimeWindowStat;
import we.stats.ratelimit.ResourceRateLimitConfig;
import we.stats.ratelimit.ResourceRateLimitConfigService;
import we.util.*;
import com.fizzgate.config.SchedConfig;
import com.fizzgate.stats.FlowStat;
import com.fizzgate.stats.ResourceTimeWindowStat;
import com.fizzgate.stats.TimeWindowStat;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfig;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfigService;
import com.fizzgate.util.*;
import javax.annotation.Resource;
import java.math.BigDecimal;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

View File

@@ -0,0 +1,2 @@
package com.fizzgate.config;

View File

@@ -15,11 +15,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import we.plugin.auth.*;
import com.fizzgate.plugin.auth.*;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;

View File

@@ -15,13 +15,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
import com.fizzgate.config.WebClientConfig;
/**
* @author hongqiaowei
*/

View File

@@ -14,22 +14,23 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import we.fizz.ConfigLoader;
import we.plugin.auth.ApiConfig2appsService;
import we.plugin.auth.ApiConfigService;
import we.plugin.auth.AppService;
import we.plugin.auth.GatewayGroupService;
import we.proxy.RpcInstanceService;
import we.service_registry.RegistryCenterService;
import we.stats.degrade.DegradeRuleService;
import we.stats.ratelimit.ResourceRateLimitConfigService;
import we.util.Result;
import com.fizzgate.fizz.ConfigLoader;
import com.fizzgate.plugin.auth.ApiConfig2appsService;
import com.fizzgate.plugin.auth.ApiConfigService;
import com.fizzgate.plugin.auth.AppService;
import com.fizzgate.plugin.auth.GatewayGroupService;
import com.fizzgate.proxy.RpcInstanceService;
import com.fizzgate.service_registry.RegistryCenterService;
import com.fizzgate.stats.degrade.DegradeRuleService;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfigService;
import com.fizzgate.util.Result;
import javax.annotation.Resource;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

View File

@@ -15,19 +15,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import we.context.config.annotation.FizzRefreshScope;
import we.util.Consts;
import we.util.UUIDUtil;
import we.util.WebUtils;
import com.fizzgate.context.config.annotation.FizzRefreshScope;
import com.fizzgate.util.Consts;
import com.fizzgate.util.UUIDUtil;
import com.fizzgate.util.WebUtils;
import javax.annotation.PostConstruct;
import java.util.*;
@@ -44,7 +44,7 @@ public class SystemConfig {
private static final Logger log = LoggerFactory.getLogger(SystemConfig.class);
public static final String DEFAULT_GATEWAY_PREFIX = "/proxy";
public static final String DEFAULT_GATEWAY_PREFIX = "/";
public static final String DEFAULT_GATEWAY_TEST_PREFIX = "/_proxytest";
public static final String DEFAULT_GATEWAY_TEST = "_proxytest";
public static final String DEFAULT_GATEWAY_TEST_PREFIX0 = "/_proxytest/";
@@ -132,6 +132,20 @@ public class SystemConfig {
@Value("${fizz.fast-fail-when-registry-center-down:false}")
private boolean fastFailWhenRegistryCenterDown;
@Value("${fizz.web-client.x-forwarded-for.enable:true}")
private boolean fizzWebClientXForwardedForEnable;
@Value("${fizz.web-client.x-forwarded-for.append-gateway-ip:true}")
private boolean fizzWebClientXForwardedForAppendGatewayIp;
public boolean isFizzWebClientXForwardedForAppendGatewayIp() {
return fizzWebClientXForwardedForAppendGatewayIp;
}
public boolean isFizzWebClientXForwardedForEnable() {
return fizzWebClientXForwardedForEnable;
}
public boolean isFastFailWhenRegistryCenterDown() {
return fastFailWhenRegistryCenterDown;
}
@@ -203,7 +217,7 @@ public class SystemConfig {
return proxySetHeaders;
}
@Value("${gateway.prefix:/proxy}")
@Value("${gateway.prefix:/}")
public void setGatewayPrefix(String gp) {
gatewayPrefix = gp;
WebUtils.setGatewayPrefix(gatewayPrefix);

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.config;
package com.fizzgate.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

View File

@@ -15,11 +15,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.config.annotation;
package com.fizzgate.context.config.annotation;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import we.config.FizzConfigConfiguration;
import com.fizzgate.config.FizzConfigConfiguration;
import java.lang.annotation.*;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.event;
package com.fizzgate.context.event;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.SmartApplicationListener;

View File

@@ -15,10 +15,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.event;
package com.fizzgate.context.event;
import org.springframework.context.ApplicationEvent;
import we.util.JacksonUtils;
import com.fizzgate.util.JacksonUtils;
/**
* @author hongqiaowei

View File

@@ -15,16 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.event;
package com.fizzgate.context.event;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.SmartApplicationListener;
import we.beans.factory.config.FizzBeanFactoryPostProcessor;
import we.context.scope.refresh.FizzRefreshScope;
import we.util.JacksonUtils;
import com.fizzgate.beans.factory.config.FizzBeanFactoryPostProcessor;
import com.fizzgate.context.scope.refresh.FizzRefreshScope;
import com.fizzgate.util.JacksonUtils;
import java.util.HashMap;
import java.util.Map;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.scope.refresh;
package com.fizzgate.context.scope.refresh;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -28,7 +28,8 @@ import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.Ordered;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import we.config.FizzConfigConfiguration;
import com.fizzgate.config.FizzConfigConfiguration;
/**
* @author hongqiaowei

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.context.scope.refresh;
package com.fizzgate.context.scope.refresh;
import org.springframework.context.ApplicationEvent;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import org.openjdk.jol.info.GraphLayout;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,20 +23,22 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import com.fizzgate.global_resource.GlobalResourceService;
import com.fizzgate.plugin.auth.ApiConfig2appsService;
import com.fizzgate.plugin.auth.ApiConfigService;
import com.fizzgate.plugin.auth.AppService;
import com.fizzgate.plugin.auth.GatewayGroupService;
import com.fizzgate.stats.FlowStat;
import com.fizzgate.stats.ResourceStat;
import com.fizzgate.stats.circuitbreaker.CircuitBreakManager;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfig;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfigService;
import com.fizzgate.util.Consts;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.ResourceIdUtils;
import reactor.core.publisher.Mono;
import we.global_resource.GlobalResourceService;
import we.plugin.auth.ApiConfig2appsService;
import we.plugin.auth.ApiConfigService;
import we.plugin.auth.AppService;
import we.plugin.auth.GatewayGroupService;
import we.stats.FlowStat;
import we.stats.ResourceStat;
import we.stats.circuitbreaker.CircuitBreakManager;
import we.stats.ratelimit.ResourceRateLimitConfig;
import we.stats.ratelimit.ResourceRateLimitConfigService;
import we.util.Consts;
import we.util.JacksonUtils;
import we.util.ResourceIdUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,13 +26,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import com.fizzgate.proxy.CallbackReplayReq;
import com.fizzgate.proxy.CallbackService;
import com.fizzgate.util.Consts;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.Result;
import com.fizzgate.util.ThreadContext;
import reactor.core.publisher.Mono;
import we.proxy.CallbackReplayReq;
import we.proxy.CallbackService;
import we.util.Consts;
import we.util.JacksonUtils;
import we.util.Result;
import we.util.ThreadContext;
import javax.annotation.Resource;

View File

@@ -15,15 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import org.apache.commons.io.FileUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ServerWebExchange;
import com.fizzgate.fizz.ConfigLoader;
import com.fizzgate.util.ScriptUtils;
import reactor.core.publisher.Mono;
import we.fizz.ConfigLoader;
import we.util.ScriptUtils;
import javax.annotation.Resource;
import java.io.File;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,15 +27,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import com.fizzgate.stats.FlowStat;
import com.fizzgate.stats.ResourceTimeWindowStat;
import com.fizzgate.stats.TimeWindowStat;
import com.fizzgate.stats.ratelimit.ResourceRateLimitConfig;
import com.fizzgate.util.Consts;
import com.fizzgate.util.DateTimeUtils;
import com.fizzgate.util.JacksonUtils;
import com.fizzgate.util.ResourceIdUtils;
import reactor.core.publisher.Mono;
import we.stats.FlowStat;
import we.stats.ResourceTimeWindowStat;
import we.stats.TimeWindowStat;
import we.stats.ratelimit.ResourceRateLimitConfig;
import we.util.Consts;
import we.util.DateTimeUtils;
import we.util.JacksonUtils;
import we.util.ResourceIdUtils;
import java.math.BigDecimal;
import java.util.HashMap;

View File

@@ -15,15 +15,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import com.fizzgate.util.Consts;
import com.fizzgate.util.DateTimeUtils;
import reactor.core.publisher.Mono;
import we.util.Consts;
import we.util.DateTimeUtils;
/**
* @author hongqiaowei

View File

@@ -15,8 +15,25 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller;
package com.fizzgate.controller;
import com.fizzgate.controller.req.BaseManagerConfigReq;
import com.fizzgate.controller.req.GetApiConfigDetailReq;
import com.fizzgate.controller.req.GetApiConfigReq;
import com.fizzgate.controller.req.GetConfigReq;
import com.fizzgate.controller.req.GetConfigStrReq;
import com.fizzgate.controller.resp.ApiConfigInfo;
import com.fizzgate.controller.resp.ConfigResp;
import com.fizzgate.controller.resp.ConfigStrResp;
import com.fizzgate.controller.resp.GetApiConfigDetailResp;
import com.fizzgate.controller.resp.GetApiConfigResp;
import com.fizzgate.fizz.ConfigLoader;
import com.fizzgate.plugin.PluginConfig;
import com.fizzgate.plugin.auth.ApiConfig;
import com.fizzgate.plugin.auth.ApiConfig2appsService;
import com.fizzgate.plugin.auth.ApiConfigService;
import com.fizzgate.plugin.auth.GatewayGroup;
import com.fizzgate.plugin.auth.GatewayGroupService;
import com.google.common.collect.Sets;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
@@ -28,23 +45,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import we.controller.req.BaseManagerConfigReq;
import we.controller.req.GetApiConfigDetailReq;
import we.controller.req.GetApiConfigReq;
import we.controller.req.GetConfigReq;
import we.controller.req.GetConfigStrReq;
import we.controller.resp.ApiConfigInfo;
import we.controller.resp.ConfigResp;
import we.controller.resp.ConfigStrResp;
import we.controller.resp.GetApiConfigDetailResp;
import we.controller.resp.GetApiConfigResp;
import we.fizz.ConfigLoader;
import we.plugin.PluginConfig;
import we.plugin.auth.ApiConfig;
import we.plugin.auth.ApiConfig2appsService;
import we.plugin.auth.ApiConfigService;
import we.plugin.auth.GatewayGroup;
import we.plugin.auth.GatewayGroupService;
import javax.annotation.Resource;
import javax.validation.Valid;

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package we.controller.req;
package com.fizzgate.controller.req;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

Some files were not shown because too many files have changed in this diff Show More