🔖 Releasing / Version tags. 5.2

🔖 Releasing / Version tags. 5.2
This commit is contained in:
lbw committed 2023-09-13 10:28:40 +08:00
1 parent 95371f54a8
commit 2c6a700154
100 files changed
+507 -439

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-audit</artifactId>
+1 -1
View File
@@ -17,7 +17,7 @@
<description>pigx 公共版本控制</description>
<properties>
<pigx.version>5.2.0-snapshot</pigx.version>
<pigx.version>5.2.0</pigx.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
<mybatis-plus-join.version>1.4.5</mybatis-plus-join.version>
<dynamic-ds.version>4.1.3</dynamic-ds.version>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-core</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-data</artifactId>
@@ -44,8 +44,7 @@ public class DataScopeInnerInterceptor implements DataScopeInterceptor {
// 返回true 不拦截直接返回原始 SQL (只针对 COUNT 查询)
if (dataScopeHandle.calcScope(dataScope) && DataScopeFuncEnum.COUNT.equals(dataScope.getFunc())) {
mpBs.sql(String.format("SELECT %s FROM (%s) temp_data_scope",
dataScope.getFunc().getType(), originalSql));
mpBs.sql(String.format("SELECT %s FROM (%s) temp_data_scope", dataScope.getFunc().getType(), originalSql));
return;
}
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>pigx-common</artifactId>
<groupId>com.pig4cloud</groupId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-encrypt-api</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-excel</artifactId>
@@ -63,7 +63,7 @@ public class ResponseExcelAutoConfiguration {
@PostConstruct
public void setReturnValueHandlers() {
List<HandlerMethodReturnValueHandler> returnValueHandlers = requestMappingHandlerAdapter
.getReturnValueHandlers();
.getReturnValueHandlers();
List<HandlerMethodReturnValueHandler> newHandlers = new ArrayList<>();
newHandlers.add(responseExcelReturnValueHandler);
@@ -71,12 +71,16 @@ public class RequestExcelArgumentResolver implements HandlerMethodArgumentResolv
Class<?> excelModelClass = ResolvableType.forMethodParameter(parameter).getGeneric(0).resolve();
// 这里需要指定读用哪个 class 去读,然后读取第一个 sheet 文件流会自动关闭
EasyExcel.read(inputStream, excelModelClass, readListener).registerConverter(LocalDateStringConverter.INSTANCE)
.registerConverter(LocalTimeStringConverter.INSTANCE)
.registerConverter(LocalDateTimeStringConverter.INSTANCE)
.registerConverter(LongStringConverter.INSTANCE).registerConverter(StringArrayConverter.INSTANCE)
.ignoreEmptyRow(requestExcel.ignoreEmptyRow()).sheet().headRowNumber(requestExcel.headRowNumber())
.doRead();
EasyExcel.read(inputStream, excelModelClass, readListener)
.registerConverter(LocalDateStringConverter.INSTANCE)
.registerConverter(LocalTimeStringConverter.INSTANCE)
.registerConverter(LocalDateTimeStringConverter.INSTANCE)
.registerConverter(LongStringConverter.INSTANCE)
.registerConverter(StringArrayConverter.INSTANCE)
.ignoreEmptyRow(requestExcel.ignoreEmptyRow())
.sheet()
.headRowNumber(requestExcel.headRowNumber())
.doRead();
// 校验失败的数据处理 交给 BindResult
WebDataBinder dataBinder = webDataBinderFactory.createBinder(webRequest, readListener.getErrors(), "excel");
@@ -51,8 +51,10 @@ public class ResponseExcelReturnValueHandler implements HandlerMethodReturnValue
Assert.state(responseExcel != null, "No @ResponseExcel");
mavContainer.setRequestHandled(true);
sheetWriteHandlerList.stream().filter(handler -> handler.support(o)).findFirst()
.ifPresent(handler -> handler.export(o, response, responseExcel));
sheetWriteHandlerList.stream()
.filter(handler -> handler.support(o))
.findFirst()
.ifPresent(handler -> handler.export(o, response, responseExcel));
}
}
@@ -41,7 +41,7 @@ public enum LocalDateStringConverter implements Converter<LocalDate> {
}
else {
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern(contentProperty.getDateTimeFormatProperty().getFormat());
.ofPattern(contentProperty.getDateTimeFormatProperty().getFormat());
return LocalDate.parse(cellData.getStringValue(), formatter);
}
}
@@ -41,7 +41,7 @@ public enum LocalTimeStringConverter implements Converter<LocalTime> {
}
else {
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern(contentProperty.getDateTimeFormatProperty().getFormat());
.ofPattern(contentProperty.getDateTimeFormatProperty().getFormat());
return LocalTime.parse(cellData.getStringValue(), formatter);
}
}
@@ -81,15 +81,16 @@ public abstract class AbstractSheetWriteHandler implements SheetWriteHandler, Ap
public void export(Object o, HttpServletResponse response, ResponseExcel responseExcel) {
check(responseExcel);
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
String name = (String) Objects.requireNonNull(requestAttributes).getAttribute(DynamicNameAspect.EXCEL_NAME_KEY,
RequestAttributes.SCOPE_REQUEST);
String name = (String) Objects.requireNonNull(requestAttributes)
.getAttribute(DynamicNameAspect.EXCEL_NAME_KEY, RequestAttributes.SCOPE_REQUEST);
if (name == null) {
name = UUID.randomUUID().toString();
}
String fileName = String.format("%s%s", URLEncoder.encode(name, "UTF-8"), responseExcel.suffix().getValue());
// 根据实际的文件类型找到对应的 contentType
String contentType = MediaTypeFactory.getMediaType(fileName).map(MediaType::toString)
.orElse("application/vnd.ms-excel");
String contentType = MediaTypeFactory.getMediaType(fileName)
.map(MediaType::toString)
.orElse("application/vnd.ms-excel");
response.setContentType(contentType);
response.setCharacterEncoding("utf-8");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename*=utf-8''" + fileName);
@@ -105,11 +106,14 @@ public abstract class AbstractSheetWriteHandler implements SheetWriteHandler, Ap
@SneakyThrows(IOException.class)
public ExcelWriter getExcelWriter(HttpServletResponse response, ResponseExcel responseExcel) {
ExcelWriterBuilder writerBuilder = EasyExcel.write(response.getOutputStream())
.registerConverter(LocalTimeStringConverter.INSTANCE)
.registerConverter(LocalDateStringConverter.INSTANCE)
.registerConverter(LocalDateTimeStringConverter.INSTANCE)
.registerConverter(LongStringConverter.INSTANCE).registerConverter(StringArrayConverter.INSTANCE)
.autoCloseStream(true).excelType(responseExcel.suffix()).inMemory(responseExcel.inMemory());
.registerConverter(LocalTimeStringConverter.INSTANCE)
.registerConverter(LocalDateStringConverter.INSTANCE)
.registerConverter(LocalDateTimeStringConverter.INSTANCE)
.registerConverter(LongStringConverter.INSTANCE)
.registerConverter(StringArrayConverter.INSTANCE)
.autoCloseStream(true)
.excelType(responseExcel.suffix())
.inMemory(responseExcel.inMemory());
if (StringUtils.hasText(responseExcel.password())) {
writerBuilder.password(responseExcel.password());
@@ -35,8 +35,9 @@ public class DefaultAnalysisEventListener extends ListAnalysisEventListener<Obje
Set<ConstraintViolation<Object>> violations = Validators.validate(o);
if (!violations.isEmpty()) {
Set<String> messageSet = violations.stream().map(ConstraintViolation::getMessage)
.collect(Collectors.toSet());
Set<String> messageSet = violations.stream()
.map(ConstraintViolation::getMessage)
.collect(Collectors.toSet());
errorMessageList.add(new ErrorMessage(lineNum, messageSet));
}
else {
@@ -51,8 +51,8 @@ public class I18nHeaderCellWriteHandler implements CellWriteHandler {
if (CollectionUtils.isNotEmpty(originHeadNameList)) {
// 国际化处理
List<String> i18nHeadNames = originHeadNameList.stream()
.map(headName -> propertyPlaceholderHelper.replacePlaceholders(headName, placeholderResolver))
.collect(Collectors.toList());
.map(headName -> propertyPlaceholderHelper.replacePlaceholders(headName, placeholderResolver))
.collect(Collectors.toList());
head.setHeadNameList(i18nHeadNames);
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -91,7 +91,8 @@ public class PigxFeignClientsRegistrar
continue;
}
registerClientConfiguration(registry, getClientName(attributes), className, attributes.get("configuration"));
registerClientConfiguration(registry, getClientName(attributes), className,
attributes.get("configuration"));
validate(attributes);
BeanDefinitionBuilder definition = BeanDefinitionBuilder
@@ -255,7 +256,7 @@ public class PigxFeignClientsRegistrar
}
private void registerClientConfiguration(BeanDefinitionRegistry registry, Object name, Object className,
Object configuration) {
Object configuration) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(FeignClientSpecification.class);
builder.addConstructorArgValue(name);
builder.addConstructorArgValue(className);
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-gateway</artifactId>
@@ -65,8 +65,8 @@ public class VersionGrayLoadBalancer implements GrayLoadBalancer {
if (StrUtil.isBlank(reqVersion)) {
// 过滤出不含VERSION实例
List<ServiceInstance> versionInstanceList = instances.stream()
.filter(instance -> !instance.getMetadata().containsKey(CommonConstants.VERSION))
.collect(Collectors.toList());
.filter(instance -> !instance.getMetadata().containsKey(CommonConstants.VERSION))
.collect(Collectors.toList());
if (CollUtil.isEmpty(versionInstanceList)) {
// 根据权重获取实例
return randomByWeight(instances);
@@ -76,9 +76,9 @@ public class VersionGrayLoadBalancer implements GrayLoadBalancer {
}
// 遍历可以实例元数据,若匹配则返回此实例
List<ServiceInstance> availableList = instances.stream()
.filter(instance -> reqVersion
.equalsIgnoreCase(MapUtil.getStr(instance.getMetadata(), CommonConstants.VERSION)))
.collect(Collectors.toList());
.filter(instance -> reqVersion
.equalsIgnoreCase(MapUtil.getStr(instance.getMetadata(), CommonConstants.VERSION)))
.collect(Collectors.toList());
if (CollUtil.isEmpty(availableList)) {
// 根据权重获取实例
return randomByWeight(instances);
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-gray</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-idempotent</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-job</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-log</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-oss</artifactId>
+1 -1
View File
@@ -23,7 +23,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-seata</artifactId>
+1 -1
View File
@@ -23,7 +23,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-security</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-sequence</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-swagger</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-websocket</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common-xss</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>5.2.0-snapshot</version>
<version>5.2.0</version>
</parent>
<artifactId>pigx-common</artifactId>