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:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- develop
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
junit:
|
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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>io.github.weihubeats</groupId>
|
<groupId>io.github.weihubeats</groupId>
|
||||||
<artifactId>spring-boot-nebula</artifactId>
|
<artifactId>spring-boot-nebula</artifactId>
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>spring-boot-nebula</name>
|
||||||
|
<description>spring-boot-common</description>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>spring-boot-nebula-web</module>
|
<module>spring-boot-nebula-web</module>
|
||||||
|
@ -22,29 +24,15 @@
|
||||||
<module>spring-boot-nebula-all</module>
|
<module>spring-boot-nebula-all</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<name>spring-boot-nebula</name>
|
|
||||||
<description>spring-boot-common</description>
|
|
||||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>0.0.01</revision>
|
<revision>0.0.01</revision>
|
||||||
<flatten-maven-plugin.version>1.2.7</flatten-maven-plugin.version>
|
<flatten-maven-plugin.version>1.2.7</flatten-maven-plugin.version>
|
||||||
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
|
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -57,35 +45,6 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</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>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -118,10 +77,10 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar-no-fork</goal>
|
<goal>jar-no-fork</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -143,10 +102,10 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar</goal>
|
<goal>jar</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -158,10 +117,10 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>sign-artifacts</id>
|
<id>sign-artifacts</id>
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>sign</goal>
|
<goal>sign</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>verify</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -177,32 +136,100 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>flatten</id>
|
<id>flatten</id>
|
||||||
<phase>process-resources</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>flatten</goal>
|
<goal>flatten</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>process-resources</phase>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>flatten.clean</id>
|
<id>flatten.clean</id>
|
||||||
<phase>clean</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>clean</goal>
|
<goal>clean</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>clean</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</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>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
|
@ -11,7 +10,6 @@
|
||||||
|
|
||||||
<artifactId>spring-boot-nebula-aggregate</artifactId>
|
<artifactId>spring-boot-nebula-aggregate</artifactId>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<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;
|
package com.nebula.aggregate.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
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;
|
package com.nebula.aggregate.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
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;
|
package com.nebula.aggregate.annotation;
|
||||||
|
|
||||||
import com.nebula.aggregate.core.AbstractOldObj;
|
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;
|
package com.nebula.aggregate.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,4 +24,3 @@ package com.nebula.aggregate.core;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractAggregate<T> extends AbstractOldObj<T> {
|
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;
|
package com.nebula.aggregate.core;
|
||||||
|
|
||||||
import org.javers.core.metamodel.annotation.DiffIgnore;
|
import org.javers.core.metamodel.annotation.DiffIgnore;
|
||||||
|
@ -12,7 +29,6 @@ public abstract class AbstractOldObj<T> {
|
||||||
@DiffIgnore
|
@DiffIgnore
|
||||||
private T oldObject;
|
private T oldObject;
|
||||||
|
|
||||||
|
|
||||||
public void setOldObject(T oldObject) {
|
public void setOldObject(T oldObject) {
|
||||||
this.oldObject = 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;
|
package com.nebula.aggregate.core;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
|
@ -34,8 +33,6 @@
|
||||||
<artifactId>spring-boot-nebula-distribute-lock</artifactId>
|
<artifactId>spring-boot-nebula-distribute-lock</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<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;
|
package com.nebula.aop.base;
|
||||||
|
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
@ -87,6 +104,7 @@ public class NebulaBaseAnnotationAdvisor extends AbstractPointcutAdvisor impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class AnnotationMethodMatcher extends StaticMethodMatcher {
|
private static class AnnotationMethodMatcher extends StaticMethodMatcher {
|
||||||
|
|
||||||
private final Class<? extends Annotation> annotationType;
|
private final Class<? extends Annotation> annotationType;
|
||||||
|
|
||||||
public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
|
public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<parent>
|
||||||
<artifactId>spring-boot-nebula</artifactId>
|
|
||||||
<groupId>io.github.weihubeats</groupId>
|
<groupId>io.github.weihubeats</groupId>
|
||||||
|
<artifactId>spring-boot-nebula</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>spring-boot-nebula-common</artifactId>
|
<artifactId>spring-boot-nebula-common</artifactId>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -66,8 +64,6 @@
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</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;
|
package com.nebula.base.exception;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
|
@ -9,7 +26,6 @@ import java.lang.reflect.Array;
|
||||||
*/
|
*/
|
||||||
public class ArraysUtil {
|
public class ArraysUtil {
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- wrap
|
// ---------------------------------------------------------------- wrap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,7 +92,6 @@ public class ArraysUtil {
|
||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- join
|
// ---------------------------------------------------------------- join
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +125,6 @@ public class ArraysUtil {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join <code>String</code> arrays.
|
* Join <code>String</code> arrays.
|
||||||
*/
|
*/
|
||||||
|
@ -318,7 +332,6 @@ public class ArraysUtil {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- resize
|
// ---------------------------------------------------------------- resize
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -331,7 +344,6 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes a <code>String</code> array.
|
* Resizes a <code>String</code> array.
|
||||||
*/
|
*/
|
||||||
|
@ -413,7 +425,6 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- append
|
// ---------------------------------------------------------------- append
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -506,7 +517,6 @@ public class ArraysUtil {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- remove
|
// ---------------------------------------------------------------- remove
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -628,7 +638,6 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- subarray
|
// ---------------------------------------------------------------- subarray
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -730,7 +739,6 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- insert
|
// ---------------------------------------------------------------- insert
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -969,7 +977,6 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- insertAt
|
// ---------------------------------------------------------------- insertAt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1091,10 +1098,8 @@ public class ArraysUtil {
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- convert
|
// ---------------------------------------------------------------- convert
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1119,7 +1124,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1144,7 +1148,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1169,7 +1172,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1194,7 +1196,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1219,7 +1220,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1244,7 +1244,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1269,7 +1268,6 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts to primitive array.
|
* Converts to primitive array.
|
||||||
*/
|
*/
|
||||||
|
@ -1294,11 +1292,8 @@ public class ArraysUtil {
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- indexof
|
// ---------------------------------------------------------------- indexof
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence of an element in an array.
|
* Finds the first occurrence of an element in an array.
|
||||||
*/
|
*/
|
||||||
|
@ -1651,12 +1646,8 @@ public class ArraysUtil {
|
||||||
return indexOf(array, value, startIndex) != -1;
|
return indexOf(array, value, startIndex) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- indexof 2
|
// ---------------------------------------------------------------- indexof 2
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array.
|
* Finds the first occurrence in an array.
|
||||||
*/
|
*/
|
||||||
|
@ -1667,7 +1658,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final byte c = sub[0];
|
final byte c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1696,7 +1685,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1713,7 +1703,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final char c = sub[0];
|
final char c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1742,7 +1730,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1759,7 +1748,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final short c = sub[0];
|
final short c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1788,7 +1775,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1805,7 +1793,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 total = endIndex - sublen + 1;
|
||||||
final int c = sub[0];
|
final int c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1834,7 +1820,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1851,7 +1838,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final long c = sub[0];
|
final long c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1880,7 +1865,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1897,7 +1883,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final boolean c = sub[0];
|
final boolean c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (array[i] != c) {
|
if (array[i] != c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1926,7 +1910,8 @@ public class ArraysUtil {
|
||||||
if (sub[j] != array[k]) {
|
if (sub[j] != array[k]) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1943,7 +1928,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final float c = sub[0];
|
final float c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (Float.compare(array[i], c) != 0) {
|
if (Float.compare(array[i], c) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1972,7 +1955,8 @@ public class ArraysUtil {
|
||||||
if (Float.compare(sub[j], array[k]) != 0) {
|
if (Float.compare(sub[j], array[k]) != 0) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1989,7 +1973,6 @@ public class ArraysUtil {
|
||||||
return indexOf(array, sub) != -1;
|
return indexOf(array, sub) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the first occurrence in an array from specified given position.
|
* 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 int total = endIndex - sublen + 1;
|
||||||
final double c = sub[0];
|
final double c = sub[0];
|
||||||
mainloop:
|
mainloop: for (int i = startIndex; i < total; i++) {
|
||||||
for (int i = startIndex; i < total; i++) {
|
|
||||||
if (Double.compare(array[i], c) != 0) {
|
if (Double.compare(array[i], c) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2018,14 +2000,14 @@ public class ArraysUtil {
|
||||||
if (Double.compare(sub[j], array[k]) != 0) {
|
if (Double.compare(sub[j], array[k]) != 0) {
|
||||||
continue mainloop;
|
continue mainloop;
|
||||||
}
|
}
|
||||||
j++; k++;
|
j++;
|
||||||
|
k++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- toString
|
// ---------------------------------------------------------------- toString
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2238,7 +2220,6 @@ public class ArraysUtil {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an array to string array.
|
* 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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.nebula.base.utils.io.IOUtil;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -281,8 +298,7 @@ public class ClassUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
top = false;
|
top = false;
|
||||||
}
|
} while ((clazz = clazz.getSuperclass()) != limit);
|
||||||
while ((clazz = clazz.getSuperclass()) != limit);
|
|
||||||
|
|
||||||
final Method[] methods = new Method[methodList.size()];
|
final Method[] methods = new Method[methodList.size()];
|
||||||
for (int i = 0; i < methods.length; i++) {
|
for (int i = 0; i < methods.length; i++) {
|
||||||
|
@ -341,8 +357,7 @@ public class ClassUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
top = false;
|
top = false;
|
||||||
}
|
} while ((clazz = clazz.getSuperclass()) != limit);
|
||||||
while ((clazz = clazz.getSuperclass()) != limit);
|
|
||||||
|
|
||||||
final Field[] fields = new Field[fieldList.size()];
|
final Field[] fields = new Field[fieldList.size()];
|
||||||
for (int i = 0; i < fields.length; i++) {
|
for (int i = 0; i < fields.length; i++) {
|
||||||
|
@ -1107,6 +1122,7 @@ public class ClassUtil {
|
||||||
// ---------------------------------------------------------------- caller
|
// ---------------------------------------------------------------- caller
|
||||||
|
|
||||||
private static class ReflectUtilSecurityManager extends SecurityManager {
|
private static class ReflectUtilSecurityManager extends SecurityManager {
|
||||||
|
|
||||||
public Class getCallerClass(final int callStackDepth) {
|
public Class getCallerClass(final int callStackDepth) {
|
||||||
return getClassContext()[callStackDepth + 1];
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.nebula.base.utils.io.IOUtil;
|
import com.nebula.base.utils.io.IOUtil;
|
||||||
|
@ -47,8 +64,7 @@ public interface DigestEngine {
|
||||||
|
|
||||||
while (dis.read() != -1) {
|
while (dis.read() != -1) {
|
||||||
}
|
}
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
IOUtil.close(dis);
|
IOUtil.close(dis);
|
||||||
IOUtil.close(bis);
|
IOUtil.close(bis);
|
||||||
IOUtil.close(fis);
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
|
@ -17,7 +34,6 @@ import java.time.LocalTime;
|
||||||
*/
|
*/
|
||||||
public class JacksonTimeModule extends SimpleModule {
|
public class JacksonTimeModule extends SimpleModule {
|
||||||
|
|
||||||
|
|
||||||
public JacksonTimeModule() {
|
public JacksonTimeModule() {
|
||||||
super(PackageVersion.VERSION);
|
super(PackageVersion.VERSION);
|
||||||
this.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(TimeUtil.DATETIME_FORMAT));
|
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));
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
@ -33,8 +50,7 @@ public class JsonUtil {
|
||||||
public static <T> String toJSONString(T value) {
|
public static <T> String toJSONString(T value) {
|
||||||
try {
|
try {
|
||||||
return getInstance().writeValueAsString(value);
|
return getInstance().writeValueAsString(value);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -43,8 +59,7 @@ public class JsonUtil {
|
||||||
public static <T> String toJSONString(ObjectMapper objectMapper, T value) {
|
public static <T> String toJSONString(ObjectMapper objectMapper, T value) {
|
||||||
try {
|
try {
|
||||||
return objectMapper.writeValueAsString(value);
|
return objectMapper.writeValueAsString(value);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -70,8 +85,7 @@ public class JsonUtil {
|
||||||
public static byte[] toJsonAsBytes(Object object) {
|
public static byte[] toJsonAsBytes(Object object) {
|
||||||
try {
|
try {
|
||||||
return getInstance().writeValueAsBytes(object);
|
return getInstance().writeValueAsBytes(object);
|
||||||
}
|
} catch (JsonProcessingException e) {
|
||||||
catch (JsonProcessingException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,8 +101,7 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(String content, Class<T> valueType) {
|
public static <T> T json2JavaBean(String content, Class<T> valueType) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(content, valueType);
|
return getInstance().readValue(content, valueType);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -105,8 +118,7 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(String content, TypeReference<T> typeReference) {
|
public static <T> T json2JavaBean(String content, TypeReference<T> typeReference) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(content, typeReference);
|
return getInstance().readValue(content, typeReference);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,13 +134,11 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(byte[] bytes, Class<T> valueType) {
|
public static <T> T json2JavaBean(byte[] bytes, Class<T> valueType) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(bytes, valueType);
|
return getInstance().readValue(bytes, valueType);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将json反序列化成对象
|
* 将json反序列化成对象
|
||||||
*
|
*
|
||||||
|
@ -140,8 +150,7 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(byte[] bytes, TypeReference<T> typeReference) {
|
public static <T> T json2JavaBean(byte[] bytes, TypeReference<T> typeReference) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(bytes, typeReference);
|
return getInstance().readValue(bytes, typeReference);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,8 +166,7 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(InputStream in, Class<T> valueType) {
|
public static <T> T json2JavaBean(InputStream in, Class<T> valueType) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(in, valueType);
|
return getInstance().readValue(in, valueType);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,8 +182,7 @@ public class JsonUtil {
|
||||||
public static <T> T json2JavaBean(InputStream in, TypeReference<T> typeReference) {
|
public static <T> T json2JavaBean(InputStream in, TypeReference<T> typeReference) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(in, typeReference);
|
return getInstance().readValue(in, typeReference);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,8 +195,7 @@ public class JsonUtil {
|
||||||
JavaType javaType = getInstance().getTypeFactory().constructParametricType(List.class, valueTypeRef);
|
JavaType javaType = getInstance().getTypeFactory().constructParametricType(List.class, valueTypeRef);
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(json, javaType);
|
return getInstance().readValue(json, javaType);
|
||||||
}
|
} catch (JsonProcessingException e) {
|
||||||
catch (JsonProcessingException e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return objectList;
|
return objectList;
|
||||||
|
@ -200,14 +206,12 @@ public class JsonUtil {
|
||||||
List<T> objectList = Collections.emptyList();
|
List<T> objectList = Collections.emptyList();
|
||||||
try {
|
try {
|
||||||
return reader.readValue(jsonNode);
|
return reader.readValue(jsonNode);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return objectList;
|
return objectList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* json to Map
|
* json to Map
|
||||||
* @param content
|
* @param content
|
||||||
|
@ -216,8 +220,7 @@ public class JsonUtil {
|
||||||
public static Map<String, Object> json2Map(String content) {
|
public static Map<String, Object> json2Map(String content) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readValue(content, Map.class);
|
return getInstance().readValue(content, Map.class);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -232,8 +235,7 @@ public class JsonUtil {
|
||||||
result.put(entry.getKey(), toPojo(entry.getValue(), valueTypeRef));
|
result.put(entry.getKey(), toPojo(entry.getValue(), valueTypeRef));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -252,8 +254,7 @@ public class JsonUtil {
|
||||||
public static JsonNode json2JsonNode(String jsonString) {
|
public static JsonNode json2JsonNode(String jsonString) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readTree(jsonString);
|
return getInstance().readTree(jsonString);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,8 +267,7 @@ public class JsonUtil {
|
||||||
public static String jsonNodeToString(JsonNode jsonNode) {
|
public static String jsonNodeToString(JsonNode jsonNode) {
|
||||||
try {
|
try {
|
||||||
return getInstance().writeValueAsString(jsonNode);
|
return getInstance().writeValueAsString(jsonNode);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,8 +281,7 @@ public class JsonUtil {
|
||||||
public static JsonNode byte2JsonNode(byte[] content) {
|
public static JsonNode byte2JsonNode(byte[] content) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readTree(content);
|
return getInstance().readTree(content);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,8 +295,7 @@ public class JsonUtil {
|
||||||
public static JsonNode json2JsonNode(InputStream in) {
|
public static JsonNode json2JsonNode(InputStream in) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readTree(in);
|
return getInstance().readTree(in);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,8 +309,7 @@ public class JsonUtil {
|
||||||
public static JsonNode json2JsonNode(byte[] content) {
|
public static JsonNode json2JsonNode(byte[] content) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readTree(content);
|
return getInstance().readTree(content);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,8 +323,7 @@ public class JsonUtil {
|
||||||
public static JsonNode json2JsonNode(JsonParser jsonParser) {
|
public static JsonNode json2JsonNode(JsonParser jsonParser) {
|
||||||
try {
|
try {
|
||||||
return getInstance().readTree(jsonParser);
|
return getInstance().readTree(jsonParser);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
throw ExceptionUtil.unchecked(e);
|
throw ExceptionUtil.unchecked(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,7 +332,6 @@ public class JsonUtil {
|
||||||
return JacksonHolder.INSTANCE;
|
return JacksonHolder.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class JacksonHolder {
|
private static class JacksonHolder {
|
||||||
|
|
||||||
private static final ObjectMapper INSTANCE = new JacksonObjectMapper();
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -94,5 +111,4 @@ public enum PatternEnum {
|
||||||
return pattern.matcher(input).matches();
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.io.Serializable;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.beans.BeanInfo;
|
import java.beans.BeanInfo;
|
||||||
|
@ -25,7 +42,6 @@ public class ReflectionUtils {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ReflectionUtils.class);
|
private static final Logger logger = LoggerFactory.getLogger(ReflectionUtils.class);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 Function 名
|
* 获取 Function 名
|
||||||
* @param func
|
* @param func
|
||||||
|
@ -98,7 +114,6 @@ public class ReflectionUtils {
|
||||||
return flag;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.nebula.base.utils.io.IOUtil;
|
import com.nebula.base.utils.io.IOUtil;
|
||||||
|
@ -80,8 +97,7 @@ public class ResourcesUtil {
|
||||||
try {
|
try {
|
||||||
final char[] data = IOUtil.readChars(inputStream);
|
final char[] data = IOUtil.readChars(inputStream);
|
||||||
return new String(data);
|
return new String(data);
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
IOUtil.close(inputStream);
|
IOUtil.close(inputStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,5 +138,4 @@ public class ResourcesUtil {
|
||||||
return null;
|
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;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
@ -228,6 +245,7 @@ public class StringUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MessageFormatter {
|
public static class MessageFormatter {
|
||||||
|
|
||||||
static final char DELIM_START = '{';
|
static final char DELIM_START = '{';
|
||||||
static final char DELIM_STOP = '}';
|
static final char DELIM_STOP = '}';
|
||||||
static final String DELIM_STR = "{}";
|
static final String DELIM_STR = "{}";
|
||||||
|
@ -764,8 +782,7 @@ public class StringUtils {
|
||||||
sb.append(s, c, i);
|
sb.append(s, c, i);
|
||||||
sb.append(with);
|
sb.append(with);
|
||||||
c = i + sub.length();
|
c = i + sub.length();
|
||||||
}
|
} while ((i = s.indexOf(sub, c)) != -1);
|
||||||
while ((i = s.indexOf(sub, c)) != -1);
|
|
||||||
if (c < length) {
|
if (c < length) {
|
||||||
sb.append(s, 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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -21,6 +38,7 @@ public class SystemInfo {
|
||||||
* is forbidden in Android, we will get an exception.
|
* is forbidden in Android, we will get an exception.
|
||||||
*/
|
*/
|
||||||
private static class HostInfoLazy {
|
private static class HostInfoLazy {
|
||||||
|
|
||||||
private final String HOST_NAME;
|
private final String HOST_NAME;
|
||||||
private final String HOST_ADDRESS;
|
private final String HOST_ADDRESS;
|
||||||
|
|
||||||
|
@ -232,7 +250,6 @@ public class SystemInfo {
|
||||||
return packages.toArray(new String[0]);
|
return packages.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- java checks
|
// ---------------------------------------------------------------- java checks
|
||||||
|
|
||||||
private int detectJavaVersionNumber() {
|
private int detectJavaVersionNumber() {
|
||||||
|
@ -268,7 +285,6 @@ public class SystemInfo {
|
||||||
return JAVA_VERSION_NUMBER == version;
|
return JAVA_VERSION_NUMBER == version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final String OS_VERSION = SystemUtil.get("os.version");
|
private final String OS_VERSION = SystemUtil.get("os.version");
|
||||||
private final String OS_ARCH = SystemUtil.get("os.arch");
|
private final String OS_ARCH = SystemUtil.get("os.arch");
|
||||||
private final String OS_NAME = SystemUtil.get("os.name");
|
private final String OS_NAME = SystemUtil.get("os.name");
|
||||||
|
@ -324,7 +340,6 @@ public class SystemInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public final boolean isAix() {
|
public final boolean isAix() {
|
||||||
return IS_OS_AIX;
|
return IS_OS_AIX;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +496,6 @@ public class SystemInfo {
|
||||||
|
|
||||||
// ---------------------------------------------------------------- user
|
// ---------------------------------------------------------------- user
|
||||||
|
|
||||||
|
|
||||||
private final String USER_NAME = SystemUtil.get("user.name");
|
private final String USER_NAME = SystemUtil.get("user.name");
|
||||||
private final String USER_HOME = nosep(SystemUtil.get("user.home"));
|
private final String USER_HOME = nosep(SystemUtil.get("user.home"));
|
||||||
private final String USER_DIR = nosep(SystemUtil.get("user.dir"));
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.security.AccessController;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
@ -30,8 +47,7 @@ public class ThreadFactoryImpl implements ThreadFactory {
|
||||||
Thread thread = new Thread(r, threadNamePrefix + this.threadIndex.incrementAndGet());
|
Thread thread = new Thread(r, threadNamePrefix + this.threadIndex.incrementAndGet());
|
||||||
thread.setDaemon(daemon);
|
thread.setDaemon(daemon);
|
||||||
|
|
||||||
thread.setUncaughtExceptionHandler((t, e) ->
|
thread.setUncaughtExceptionHandler((t, e) -> log.error("Thread has an uncaught exception, threadId={}, threadName={}",
|
||||||
log.error("Thread has an uncaught exception, threadId={}, threadName={}",
|
|
||||||
t.getId(), t.getName(), e));
|
t.getId(), t.getName(), e));
|
||||||
|
|
||||||
return thread;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
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;
|
package com.nebula.base.utils;
|
||||||
|
|
||||||
import java.time.Instant;
|
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;
|
package com.nebula.base.utils.io;
|
||||||
|
|
||||||
import com.nebula.base.utils.DigestEngine;
|
import com.nebula.base.utils.DigestEngine;
|
||||||
|
@ -824,7 +841,6 @@ public class FileUtil {
|
||||||
|
|
||||||
// ---------------------------------------------------------------- stream
|
// ---------------------------------------------------------------- stream
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #writeStream(File, InputStream)
|
* @see #writeStream(File, InputStream)
|
||||||
*/
|
*/
|
||||||
|
@ -1224,7 +1240,6 @@ public class FileUtil {
|
||||||
moveFile(src, dest);
|
moveFile(src, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------- smart delete
|
// ---------------------------------------------------------------- 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;
|
package com.nebula.base.utils.io;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
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;
|
package com.nebula.base.utils.io;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -11,8 +10,6 @@
|
||||||
|
|
||||||
<name>spring-boot-nebula-dependencies</name>
|
<name>spring-boot-nebula-dependencies</name>
|
||||||
<description>spring boot 基础组件,快速构建spring boot项目</description>
|
<description>spring boot 基础组件,快速构建spring boot项目</description>
|
||||||
<url>https://github.com/weihubeats/spring-boot-common</url>
|
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>0.0.01</revision>
|
<revision>0.0.01</revision>
|
||||||
|
@ -29,6 +26,8 @@
|
||||||
<javers-core.version>6.6.5</javers-core.version>
|
<javers-core.version>6.6.5</javers-core.version>
|
||||||
<mybatis-plus-boot-starter.version>3.5.5</mybatis-plus-boot-starter.version>
|
<mybatis-plus-boot-starter.version>3.5.5</mybatis-plus-boot-starter.version>
|
||||||
<redission.version>3.17.3</redission.version>
|
<redission.version>3.17.3</redission.version>
|
||||||
|
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,38 +115,10 @@
|
||||||
<version>${redission.version}</version>
|
<version>${redission.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</dependencyManagement>
|
</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>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -180,10 +151,10 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar-no-fork</goal>
|
<goal>jar-no-fork</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -205,10 +176,10 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar</goal>
|
<goal>jar</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -220,10 +191,10 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>sign-artifacts</id>
|
<id>sign-artifacts</id>
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>sign</goal>
|
<goal>sign</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>verify</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -239,33 +210,100 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>flatten</id>
|
<id>flatten</id>
|
||||||
<phase>process-resources</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>flatten</goal>
|
<goal>flatten</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>process-resources</phase>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>flatten.clean</id>
|
<id>flatten.clean</id>
|
||||||
<phase>clean</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>clean</goal>
|
<goal>clean</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>clean</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</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>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<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;
|
package com.nebula.distribute.lock.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
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;
|
package com.nebula.distribute.lock.aop;
|
||||||
|
|
||||||
import com.nebula.base.utils.DataUtils;
|
import com.nebula.base.utils.DataUtils;
|
||||||
|
@ -43,6 +60,7 @@ public class NebulaDistributedLockAnnotationInterceptor implements MethodInterce
|
||||||
boolean fairLock = annotation.fairLock();
|
boolean fairLock = annotation.fairLock();
|
||||||
if (annotation.tryLock()) {
|
if (annotation.tryLock()) {
|
||||||
return lock.tryLock(new DistributedLock<>() {
|
return lock.tryLock(new DistributedLock<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object process() {
|
public Object process() {
|
||||||
return proceed(methodInvocation);
|
return proceed(methodInvocation);
|
||||||
|
@ -55,6 +73,7 @@ public class NebulaDistributedLockAnnotationInterceptor implements MethodInterce
|
||||||
}, annotation.tryWaitTime(), annotation.outTime(), annotation.timeUnit(), fairLock);
|
}, annotation.tryWaitTime(), annotation.outTime(), annotation.timeUnit(), fairLock);
|
||||||
} else {
|
} else {
|
||||||
return lock.lock(new DistributedLock<>() {
|
return lock.lock(new DistributedLock<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object process() {
|
public Object process() {
|
||||||
return proceed(methodInvocation);
|
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;
|
package com.nebula.distribute.lock.autoconfigure;
|
||||||
|
|
||||||
import com.nebula.aop.base.NebulaBaseAnnotationAdvisor;
|
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;
|
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;
|
package com.nebula.distribute.lock.core;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
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);
|
<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;
|
package com.nebula.distribute.lock.core;
|
||||||
|
|
||||||
import com.nebula.distribute.lock.exception.DistributedLockException;
|
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;
|
package com.nebula.distribute.lock.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<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;
|
package com.nebula.mybatis.entity;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
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;
|
package com.nebula.mybatis.handler;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -21,6 +38,7 @@ import org.apache.ibatis.type.TypeException;
|
||||||
@MappedJdbcTypes(JdbcType.ARRAY)
|
@MappedJdbcTypes(JdbcType.ARRAY)
|
||||||
@MappedTypes({Integer[].class, String[].class, Boolean[].class, Double[].class, Long[].class, BigDecimal[].class})
|
@MappedTypes({Integer[].class, String[].class, Boolean[].class, Double[].class, Long[].class, BigDecimal[].class})
|
||||||
public class ArrayTypeHandler extends BaseTypeHandler<Object[]> {
|
public class ArrayTypeHandler extends BaseTypeHandler<Object[]> {
|
||||||
|
|
||||||
private static final String TYPE_NAME_VARCHAR = "varchar";
|
private static final String TYPE_NAME_VARCHAR = "varchar";
|
||||||
private static final String TYPE_NAME_INTEGER = "integer";
|
private static final String TYPE_NAME_INTEGER = "integer";
|
||||||
private static final String TYPE_NAME_BOOLEAN = "boolean";
|
private static final String TYPE_NAME_BOOLEAN = "boolean";
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<parent>
|
||||||
<artifactId>spring-boot-nebula</artifactId>
|
|
||||||
<groupId>io.github.weihubeats</groupId>
|
<groupId>io.github.weihubeats</groupId>
|
||||||
|
<artifactId>spring-boot-nebula</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>spring-boot-nebula-samples</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>spring-boot-nebula-web-sample</module>
|
<module>spring-boot-nebula-web-sample</module>
|
||||||
<module>spring-boot-nebula-distribute-lock-sample</module>
|
<module>spring-boot-nebula-distribute-lock-sample</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<artifactId>spring-boot-nebula-samples</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<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;
|
package com.nebula.distribute.lock.sample;
|
||||||
|
|
||||||
import java.util.TimeZone;
|
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;
|
package com.nebula.distribute.lock.sample.config;
|
||||||
|
|
||||||
import com.nebula.base.utils.DataUtils;
|
import com.nebula.base.utils.DataUtils;
|
||||||
|
@ -25,7 +42,6 @@ public class RedissonConfig {
|
||||||
@Value("${redis.password}")
|
@Value("${redis.password}")
|
||||||
private String redisLoginPassword;
|
private String redisLoginPassword;
|
||||||
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RedissonClient redissonClient() {
|
public RedissonClient redissonClient() {
|
||||||
return createRedis(redisLoginHost, redisLoginPort, redisLoginPassword);
|
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;
|
package com.nebula.distribute.lock.sample.controller;
|
||||||
|
|
||||||
import com.nebula.distribute.lock.sample.service.TestService;
|
import com.nebula.distribute.lock.sample.service.TestService;
|
||||||
|
@ -19,7 +36,6 @@ public class TestController {
|
||||||
|
|
||||||
private final TestService testServcie;
|
private final TestService testServcie;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
@NebulaResponseBody
|
@NebulaResponseBody
|
||||||
public String test() throws Exception {
|
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;
|
package com.nebula.distribute.lock.sample.service;
|
||||||
|
|
||||||
import com.nebula.distribute.lock.annotation.NebulaDistributedLock;
|
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"
|
<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">
|
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>
|
<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;
|
package com.nebula.web.sample;
|
||||||
|
|
||||||
import java.util.TimeZone;
|
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;
|
package com.nebula.web.sample.controller;
|
||||||
|
|
||||||
import com.nebula.web.boot.annotation.NebulaResponseBody;
|
import com.nebula.web.boot.annotation.NebulaResponseBody;
|
||||||
|
@ -14,7 +31,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequestMapping()
|
@RequestMapping()
|
||||||
public class TestController {
|
public class TestController {
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
@NebulaResponseBody
|
@NebulaResponseBody
|
||||||
public String test() {
|
public String test() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
|
@ -29,6 +28,19 @@
|
||||||
<artifactId>spring-boot-nebula-common</artifactId>
|
<artifactId>spring-boot-nebula-common</artifactId>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</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;
|
package com.nebula.web.common.autoconfigure;
|
||||||
|
|
||||||
import com.nebula.web.common.utils.NebulaSysWebUtils;
|
import com.nebula.web.common.utils.NebulaSysWebUtils;
|
||||||
|
@ -23,5 +40,4 @@ public class NebulaWebCommonAutoConfiguration {
|
||||||
return new NebulaSysWebUtils();
|
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;
|
package com.nebula.web.common.utils;
|
||||||
|
|
||||||
import com.nebula.base.utils.DataUtils;
|
import com.nebula.base.utils.DataUtils;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||||
import org.springframework.expression.ExpressionParser;
|
import org.springframework.expression.ExpressionParser;
|
||||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
|
@ -30,6 +46,7 @@ public class ExpressionUtil {
|
||||||
}
|
}
|
||||||
// 获取被拦截方法参数名列表
|
// 获取被拦截方法参数名列表
|
||||||
LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();
|
LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();
|
||||||
|
// SPEL解析
|
||||||
String[] paramNames = discoverer.getParameterNames(method);
|
String[] paramNames = discoverer.getParameterNames(method);
|
||||||
if (paramNames == null || args == null || paramNames.length != args.length) {
|
if (paramNames == null || args == null || paramNames.length != args.length) {
|
||||||
throw new IllegalArgumentException("Method parameter names and argument values do not match.");
|
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;
|
package com.nebula.web.common.utils;
|
||||||
|
|
||||||
import java.util.Objects;
|
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;
|
package com.nebula.web.common.utils;
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
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">
|
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>
|
<parent>
|
||||||
<groupId>io.github.weihubeats</groupId>
|
<groupId>io.github.weihubeats</groupId>
|
||||||
<artifactId>spring-boot-nebula</artifactId>
|
<artifactId>spring-boot-nebula</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>spring-boot-nebula-web</artifactId>
|
<artifactId>spring-boot-nebula-web</artifactId>
|
||||||
|
|
||||||
|
@ -37,5 +36,4 @@
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</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;
|
package com.nebula.web.boot.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
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;
|
package com.nebula.web.boot.annotation;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
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;
|
package com.nebula.web.boot.api;
|
||||||
|
|
||||||
import java.io.Serializable;
|
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;
|
package com.nebula.web.boot.api;
|
||||||
|
|
||||||
import java.util.Collection;
|
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;
|
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;
|
package com.nebula.web.boot.api;
|
||||||
|
|
||||||
import com.nebula.web.boot.enums.ResultCode;
|
import com.nebula.web.boot.enums.ResultCode;
|
||||||
|
@ -37,7 +54,6 @@ public class NebulaResponse<T> implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
|
|
||||||
private NebulaResponse(IResultCode resultCode) {
|
private NebulaResponse(IResultCode resultCode) {
|
||||||
this(resultCode, null, resultCode.getMessage());
|
this(resultCode, null, resultCode.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -145,7 +161,4 @@ public class NebulaResponse<T> implements Serializable {
|
||||||
return new NebulaResponse<>(ResultCode.FAILURE, msg);
|
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;
|
package com.nebula.web.boot.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
@ -28,16 +45,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class BaseWebMvcConfig implements WebMvcConfigurer {
|
public class BaseWebMvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
|
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
|
||||||
returnValueHandlers.add(new NebulaResponseBodyHandleReturnValue());
|
returnValueHandlers.add(new NebulaResponseBodyHandleReturnValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用 JACKSON 作为JSON MessageConverter
|
* 使用 JACKSON 作为JSON MessageConverter
|
||||||
* @param converters
|
* @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;
|
package com.nebula.web.boot.enums;
|
||||||
|
|
||||||
import com.nebula.web.boot.api.IResultCode;
|
import com.nebula.web.boot.api.IResultCode;
|
||||||
|
@ -35,7 +52,6 @@ public enum ResultCode implements IResultCode {
|
||||||
|
|
||||||
BIZ_EXCEPTION(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "业务异常");
|
BIZ_EXCEPTION(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "业务异常");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* code编码
|
* code编码
|
||||||
*/
|
*/
|
||||||
|
@ -45,10 +61,4 @@ public enum ResultCode implements IResultCode {
|
||||||
*/
|
*/
|
||||||
final String message;
|
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;
|
package com.nebula.web.boot.error;
|
||||||
|
|
||||||
import com.nebula.web.boot.api.NebulaResponse;
|
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;
|
package com.nebula.web.boot.exception;
|
||||||
|
|
||||||
import com.nebula.web.boot.api.IResultCode;
|
import com.nebula.web.boot.api.IResultCode;
|
||||||
|
@ -9,7 +26,8 @@ import lombok.Getter;
|
||||||
* @date : 2023/4/13 10:11
|
* @date : 2023/4/13 10:11
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
@Getter public abstract class BaseException extends RuntimeException {
|
@Getter
|
||||||
|
public abstract class BaseException extends RuntimeException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
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;
|
package com.nebula.web.boot.exception;
|
||||||
|
|
||||||
import com.nebula.web.boot.api.IResultCode;
|
import com.nebula.web.boot.api.IResultCode;
|
||||||
|
@ -12,7 +29,6 @@ public class BizException extends BaseException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
public BizException(String errMessage) {
|
public BizException(String errMessage) {
|
||||||
super(ResultCode.FAILURE, 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;
|
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;
|
package com.nebula.web.boot.exception;
|
||||||
|
|
||||||
import com.nebula.web.boot.enums.ResultCode;
|
import com.nebula.web.boot.enums.ResultCode;
|
||||||
|
@ -8,6 +25,7 @@ import com.nebula.web.boot.enums.ResultCode;
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
public class UnauthorizedException extends BaseException {
|
public class UnauthorizedException extends BaseException {
|
||||||
|
|
||||||
public UnauthorizedException(String errMessage) {
|
public UnauthorizedException(String errMessage) {
|
||||||
super(ResultCode.UNAUTHORIZED, 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;
|
package com.nebula.web.boot.interceptor;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
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;
|
package com.nebula.web.boot.jackson;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonEncoding;
|
import com.fasterxml.jackson.core.JsonEncoding;
|
||||||
|
@ -32,6 +49,7 @@ import org.springframework.util.TypeUtils;
|
||||||
* AbstractReadWriteJackson2HttpMessageConverter
|
* AbstractReadWriteJackson2HttpMessageConverter
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractReadWriteJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter {
|
public abstract class AbstractReadWriteJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter {
|
||||||
|
|
||||||
private static final java.nio.charset.Charset DEFAULT_CHARSET = Charsets.UTF_8;
|
private static final java.nio.charset.Charset DEFAULT_CHARSET = Charsets.UTF_8;
|
||||||
|
|
||||||
private final ObjectMapper writeObjectMapper;
|
private final ObjectMapper writeObjectMapper;
|
||||||
|
@ -76,8 +94,7 @@ public abstract class AbstractReadWriteJackson2HttpMessageConverter extends Abst
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeInternal(Object object, @Nullable Type type, HttpOutputMessage outputMessage)
|
protected void writeInternal(Object object, @Nullable Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
|
||||||
throws IOException, HttpMessageNotWritableException {
|
|
||||||
|
|
||||||
MediaType contentType = outputMessage.getHeaders().getContentType();
|
MediaType contentType = outputMessage.getHeaders().getContentType();
|
||||||
JsonEncoding encoding = getJsonEncoding(contentType);
|
JsonEncoding encoding = getJsonEncoding(contentType);
|
||||||
|
@ -100,8 +117,7 @@ public abstract class AbstractReadWriteJackson2HttpMessageConverter extends Abst
|
||||||
javaType = getJavaType(type, null);
|
javaType = getJavaType(type, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectWriter objectWriter = (serializationView != null ?
|
ObjectWriter objectWriter = (serializationView != null ? this.writeObjectMapper.writerWithView(serializationView) : this.writeObjectMapper.writer());
|
||||||
this.writeObjectMapper.writerWithView(serializationView) : this.writeObjectMapper.writer());
|
|
||||||
if (filters != null) {
|
if (filters != null) {
|
||||||
objectWriter = objectWriter.with(filters);
|
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;
|
package com.nebula.web.boot.jackson;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
@ -18,6 +35,7 @@ import java.time.LocalDateTime;
|
||||||
* </>
|
* </>
|
||||||
*/
|
*/
|
||||||
public class LocalDateTimeJacksonDeserializer extends JsonDeserializer<LocalDateTime> {
|
public class LocalDateTimeJacksonDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LocalDateTime deserialize(
|
public LocalDateTime deserialize(
|
||||||
JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
|
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;
|
package com.nebula.web.boot.jackson;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
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;
|
package com.nebula.web.boot.jackson;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
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;
|
package com.nebula.web.boot.resolver;
|
||||||
|
|
||||||
import com.nebula.base.utils.DataUtils;
|
import com.nebula.base.utils.DataUtils;
|
||||||
|
@ -28,7 +45,8 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
GetTimestamp getTimestamp = methodParameter.getParameterAnnotation(GetTimestamp.class);
|
||||||
Object instance = methodParameter.getParameterType().getDeclaredConstructor().newInstance();
|
Object instance = methodParameter.getParameterType().getDeclaredConstructor().newInstance();
|
||||||
String name = getTimestamp.name();
|
String name = getTimestamp.name();
|
||||||
|
@ -51,6 +69,7 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
||||||
}
|
}
|
||||||
|
|
||||||
class LocalDateTimeEditor extends PropertyEditorSupport {
|
class LocalDateTimeEditor extends PropertyEditorSupport {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAsText() {
|
public String getAsText() {
|
||||||
final LocalDateTime localDateTime = (LocalDateTime) getValue();
|
final LocalDateTime localDateTime = (LocalDateTime) getValue();
|
||||||
|
@ -78,6 +97,4 @@ public class TimestampArgumentResolver implements HandlerMethodArgumentResolver
|
||||||
return TimeUtil.toLocalDateTime(timestamp);
|
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.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.mockito.junit.jupiter.MockitoExtension;
|
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;
|
package com.nebula.web.boot.api;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
Loading…
Reference in New Issue