Skip to content

Commit

Permalink
perf: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Jun 26, 2021
1 parent 7d7284c commit 6f55581
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
19 changes: 8 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,29 @@
<!-- Business Service. Port range: [8800, n]. -->
<auth-center.port>8800</auth-center.port>
<maf-mis.port>8801</maf-mis.port>
<muscle-mis.port>8802</muscle-mis.port>

<!-- Gateway Service. Port range: [8080, 8080]. -->
<api-gateway.port>8080</api-gateway.port>

<!-- Version Definitions. -->
<java.version>11</java.version>
<adoptopenjdk11.tag>x86_64-alpine-jre-11.0.10_9</adoptopenjdk11.tag>
<jib-maven-plugin.version>2.8.0</jib-maven-plugin.version>
<jib-maven-plugin.version>3.1.1</jib-maven-plugin.version>
<spring-cloud.version>2020.0.3</spring-cloud.version>
<spring-content.version>1.0.0.M5</spring-content.version>
<spring-boot-admin-starter-server.version>2.4.0</spring-boot-admin-starter-server.version>
<spring-boot-admin-starter-client.version>2.4.0</spring-boot-admin-starter-client.version>
<druid-spring-boot-starter.version>1.2.5</druid-spring-boot-starter.version>
<mybatis-plus-boot-starter.version>3.4.2</mybatis-plus-boot-starter.version>
<hutool-all.version>5.6.6</hutool-all.version>
<spring-boot-admin-starter-server.version>2.4.1</spring-boot-admin-starter-server.version>
<spring-boot-admin-starter-client.version>2.4.1</spring-boot-admin-starter-client.version>
<druid-spring-boot-starter.version>1.2.6</druid-spring-boot-starter.version>
<mybatis-plus-boot-starter.version>3.4.3.1</mybatis-plus-boot-starter.version>
<hutool-all.version>5.7.2</hutool-all.version>
<guava.version>30.0-jre</guava.version>
<knife4j.version>2.0.8</knife4j.version>
<jjwt.version>0.11.2</jjwt.version>
<java-faker.version>1.0.2</java-faker.version>
<easyexcel.version>2.2.6</easyexcel.version>
<poi.version>5.0.0</poi.version>
<logstash-logback-encoder.version>6.6</logstash-logback-encoder.version>
<minio.version>8.2.1</minio.version>
<minio.version>8.2.2</minio.version>
<apache-tika.version>1.26</apache-tika.version>
</properties>

Expand All @@ -65,8 +64,8 @@
<module>spring-boot-admin</module>
<module>api-gateway</module>
<module>auth-center</module>
<module>maf-mis</module>
<module>static-resource-center</module>
<module>maf-mis</module>
</modules>

<parent>
Expand Down Expand Up @@ -159,13 +158,11 @@
</developer>
</developers>

<!-- VCS Settings -->
<issueManagement>
<system>GitHub</system>
<url>https://github.com/johnnymillergh/muscle-and-fitness-server/issues</url>
</issueManagement>

<!-- Build Settings -->
<build>
<!-- set the name of .jar file -->
<finalName>${project.artifactId}-${project.version}</finalName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.jmsoftware.maf.springcloudstarter.database;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
Expand Down Expand Up @@ -34,14 +33,6 @@ public BlockAttackInnerInterceptor blockAttackInnerInterceptor() {
return new BlockAttackInnerInterceptor();
}

@Bean
public ConfigurationCustomizer configurationCustomizer() {
log.warn("Initial bean: '{}'", ConfigurationCustomizer.class.getSimpleName());
// 新的分页插件,一缓和二缓遵循 MyBatis 的规则。
// 需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除)
return configuration -> configuration.setUseDeprecatedExecutor(false);
}

/**
* Mybatis plus interceptor mybatis plus interceptor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Maps;
import com.jmsoftware.maf.springcloudstarter.annotation.TreeElement;

import java.beans.BeanInfo;
Expand All @@ -21,6 +22,7 @@
*
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 5/28/2021 4:27 PM
*/
@SuppressWarnings("unused")
public class TreeUtil {
/**
* Convert List to Tree
Expand All @@ -37,16 +39,14 @@ public static <T> List<T> listToTree(List<T> list, String rootNode) throws Illeg
IntrospectionException, InvocationTargetException {
// Root node collection
List<T> rootList = new ArrayList<>();
HashMap<Object, List<T>> parentIdToTree = CollUtil.newHashMap(list.size());
HashMap<Object, List<T>> parentIdToTree = Maps.newHashMap();
for (final T t : list) {
Object value = getValue(t, TreeElementType.PARENT_ID);
if (ObjectUtil.isNotNull(value)) {
if (ObjectUtil.isNotNull(parentIdToTree.get(value))) {
parentIdToTree.get(value).add(t);
} else {
parentIdToTree.put(value, new ArrayList<>() {{
this.add(t);
}});
parentIdToTree.put(value, CollUtil.newArrayList(t));
}
if (rootNode.equals(value)) {
rootList.add(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
**/
@Slf4j
public class DateTimeRangeValidator implements ConstraintValidator<DateTimeRangeConstraints, Object> {
private static final int DEFAULT_HASH_MAP_CAPACITY = 8;
public static final int MAX_GROUP_SIZE = 2;

@Override
Expand All @@ -40,15 +41,16 @@ public boolean isValid(Object value, ConstraintValidatorContext context) {
DateTimeRangeGroup.class.getSimpleName());
return true;
}
final HashMap<String, LinkedList<Field>> dateTimeRangeGroupMap = CollUtil.newHashMap(fields.length);
final HashMap<String, LinkedList<Field>> dateTimeRangeGroupMap = new HashMap<>(DEFAULT_HASH_MAP_CAPACITY);
for (val field : annotatedFieldSet) {
val annotation = field.getAnnotation(DateTimeRangeGroup.class);
if (!dateTimeRangeGroupMap.containsKey(annotation.groupName())) {
dateTimeRangeGroupMap.put(annotation.groupName(), CollUtil.newLinkedList(field));
} else {
dateTimeRangeGroupMap.get(annotation.groupName()).add(field);
if (dateTimeRangeGroupMap.get(annotation.groupName()).size() > MAX_GROUP_SIZE) {
log.error("The length of DateTimeRangeGroup({}) cannot exceed {}!", annotation.groupName(), MAX_GROUP_SIZE);
log.error("The length of DateTimeRangeGroup({}) cannot exceed {}!", annotation.groupName(),
MAX_GROUP_SIZE);
return false;
}
}
Expand Down

0 comments on commit 6f55581

Please sign in to comment.