Merge remote-tracking branch 'origin/develop' into wh/expression_utils
# Conflicts: # pom.xml # spring-boot-nebula-dependencies/pom.xml # spring-boot-nebula-web-common/src/main/java/com/nebula/web/common/utils/ExpressionUtil.java
This commit is contained in:
commit
3349fa1a44
|
@ -4,9 +4,11 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
junit:
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<profiles version="13">
|
||||
<profile kind="CodeFormatterProfile" name="'ShardingSphere Apache Current'" version="13">
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="true" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="200" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="200" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="1" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="160" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="10" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="106" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="106" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="106" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent" value="16|5|80" />
|
||||
</profile>
|
||||
</profiles>
|
139
pom.xml
139
pom.xml
|
@ -1,13 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.github.weihubeats</groupId>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>${revision}</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>spring-boot-nebula</name>
|
||||
<description>spring-boot-common</description>
|
||||
|
||||
<modules>
|
||||
<module>spring-boot-nebula-web</module>
|
||||
|
@ -22,29 +24,15 @@
|
|||
<module>spring-boot-nebula-all</module>
|
||||
</modules>
|
||||
|
||||
<name>spring-boot-nebula</name>
|
||||
<description>spring-boot-common</description>
|
||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
||||
|
||||
|
||||
<properties>
|
||||
<revision>0.0.01</revision>
|
||||
<flatten-maven-plugin.version>1.2.7</flatten-maven-plugin.version>
|
||||
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -57,35 +45,6 @@
|
|||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>weihubeats</name>
|
||||
<email>weihu@apche.org</email>
|
||||
<organization>https://weihubeats.blog.csdn.net/</organization>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git@github.com:weihubeats/spring-boot-common.git</connection>
|
||||
<developerConnection>scm:git@github.com:weihubeats/spring-boot-common.git</developerConnection>
|
||||
<url>git@github.com:weihubeats/spring-boot-common.git</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issue</system>
|
||||
<url>https://github.com/weihubeats/spring-boot-common/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -118,10 +77,10 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -143,10 +102,10 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -158,10 +117,10 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -177,32 +136,100 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
<phase>process-resources</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
<phase>clean</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>${spotless-maven-plugin.version}</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<eclipse>
|
||||
<file>${maven.multiModuleProjectDirectory}/dev-support/spotless_nebula_formatter.xml</file>
|
||||
</eclipse>
|
||||
<licenseHeader>
|
||||
<file>${maven.multiModuleProjectDirectory}/dev-support/license-header</file>
|
||||
</licenseHeader>
|
||||
</java>
|
||||
<pom>
|
||||
<sortPom>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nrOfIndentSpace>4</nrOfIndentSpace>
|
||||
<keepBlankLines>true</keepBlankLines>
|
||||
<indentBlankLines>false</indentBlankLines>
|
||||
<indentSchemaLocation>true</indentSchemaLocation>
|
||||
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
|
||||
<sortModules>false</sortModules>
|
||||
<sortExecutions>false</sortExecutions>
|
||||
<predefinedSortOrder>custom_1</predefinedSortOrder>
|
||||
<expandEmptyElements>false</expandEmptyElements>
|
||||
<sortProperties>false</sortProperties>
|
||||
</sortPom>
|
||||
</pom>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>apply</goal>
|
||||
</goals>
|
||||
<phase>compile</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>weihubeats</name>
|
||||
<email>weihu@apche.org</email>
|
||||
<organization>https://weihubeats.blog.csdn.net/</organization>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git@github.com:weihubeats/spring-boot-common.git</connection>
|
||||
<developerConnection>scm:git@github.com:weihubeats/spring-boot-common.git</developerConnection>
|
||||
<url>git@github.com:weihubeats/spring-boot-common.git</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issue</system>
|
||||
<url>https://github.com/weihubeats/spring-boot-common/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -11,7 +10,6 @@
|
|||
|
||||
<artifactId>spring-boot-nebula-aggregate</artifactId>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.annotation;
|
||||
|
||||
import com.nebula.aggregate.core.AbstractOldObj;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.core;
|
||||
|
||||
/**
|
||||
|
@ -7,4 +24,3 @@ package com.nebula.aggregate.core;
|
|||
*/
|
||||
public abstract class AbstractAggregate<T> extends AbstractOldObj<T> {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.core;
|
||||
|
||||
import org.javers.core.metamodel.annotation.DiffIgnore;
|
||||
|
@ -12,7 +29,6 @@ public abstract class AbstractOldObj<T> {
|
|||
@DiffIgnore
|
||||
private T oldObject;
|
||||
|
||||
|
||||
public void setOldObject(T oldObject) {
|
||||
this.oldObject = oldObject;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aggregate.core;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -34,8 +33,6 @@
|
|||
<artifactId>spring-boot-nebula-distribute-lock</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.aop.base;
|
||||
|
||||
import lombok.NonNull;
|
||||
|
@ -87,6 +104,7 @@ public class NebulaBaseAnnotationAdvisor extends AbstractPointcutAdvisor impleme
|
|||
}
|
||||
|
||||
private static class AnnotationMethodMatcher extends StaticMethodMatcher {
|
||||
|
||||
private final Class<? extends Annotation> annotationType;
|
||||
|
||||
public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<groupId>io.github.weihubeats</groupId>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>spring-boot-nebula-common</artifactId>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
|
@ -66,8 +64,6 @@
|
|||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.exception;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
|
@ -9,7 +26,6 @@ import java.lang.reflect.Array;
|
|||
*/
|
||||
public class ArraysUtil {
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- wrap
|
||||
|
||||
/**
|
||||
|
@ -76,7 +92,6 @@ public class ArraysUtil {
|
|||
return elements;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- join
|
||||
|
||||
/**
|
||||
|
@ -110,7 +125,6 @@ public class ArraysUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Join <code>String</code> arrays.
|
||||
*/
|
||||
|
@ -318,7 +332,6 @@ public class ArraysUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- resize
|
||||
|
||||
/**
|
||||
|
@ -331,7 +344,6 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resizes a <code>String</code> array.
|
||||
*/
|
||||
|
@ -413,7 +425,6 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- append
|
||||
|
||||
/**
|
||||
|
@ -506,7 +517,6 @@ public class ArraysUtil {
|
|||
return t;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- remove
|
||||
|
||||
/**
|
||||
|
@ -628,7 +638,6 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- subarray
|
||||
|
||||
/**
|
||||
|
@ -730,7 +739,6 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- insert
|
||||
|
||||
/**
|
||||
|
@ -969,7 +977,6 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- insertAt
|
||||
|
||||
/**
|
||||
|
@ -1091,10 +1098,8 @@ public class ArraysUtil {
|
|||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- convert
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1119,7 +1124,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1144,7 +1148,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1169,7 +1172,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1194,7 +1196,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1219,7 +1220,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1244,7 +1244,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1269,7 +1268,6 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts to primitive array.
|
||||
*/
|
||||
|
@ -1294,11 +1292,8 @@ public class ArraysUtil {
|
|||
return dest;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- indexof
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence of an element in an array.
|
||||
*/
|
||||
|
@ -1651,12 +1646,8 @@ public class ArraysUtil {
|
|||
return indexOf(array, value, startIndex) != -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- indexof 2
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array.
|
||||
*/
|
||||
|
@ -1667,7 +1658,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1685,8 +1675,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final byte c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1696,7 +1685,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1713,7 +1703,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1731,8 +1720,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final char c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1742,7 +1730,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1759,7 +1748,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1777,8 +1765,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final short c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1788,7 +1775,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1805,7 +1793,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1823,8 +1810,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final int c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1834,7 +1820,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1851,7 +1838,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1869,8 +1855,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final long c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1880,7 +1865,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1897,7 +1883,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1915,8 +1900,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final boolean c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (array[i] != c) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1926,7 +1910,8 @@ public class ArraysUtil {
|
|||
if (sub[j] != array[k]) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1943,7 +1928,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -1961,8 +1945,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final float c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (Float.compare(array[i], c) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1972,7 +1955,8 @@ public class ArraysUtil {
|
|||
if (Float.compare(sub[j], array[k]) != 0) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -1989,7 +1973,6 @@ public class ArraysUtil {
|
|||
return indexOf(array, sub) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the first occurrence in an array from specified given position.
|
||||
*/
|
||||
|
@ -2007,8 +1990,7 @@ public class ArraysUtil {
|
|||
}
|
||||
final int total = endIndex - sublen + 1;
|
||||
final double c = sub[0];
|
||||
mainloop:
|
||||
for (int i = startIndex; i < total; i++) {
|
||||
mainloop: for (int i = startIndex; i < total; i++) {
|
||||
if (Double.compare(array[i], c) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -2018,14 +2000,14 @@ public class ArraysUtil {
|
|||
if (Double.compare(sub[j], array[k]) != 0) {
|
||||
continue mainloop;
|
||||
}
|
||||
j++; k++;
|
||||
j++;
|
||||
k++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- toString
|
||||
|
||||
/**
|
||||
|
@ -2238,7 +2220,6 @@ public class ArraysUtil {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts an array to string array.
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.nebula.base.utils.io.IOUtil;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -281,8 +298,7 @@ public class ClassUtil {
|
|||
}
|
||||
}
|
||||
top = false;
|
||||
}
|
||||
while ((clazz = clazz.getSuperclass()) != limit);
|
||||
} while ((clazz = clazz.getSuperclass()) != limit);
|
||||
|
||||
final Method[] methods = new Method[methodList.size()];
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
|
@ -341,8 +357,7 @@ public class ClassUtil {
|
|||
}
|
||||
}
|
||||
top = false;
|
||||
}
|
||||
while ((clazz = clazz.getSuperclass()) != limit);
|
||||
} while ((clazz = clazz.getSuperclass()) != limit);
|
||||
|
||||
final Field[] fields = new Field[fieldList.size()];
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
|
@ -1107,6 +1122,7 @@ public class ClassUtil {
|
|||
// ---------------------------------------------------------------- caller
|
||||
|
||||
private static class ReflectUtilSecurityManager extends SecurityManager {
|
||||
|
||||
public Class getCallerClass(final int callStackDepth) {
|
||||
return getClassContext()[callStackDepth + 1];
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.nebula.base.utils.io.IOUtil;
|
||||
|
@ -47,8 +64,7 @@ public interface DigestEngine {
|
|||
|
||||
while (dis.read() != -1) {
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
IOUtil.close(dis);
|
||||
IOUtil.close(bis);
|
||||
IOUtil.close(fis);
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
|
@ -17,7 +34,6 @@ import java.time.LocalTime;
|
|||
*/
|
||||
public class JacksonTimeModule extends SimpleModule {
|
||||
|
||||
|
||||
public JacksonTimeModule() {
|
||||
super(PackageVersion.VERSION);
|
||||
this.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(TimeUtil.DATETIME_FORMAT));
|
||||
|
@ -28,5 +44,4 @@ public class JacksonTimeModule extends SimpleModule {
|
|||
this.addSerializer(LocalTime.class, new LocalTimeSerializer(TimeUtil.TIME_FORMAT));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
@ -33,8 +50,7 @@ public class JsonUtil {
|
|||
public static <T> String toJSONString(T value) {
|
||||
try {
|
||||
return getInstance().writeValueAsString(value);
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
|
@ -43,8 +59,7 @@ public class JsonUtil {
|
|||
public static <T> String toJSONString(ObjectMapper objectMapper, T value) {
|
||||
try {
|
||||
return objectMapper.writeValueAsString(value);
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
|
@ -70,8 +85,7 @@ public class JsonUtil {
|
|||
public static byte[] toJsonAsBytes(Object object) {
|
||||
try {
|
||||
return getInstance().writeValueAsBytes(object);
|
||||
}
|
||||
catch (JsonProcessingException e) {
|
||||
} catch (JsonProcessingException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -87,8 +101,7 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(String content, Class<T> valueType) {
|
||||
try {
|
||||
return getInstance().readValue(content, valueType);
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
|
@ -105,8 +118,7 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(String content, TypeReference<T> typeReference) {
|
||||
try {
|
||||
return getInstance().readValue(content, typeReference);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -122,13 +134,11 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(byte[] bytes, Class<T> valueType) {
|
||||
try {
|
||||
return getInstance().readValue(bytes, valueType);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将json反序列化成对象
|
||||
*
|
||||
|
@ -140,8 +150,7 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(byte[] bytes, TypeReference<T> typeReference) {
|
||||
try {
|
||||
return getInstance().readValue(bytes, typeReference);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -157,8 +166,7 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(InputStream in, Class<T> valueType) {
|
||||
try {
|
||||
return getInstance().readValue(in, valueType);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -174,8 +182,7 @@ public class JsonUtil {
|
|||
public static <T> T json2JavaBean(InputStream in, TypeReference<T> typeReference) {
|
||||
try {
|
||||
return getInstance().readValue(in, typeReference);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -188,8 +195,7 @@ public class JsonUtil {
|
|||
JavaType javaType = getInstance().getTypeFactory().constructParametricType(List.class, valueTypeRef);
|
||||
try {
|
||||
return getInstance().readValue(json, javaType);
|
||||
}
|
||||
catch (JsonProcessingException e) {
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return objectList;
|
||||
|
@ -200,14 +206,12 @@ public class JsonUtil {
|
|||
List<T> objectList = Collections.emptyList();
|
||||
try {
|
||||
return reader.readValue(jsonNode);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return objectList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* json to Map
|
||||
* @param content
|
||||
|
@ -216,8 +220,7 @@ public class JsonUtil {
|
|||
public static Map<String, Object> json2Map(String content) {
|
||||
try {
|
||||
return getInstance().readValue(content, Map.class);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
|
@ -232,8 +235,7 @@ public class JsonUtil {
|
|||
result.put(entry.getKey(), toPojo(entry.getValue(), valueTypeRef));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
|
@ -252,8 +254,7 @@ public class JsonUtil {
|
|||
public static JsonNode json2JsonNode(String jsonString) {
|
||||
try {
|
||||
return getInstance().readTree(jsonString);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -266,8 +267,7 @@ public class JsonUtil {
|
|||
public static String jsonNodeToString(JsonNode jsonNode) {
|
||||
try {
|
||||
return getInstance().writeValueAsString(jsonNode);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -281,8 +281,7 @@ public class JsonUtil {
|
|||
public static JsonNode byte2JsonNode(byte[] content) {
|
||||
try {
|
||||
return getInstance().readTree(content);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -296,8 +295,7 @@ public class JsonUtil {
|
|||
public static JsonNode json2JsonNode(InputStream in) {
|
||||
try {
|
||||
return getInstance().readTree(in);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -311,8 +309,7 @@ public class JsonUtil {
|
|||
public static JsonNode json2JsonNode(byte[] content) {
|
||||
try {
|
||||
return getInstance().readTree(content);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -326,8 +323,7 @@ public class JsonUtil {
|
|||
public static JsonNode json2JsonNode(JsonParser jsonParser) {
|
||||
try {
|
||||
return getInstance().readTree(jsonParser);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtil.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +332,6 @@ public class JsonUtil {
|
|||
return JacksonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
private static class JacksonHolder {
|
||||
|
||||
private static final ObjectMapper INSTANCE = new JacksonObjectMapper();
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -94,5 +111,4 @@ public enum PatternEnum {
|
|||
return pattern.matcher(input).matches();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.beans.BeanInfo;
|
||||
|
@ -25,7 +42,6 @@ public class ReflectionUtils {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ReflectionUtils.class);
|
||||
|
||||
|
||||
/**
|
||||
* 获取 Function 名
|
||||
* @param func
|
||||
|
@ -98,7 +114,6 @@ public class ReflectionUtils {
|
|||
return flag;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定属性
|
||||
*
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.nebula.base.utils.io.IOUtil;
|
||||
|
@ -80,8 +97,7 @@ public class ResourcesUtil {
|
|||
try {
|
||||
final char[] data = IOUtil.readChars(inputStream);
|
||||
return new String(data);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
IOUtil.close(inputStream);
|
||||
}
|
||||
}
|
||||
|
@ -122,5 +138,4 @@ public class ResourcesUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
@ -228,6 +245,7 @@ public class StringUtils {
|
|||
}
|
||||
|
||||
public static class MessageFormatter {
|
||||
|
||||
static final char DELIM_START = '{';
|
||||
static final char DELIM_STOP = '}';
|
||||
static final String DELIM_STR = "{}";
|
||||
|
@ -764,8 +782,7 @@ public class StringUtils {
|
|||
sb.append(s, c, i);
|
||||
sb.append(with);
|
||||
c = i + sub.length();
|
||||
}
|
||||
while ((i = s.indexOf(sub, c)) != -1);
|
||||
} while ((i = s.indexOf(sub, c)) != -1);
|
||||
if (c < length) {
|
||||
sb.append(s, c, length);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -21,6 +38,7 @@ public class SystemInfo {
|
|||
* is forbidden in Android, we will get an exception.
|
||||
*/
|
||||
private static class HostInfoLazy {
|
||||
|
||||
private final String HOST_NAME;
|
||||
private final String HOST_ADDRESS;
|
||||
|
||||
|
@ -232,7 +250,6 @@ public class SystemInfo {
|
|||
return packages.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- java checks
|
||||
|
||||
private int detectJavaVersionNumber() {
|
||||
|
@ -268,7 +285,6 @@ public class SystemInfo {
|
|||
return JAVA_VERSION_NUMBER == version;
|
||||
}
|
||||
|
||||
|
||||
private final String OS_VERSION = SystemUtil.get("os.version");
|
||||
private final String OS_ARCH = SystemUtil.get("os.arch");
|
||||
private final String OS_NAME = SystemUtil.get("os.name");
|
||||
|
@ -324,7 +340,6 @@ public class SystemInfo {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public final boolean isAix() {
|
||||
return IS_OS_AIX;
|
||||
}
|
||||
|
@ -481,7 +496,6 @@ public class SystemInfo {
|
|||
|
||||
// ---------------------------------------------------------------- user
|
||||
|
||||
|
||||
private final String USER_NAME = SystemUtil.get("user.name");
|
||||
private final String USER_HOME = nosep(SystemUtil.get("user.home"));
|
||||
private final String USER_DIR = nosep(SystemUtil.get("user.dir"));
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.security.AccessController;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
@ -30,8 +47,7 @@ public class ThreadFactoryImpl implements ThreadFactory {
|
|||
Thread thread = new Thread(r, threadNamePrefix + this.threadIndex.incrementAndGet());
|
||||
thread.setDaemon(daemon);
|
||||
|
||||
thread.setUncaughtExceptionHandler((t, e) ->
|
||||
log.error("Thread has an uncaught exception, threadId={}, threadName={}",
|
||||
thread.setUncaughtExceptionHandler((t, e) -> log.error("Thread has an uncaught exception, threadId={}, threadName={}",
|
||||
t.getId(), t.getName(), e));
|
||||
|
||||
return thread;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils;
|
||||
|
||||
import java.time.Instant;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils.io;
|
||||
|
||||
import com.nebula.base.utils.DigestEngine;
|
||||
|
@ -824,7 +841,6 @@ public class FileUtil {
|
|||
|
||||
// ---------------------------------------------------------------- stream
|
||||
|
||||
|
||||
/**
|
||||
* @see #writeStream(File, InputStream)
|
||||
*/
|
||||
|
@ -1224,7 +1240,6 @@ public class FileUtil {
|
|||
moveFile(src, dest);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------- smart delete
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils.io;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.base.utils.io;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -11,8 +10,6 @@
|
|||
|
||||
<name>spring-boot-nebula-dependencies</name>
|
||||
<description>spring boot 基础组件,快速构建spring boot项目</description>
|
||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
||||
|
||||
|
||||
<properties>
|
||||
<revision>0.0.01</revision>
|
||||
|
@ -29,6 +26,8 @@
|
|||
<javers-core.version>6.6.5</javers-core.version>
|
||||
<mybatis-plus-boot-starter.version>3.5.5</mybatis-plus-boot-starter.version>
|
||||
<redission.version>3.17.3</redission.version>
|
||||
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||
|
||||
</properties>
|
||||
|
||||
|
||||
|
@ -116,38 +115,10 @@
|
|||
<version>${redission.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</dependencyManagement>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>weihubeats</name>
|
||||
<email>weihu@apche.org</email>
|
||||
<organization>https://weihubeats.blog.csdn.net/</organization>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git@github.com:weihubeats/spring-boot-common.git</connection>
|
||||
<developerConnection>scm:git@github.com:weihubeats/spring-boot-common.git</developerConnection>
|
||||
<url>git@github.com:weihubeats/spring-boot-common.git</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issue</system>
|
||||
<url>https://github.com/weihubeats/spring-boot-common/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -180,10 +151,10 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -205,10 +176,10 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -220,10 +191,10 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -239,33 +210,100 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
<phase>process-resources</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
<phase>clean</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>${spotless-maven-plugin.version}</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<eclipse>
|
||||
<file>${maven.multiModuleProjectDirectory}/dev-support/spotless_nebula_formatter.xml</file>
|
||||
</eclipse>
|
||||
<licenseHeader>
|
||||
<file>${maven.multiModuleProjectDirectory}/dev-support/license-header</file>
|
||||
</licenseHeader>
|
||||
</java>
|
||||
<pom>
|
||||
<sortPom>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nrOfIndentSpace>4</nrOfIndentSpace>
|
||||
<keepBlankLines>true</keepBlankLines>
|
||||
<indentBlankLines>false</indentBlankLines>
|
||||
<indentSchemaLocation>true</indentSchemaLocation>
|
||||
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
|
||||
<sortModules>false</sortModules>
|
||||
<sortExecutions>false</sortExecutions>
|
||||
<predefinedSortOrder>custom_1</predefinedSortOrder>
|
||||
<expandEmptyElements>false</expandEmptyElements>
|
||||
<sortProperties>false</sortProperties>
|
||||
</sortPom>
|
||||
</pom>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>apply</goal>
|
||||
</goals>
|
||||
<phase>compile</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>weihubeats</name>
|
||||
<email>weihu@apche.org</email>
|
||||
<organization>https://weihubeats.blog.csdn.net/</organization>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git@github.com:weihubeats/spring-boot-common.git</connection>
|
||||
<developerConnection>scm:git@github.com:weihubeats/spring-boot-common.git</developerConnection>
|
||||
<url>git@github.com:weihubeats/spring-boot-common.git</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issue</system>
|
||||
<url>https://github.com/weihubeats/spring-boot-common/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>sonatype</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.aop;
|
||||
|
||||
import com.nebula.base.utils.DataUtils;
|
||||
|
@ -43,6 +60,7 @@ public class NebulaDistributedLockAnnotationInterceptor implements MethodInterce
|
|||
boolean fairLock = annotation.fairLock();
|
||||
if (annotation.tryLock()) {
|
||||
return lock.tryLock(new DistributedLock<>() {
|
||||
|
||||
@Override
|
||||
public Object process() {
|
||||
return proceed(methodInvocation);
|
||||
|
@ -55,6 +73,7 @@ public class NebulaDistributedLockAnnotationInterceptor implements MethodInterce
|
|||
}, annotation.tryWaitTime(), annotation.outTime(), annotation.timeUnit(), fairLock);
|
||||
} else {
|
||||
return lock.lock(new DistributedLock<>() {
|
||||
|
||||
@Override
|
||||
public Object process() {
|
||||
return proceed(methodInvocation);
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.autoconfigure;
|
||||
|
||||
import com.nebula.aop.base.NebulaBaseAnnotationAdvisor;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.core;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.core;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -63,5 +80,4 @@ public interface NebulaDistributedLockTemplate {
|
|||
*/
|
||||
<T> T tryLock(DistributedLock<T> distributedLock, long tryOutTime, long outTime, TimeUnit timeUnit, boolean fairLock);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.core;
|
||||
|
||||
import com.nebula.distribute.lock.exception.DistributedLockException;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.exception;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.mybatis.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.mybatis.handler;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -21,6 +38,7 @@ import org.apache.ibatis.type.TypeException;
|
|||
@MappedJdbcTypes(JdbcType.ARRAY)
|
||||
@MappedTypes({Integer[].class, String[].class, Boolean[].class, Double[].class, Long[].class, BigDecimal[].class})
|
||||
public class ArrayTypeHandler extends BaseTypeHandler<Object[]> {
|
||||
|
||||
private static final String TYPE_NAME_VARCHAR = "varchar";
|
||||
private static final String TYPE_NAME_INTEGER = "integer";
|
||||
private static final String TYPE_NAME_BOOLEAN = "boolean";
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<groupId>io.github.weihubeats</groupId>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-boot-nebula-samples</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>spring-boot-nebula-web-sample</module>
|
||||
<module>spring-boot-nebula-distribute-lock-sample</module>
|
||||
</modules>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<artifactId>spring-boot-nebula-samples</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.sample;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.sample.config;
|
||||
|
||||
import com.nebula.base.utils.DataUtils;
|
||||
|
@ -25,7 +42,6 @@ public class RedissonConfig {
|
|||
@Value("${redis.password}")
|
||||
private String redisLoginPassword;
|
||||
|
||||
|
||||
@Bean
|
||||
public RedissonClient redissonClient() {
|
||||
return createRedis(redisLoginHost, redisLoginPort, redisLoginPassword);
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.sample.controller;
|
||||
|
||||
import com.nebula.distribute.lock.sample.service.TestService;
|
||||
|
@ -19,7 +36,6 @@ public class TestController {
|
|||
|
||||
private final TestService testServcie;
|
||||
|
||||
|
||||
@GetMapping("/test")
|
||||
@NebulaResponseBody
|
||||
public String test() throws Exception {
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.distribute.lock.sample.service;
|
||||
|
||||
import com.nebula.distribute.lock.annotation.NebulaDistributedLock;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.sample;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.sample.controller;
|
||||
|
||||
import com.nebula.web.boot.annotation.NebulaResponseBody;
|
||||
|
@ -14,7 +31,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping()
|
||||
public class TestController {
|
||||
|
||||
|
||||
@GetMapping("/test")
|
||||
@NebulaResponseBody
|
||||
public String test() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -29,6 +28,19 @@
|
|||
<artifactId>spring-boot-nebula-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.common.autoconfigure;
|
||||
|
||||
import com.nebula.web.common.utils.NebulaSysWebUtils;
|
||||
|
@ -23,5 +40,4 @@ public class NebulaWebCommonAutoConfiguration {
|
|||
return new NebulaSysWebUtils();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.common.utils;
|
||||
|
||||
import com.nebula.base.utils.DataUtils;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.expression.ExpressionParser;
|
||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||
|
@ -30,6 +46,7 @@ public class ExpressionUtil {
|
|||
}
|
||||
// 获取被拦截方法参数名列表
|
||||
LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();
|
||||
// SPEL解析
|
||||
String[] paramNames = discoverer.getParameterNames(method);
|
||||
if (paramNames == null || args == null || paramNames.length != args.length) {
|
||||
throw new IllegalArgumentException("Method parameter names and argument values do not match.");
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.common.utils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.common.utils;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package com.nebula.web.common.utils;
|
||||
|
||||
import com.nebula.web.common.autoconfigure.NebulaWebCommonAutoConfiguration;
|
||||
import java.util.Objects;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrowsExactly;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
* @author : wh
|
||||
* @date : 2024/3/28 09:45
|
||||
* @description:
|
||||
*/
|
||||
@SpringBootTest(classes = SpringBeanUtilsTest.TestConfig.class)
|
||||
public class SpringBeanUtilsTest {
|
||||
|
||||
@Test
|
||||
public void getBean() {
|
||||
Object bean = SpringBeanUtils.getBean("testBean");
|
||||
assertTrue(bean instanceof TestBean);
|
||||
TestBean bean1 = SpringBeanUtils.getBean(TestBean.class);
|
||||
assertTrue(Objects.nonNull(bean1));
|
||||
assertThrowsExactly(NoSuchBeanDefinitionException.class, () -> SpringBeanUtils.getBean(NoTestBean.class));
|
||||
|
||||
}
|
||||
|
||||
static final class TestBean {
|
||||
}
|
||||
|
||||
static final class NoTestBean {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@ImportAutoConfiguration({NebulaWebCommonAutoConfiguration.class})
|
||||
public static class TestConfig {
|
||||
|
||||
@Bean
|
||||
public TestBean testBean() {
|
||||
return new TestBean();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>io.github.weihubeats</groupId>
|
||||
<artifactId>spring-boot-nebula</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>spring-boot-nebula-web</artifactId>
|
||||
|
||||
|
@ -37,5 +36,4 @@
|
|||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.annotation;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.api;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.api;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.api;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.api;
|
||||
|
||||
import com.nebula.web.boot.enums.ResultCode;
|
||||
|
@ -37,7 +54,6 @@ public class NebulaResponse<T> implements Serializable {
|
|||
*/
|
||||
private String msg;
|
||||
|
||||
|
||||
private NebulaResponse(IResultCode resultCode) {
|
||||
this(resultCode, null, resultCode.getMessage());
|
||||
}
|
||||
|
@ -145,7 +161,4 @@ public class NebulaResponse<T> implements Serializable {
|
|||
return new NebulaResponse<>(ResultCode.FAILURE, msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
@ -28,16 +45,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
@AllArgsConstructor
|
||||
public class BaseWebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
|
||||
returnValueHandlers.add(new NebulaResponseBodyHandleReturnValue());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用 JACKSON 作为JSON MessageConverter
|
||||
* @param converters
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.enums;
|
||||
|
||||
import com.nebula.web.boot.api.IResultCode;
|
||||
|
@ -35,7 +52,6 @@ public enum ResultCode implements IResultCode {
|
|||
|
||||
BIZ_EXCEPTION(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "业务异常");
|
||||
|
||||
|
||||
/**
|
||||
* code编码
|
||||
*/
|
||||
|
@ -45,10 +61,4 @@ public enum ResultCode implements IResultCode {
|
|||
*/
|
||||
final String message;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.error;
|
||||
|
||||
import com.nebula.web.boot.api.NebulaResponse;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.exception;
|
||||
|
||||
import com.nebula.web.boot.api.IResultCode;
|
||||
|
@ -9,7 +26,8 @@ import lombok.Getter;
|
|||
* @date : 2023/4/13 10:11
|
||||
* @description:
|
||||
*/
|
||||
@Getter public abstract class BaseException extends RuntimeException {
|
||||
@Getter
|
||||
public abstract class BaseException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.exception;
|
||||
|
||||
import com.nebula.web.boot.api.IResultCode;
|
||||
|
@ -12,7 +29,6 @@ public class BizException extends BaseException {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
public BizException(String errMessage) {
|
||||
super(ResultCode.FAILURE, errMessage);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.exception;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.exception;
|
||||
|
||||
import com.nebula.web.boot.enums.ResultCode;
|
||||
|
@ -8,6 +25,7 @@ import com.nebula.web.boot.enums.ResultCode;
|
|||
* @description:
|
||||
*/
|
||||
public class UnauthorizedException extends BaseException {
|
||||
|
||||
public UnauthorizedException(String errMessage) {
|
||||
super(ResultCode.UNAUTHORIZED, errMessage);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.interceptor;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.jackson;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonEncoding;
|
||||
|
@ -32,6 +49,7 @@ import org.springframework.util.TypeUtils;
|
|||
* AbstractReadWriteJackson2HttpMessageConverter
|
||||
*/
|
||||
public abstract class AbstractReadWriteJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter {
|
||||
|
||||
private static final java.nio.charset.Charset DEFAULT_CHARSET = Charsets.UTF_8;
|
||||
|
||||
private final ObjectMapper writeObjectMapper;
|
||||
|
@ -76,8 +94,7 @@ public abstract class AbstractReadWriteJackson2HttpMessageConverter extends Abst
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void writeInternal(Object object, @Nullable Type type, HttpOutputMessage outputMessage)
|
||||
throws IOException, HttpMessageNotWritableException {
|
||||
protected void writeInternal(Object object, @Nullable Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
|
||||
|
||||
MediaType contentType = outputMessage.getHeaders().getContentType();
|
||||
JsonEncoding encoding = getJsonEncoding(contentType);
|
||||
|
@ -100,8 +117,7 @@ public abstract class AbstractReadWriteJackson2HttpMessageConverter extends Abst
|
|||
javaType = getJavaType(type, null);
|
||||
}
|
||||
|
||||
ObjectWriter objectWriter = (serializationView != null ?
|
||||
this.writeObjectMapper.writerWithView(serializationView) : this.writeObjectMapper.writer());
|
||||
ObjectWriter objectWriter = (serializationView != null ? this.writeObjectMapper.writerWithView(serializationView) : this.writeObjectMapper.writer());
|
||||
if (filters != null) {
|
||||
objectWriter = objectWriter.with(filters);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.jackson;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
|
@ -18,6 +35,7 @@ import java.time.LocalDateTime;
|
|||
* </>
|
||||
*/
|
||||
public class LocalDateTimeJacksonDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||
|
||||
@Override
|
||||
public LocalDateTime deserialize(
|
||||
JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.jackson;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.jackson;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.resolver;
|
||||
|
||||
import com.nebula.base.utils.DataUtils;
|
||||
|
@ -28,7 +45,8 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object resolveArgument(MethodParameter methodParameter, ModelAndViewContainer modelAndViewContainer, NativeWebRequest nativeWebRequest, WebDataBinderFactory webDataBinderFactory) throws Exception {
|
||||
public Object resolveArgument(MethodParameter methodParameter, ModelAndViewContainer modelAndViewContainer, NativeWebRequest nativeWebRequest,
|
||||
WebDataBinderFactory webDataBinderFactory) throws Exception {
|
||||
GetTimestamp getTimestamp = methodParameter.getParameterAnnotation(GetTimestamp.class);
|
||||
Object instance = methodParameter.getParameterType().getDeclaredConstructor().newInstance();
|
||||
String name = getTimestamp.name();
|
||||
|
@ -51,6 +69,7 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
|||
}
|
||||
|
||||
class LocalDateTimeEditor extends PropertyEditorSupport {
|
||||
|
||||
@Override
|
||||
public String getAsText() {
|
||||
final LocalDateTime localDateTime = (LocalDateTime) getValue();
|
||||
|
@ -78,6 +97,4 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
|||
return TimeUtil.toLocalDateTime(timestamp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.nebula.web.boot.api;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
Loading…
Reference in New Issue