lubian cat
parent
233c61c5c6
commit
a7eb835b98
@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
||||
@ -0,0 +1,316 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# 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
|
||||
#
|
||||
# https://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.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||
. /usr/local/etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`\\unset -f command; \\command -v java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
$MAVEN_DEBUG_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" \
|
||||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
@ -0,0 +1,188 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% ^
|
||||
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||
%MAVEN_OPTS% ^
|
||||
%MAVEN_DEBUG_OPTS% ^
|
||||
-classpath %WRAPPER_JAR% ^
|
||||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||
|
||||
cmd /C exit /B %ERROR_CODE%
|
||||
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<!-- localRepository
|
||||
| The path to the local repository maven will use to store artifacts.
|
||||
|
|
||||
| Default: ${user.home}/.m2/repository
|
||||
<localRepository>/path/to/local/repo</localRepository>
|
||||
-->
|
||||
<localRepository>C:\Users\Administrator\.m2\repository</localRepository>
|
||||
|
||||
<pluginGroups>
|
||||
</pluginGroups>
|
||||
|
||||
<proxies>
|
||||
</proxies>
|
||||
|
||||
<!-- servers
|
||||
| This is a list of authentication profiles, keyed by the server-id used within the system.
|
||||
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|
||||
|-->
|
||||
<servers>
|
||||
<server>
|
||||
<id>pds-repo</id>
|
||||
<username>admin</username>
|
||||
<password>admin1234</password>
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
<!-- mirrors
|
||||
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
||||
|
|
||||
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
|
||||
| However, this repository may have problems with heavy traffic at times, so people have mirrored
|
||||
| it to several places.
|
||||
|
|
||||
| That repository definition will have a unique id, so we can create a mirror reference for that
|
||||
| repository, to be used as an alternate download site. The mirror site will be the preferred
|
||||
| server for that repository.
|
||||
|-->
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>pds-repo</id>
|
||||
<name>pds-repo</name>
|
||||
<url>http://192.168.1.28:8081/nexus/content/groups/public/</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
|
||||
<!-- profiles
|
||||
| This is a list of profiles which can be activated in a variety of ways, and which can modify
|
||||
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
|
||||
| specific paths and repository locations which allow the build to work in the local environment.
|
||||
|
|
||||
| For example, if you have an integration testing plugin - like cactus - that needs to know where
|
||||
| your Tomcat instance is installed, you can provide a variable here such that the variable is
|
||||
| dereferenced during the build process to configure the cactus plugin.
|
||||
|
|
||||
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
|
||||
| section of this document (settings.xml) - will be discussed later. Another way essentially
|
||||
| relies on the detection of a system property, either matching a particular value for the property,
|
||||
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
|
||||
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
|
||||
| Finally, the list of active profiles can be specified directly from the command line.
|
||||
|
|
||||
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
|
||||
| repositories, plugin repositories, and free-form properties to be used as configuration
|
||||
| variables for plugins in the POM.
|
||||
|
|
||||
|-->
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>pds-repo</id>
|
||||
<url>http://192.168.1.28:8081/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
<activeProfiles>
|
||||
<activeProfile>dev</activeProfile>
|
||||
</activeProfiles>
|
||||
</settings>
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<!-- localRepository
|
||||
| The path to the local repository maven will use to store artifacts.
|
||||
|
|
||||
| Default: ${user.home}/.m2/repository
|
||||
<localRepository>/path/to/local/repo</localRepository>
|
||||
-->
|
||||
<localRepository>C:\Users\Administrator\.m2\repository</localRepository>
|
||||
|
||||
<pluginGroups>
|
||||
</pluginGroups>
|
||||
|
||||
<proxies>
|
||||
</proxies>
|
||||
|
||||
<!-- servers
|
||||
| This is a list of authentication profiles, keyed by the server-id used within the system.
|
||||
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|
||||
|-->
|
||||
<servers>
|
||||
<server>
|
||||
<id>pds-repo</id>
|
||||
<username>admin</username>
|
||||
<password>admin1234</password>
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
<!-- mirrors
|
||||
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
||||
|
|
||||
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
|
||||
| However, this repository may have problems with heavy traffic at times, so people have mirrored
|
||||
| it to several places.
|
||||
|
|
||||
| That repository definition will have a unique id, so we can create a mirror reference for that
|
||||
| repository, to be used as an alternate download site. The mirror site will be the preferred
|
||||
| server for that repository.
|
||||
|-->
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>pds-repo</id>
|
||||
<name>pds-repo</name>
|
||||
<url>http://192.168.1.28:8081/repository/maven-public/</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
|
||||
<!-- profiles
|
||||
| This is a list of profiles which can be activated in a variety of ways, and which can modify
|
||||
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
|
||||
| specific paths and repository locations which allow the build to work in the local environment.
|
||||
|
|
||||
| For example, if you have an integration testing plugin - like cactus - that needs to know where
|
||||
| your Tomcat instance is installed, you can provide a variable here such that the variable is
|
||||
| dereferenced during the build process to configure the cactus plugin.
|
||||
|
|
||||
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
|
||||
| section of this document (settings.xml) - will be discussed later. Another way essentially
|
||||
| relies on the detection of a system property, either matching a particular value for the property,
|
||||
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
|
||||
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
|
||||
| Finally, the list of active profiles can be specified directly from the command line.
|
||||
|
|
||||
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
|
||||
| repositories, plugin repositories, and free-form properties to be used as configuration
|
||||
| variables for plugins in the POM.
|
||||
|
|
||||
|-->
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>pds-repo</id>
|
||||
<url>http://192.168.1.28:8081/repository/maven-public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
<activeProfiles>
|
||||
<activeProfile>dev</activeProfile>
|
||||
</activeProfiles>
|
||||
</settings>
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
package com.rehome.jpahefengweather.controller;
|
||||
|
||||
import com.liuhuiyu.util.model.Result;
|
||||
import com.rehome.jpahefengweather.dto.TyphoonBaseDto;
|
||||
import com.rehome.jpahefengweather.dto.TyphoonTfidDto;
|
||||
import com.rehome.jpahefengweather.dto.WztfStormInfoDto;
|
||||
import com.rehome.jpahefengweather.entity.*;
|
||||
import com.rehome.jpahefengweather.service.WztfStormService;
|
||||
import com.rehome.jpahefengweather.service.ZjsltStormService;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/typhoon")
|
||||
public class TyphoonController {
|
||||
@Resource
|
||||
private ZjsltStormService zjsltStormService;
|
||||
@Resource
|
||||
private WztfStormService wztfStormService;
|
||||
|
||||
|
||||
//region 根据年份获取台风列表
|
||||
@PostMapping("/getStormListByYear")
|
||||
@ApiOperation(value = "获取台风列表", notes = "获取台风列表")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "dto", value = "获取台风列表", dataTypeClass = TyphoonBaseDto.class, paramType = "body", required = true),
|
||||
})
|
||||
public Result<List<ZjsltStorm>> getStormListByYear(@Validated @RequestBody TyphoonBaseDto dto){
|
||||
return Result.of(this.zjsltStormService.findByYear(dto.getYear()));
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region 根据台风id获取单条台风数据
|
||||
@PostMapping("/getTyphoonInfoByTfid")
|
||||
@ApiOperation(value = "根据台风id获取单条台风数据", notes = "根据台风id获取单条台风数据")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "dto", value = "根据台风id获取单条台风数据", dataTypeClass = TyphoonTfidDto.class, paramType = "body", required = true),
|
||||
})
|
||||
public Result<TyphoonInfo> getTyphoonInfoByTfid(@Validated @RequestBody TyphoonTfidDto dto){
|
||||
return Result.of(this.zjsltStormService.findTyphoonInfoByTfid(dto.getTfid()));
|
||||
}
|
||||
//endregion
|
||||
//region 根据年份获取台风列表
|
||||
@PostMapping("/getWztfStormListByYear")
|
||||
@ApiOperation(value = "获取台风列表", notes = "获取台风列表")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "dto", value = "获取台风列表", dataTypeClass = TyphoonBaseDto.class, paramType = "body", required = true),
|
||||
})
|
||||
public Result<List<WztfStorm>> getWztfStormListByYear(@Validated @RequestBody TyphoonBaseDto dto){
|
||||
return Result.of(this.wztfStormService.findByYear(dto.getYear()));
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region 根据台风id获取单条台风数据
|
||||
@PostMapping("/getWztfStormInfoByTfbh")
|
||||
@ApiOperation(value = "根据台风id获取单条台风数据", notes = "根据台风id获取单条台风数据")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "dto", value = "根据台风id获取单条台风数据", dataTypeClass = WztfStormInfoDto.class, paramType = "body", required = true),
|
||||
})
|
||||
public Result<WztfStormInfo> getWztfStormInfoByTfbh(@Validated @RequestBody WztfStormInfoDto dto){
|
||||
return Result.of(this.wztfStormService.findWztfStormInfoByTfbh(dto.getTfbh()));
|
||||
}
|
||||
//endregion
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.rehome.jpahefengweather.dao;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-02-21 16:17
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface FullWhere<T> {
|
||||
/**
|
||||
* 功能描述
|
||||
*
|
||||
* @param find 查询条件
|
||||
* @param sqlBuilder sql
|
||||
* @param parameterMap 参数列表
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-02-21 16:19
|
||||
*/
|
||||
void fullWhere(T find, StringBuilder sqlBuilder, Map<String, Object> parameterMap);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "BaseFindDto", description = "接收数据")
|
||||
public class BaseFindDto{
|
||||
@ApiModelProperty("位置id,从城市列表获取")
|
||||
private String locationId;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return cc.rehome.zhanjiang.data_center_model.domain.security.authorize.maintenance_temporary.in.MaintenanceTemporaryFindDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static BaseFindDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, BaseFindDto.class);
|
||||
}
|
||||
|
||||
public String getLocationId() {
|
||||
return locationId;
|
||||
}
|
||||
|
||||
public void setLocationId(String locationId) {
|
||||
this.locationId = locationId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "BaseWeatherFindDto", description = "接收数据")
|
||||
public class BaseWeatherFindDto extends BaseFindDto{
|
||||
@ApiModelProperty("查询天气的日期")
|
||||
private String weatherDate;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return cc.rehome.zhanjiang.data_center_model.domain.security.authorize.maintenance_temporary.in.MaintenanceTemporaryFindDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static BaseWeatherFindDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, BaseWeatherFindDto.class);
|
||||
}
|
||||
|
||||
public String getWeatherDate() {
|
||||
return weatherDate;
|
||||
}
|
||||
|
||||
public void setWeatherDate(String weatherDate) {
|
||||
this.weatherDate = weatherDate;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,301 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "ForecastDto", description = "实时天气数据")
|
||||
public class ForecastDto {
|
||||
|
||||
@ApiModelProperty("预报日期")
|
||||
private String fxDate;
|
||||
@ApiModelProperty("日出时间")
|
||||
private String sunrise;
|
||||
@ApiModelProperty("日落时间")
|
||||
private String sunset;
|
||||
@ApiModelProperty("月升时间")
|
||||
private String moonrise;
|
||||
@ApiModelProperty("月落时间")
|
||||
private String moonset;
|
||||
@ApiModelProperty("月相名称")
|
||||
private String moonPhase;
|
||||
@ApiModelProperty("月相图标代码,图标可通过天气状况和图标下载")
|
||||
private String moonPhaseIcon;
|
||||
@ApiModelProperty("预报当天最高温度")
|
||||
private String tempMax;
|
||||
@ApiModelProperty("预报当天最低温度")
|
||||
private String tempMin;
|
||||
@ApiModelProperty("预报白天天气状况的图标代码,图标可通过天气状况和图标下载")
|
||||
private String iconDay;
|
||||
@ApiModelProperty("预报白天天气状况文字描述,包括阴晴雨雪等天气状态的描述")
|
||||
private String textDay;
|
||||
@ApiModelProperty("预报夜间天气状况的图标代码,图标可通过天气状况和图标下载")
|
||||
private String iconNight;
|
||||
@ApiModelProperty("预报晚间天气状况文字描述,包括阴晴雨雪等天气状态的描述")
|
||||
private String textNight;
|
||||
@ApiModelProperty("预报白天风向360角度")
|
||||
private String wind360Day;
|
||||
@ApiModelProperty("预报白天风向")
|
||||
private String windDirDay;
|
||||
@ApiModelProperty("预报白天风力等级")
|
||||
private String windScaleDay;
|
||||
@ApiModelProperty("预报白天风速,公里/小时")
|
||||
private String windSpeedDay;
|
||||
@ApiModelProperty("预报夜间风向360角度")
|
||||
private String wind360Night;
|
||||
@ApiModelProperty("预报夜间当天风向")
|
||||
private String windDirNight;
|
||||
@ApiModelProperty("预报夜间风力等级")
|
||||
private String windScaleNight;
|
||||
@ApiModelProperty("预报夜间风速,公里/小时")
|
||||
private String windSpeedNight;
|
||||
@ApiModelProperty("预报当天总降水量,默认单位:毫米")
|
||||
private String precip;
|
||||
@ApiModelProperty("紫外线强度指数")
|
||||
private String uvIndex;
|
||||
@ApiModelProperty("相对湿度,百分比数值")
|
||||
private String humidity;
|
||||
@ApiModelProperty("大气压强,默认单位:百帕")
|
||||
private String pressure;
|
||||
@ApiModelProperty("能见度,默认单位:公里")
|
||||
private String vis;
|
||||
@ApiModelProperty("云量,百分比数值。可能为空")
|
||||
private String cloud;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static ForecastDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, ForecastDto.class);
|
||||
}
|
||||
|
||||
public String getFxDate() {
|
||||
return fxDate;
|
||||
}
|
||||
|
||||
public void setFxDate(String fxDate) {
|
||||
this.fxDate = fxDate;
|
||||
}
|
||||
|
||||
public String getSunrise() {
|
||||
return sunrise;
|
||||
}
|
||||
|
||||
public void setSunrise(String sunrise) {
|
||||
this.sunrise = sunrise;
|
||||
}
|
||||
|
||||
public String getSunset() {
|
||||
return sunset;
|
||||
}
|
||||
|
||||
public void setSunset(String sunset) {
|
||||
this.sunset = sunset;
|
||||
}
|
||||
|
||||
public String getMoonrise() {
|
||||
return moonrise;
|
||||
}
|
||||
|
||||
public void setMoonrise(String moonrise) {
|
||||
this.moonrise = moonrise;
|
||||
}
|
||||
|
||||
public String getMoonset() {
|
||||
return moonset;
|
||||
}
|
||||
|
||||
public void setMoonset(String moonset) {
|
||||
this.moonset = moonset;
|
||||
}
|
||||
|
||||
public String getMoonPhase() {
|
||||
return moonPhase;
|
||||
}
|
||||
|
||||
public void setMoonPhase(String moonPhase) {
|
||||
this.moonPhase = moonPhase;
|
||||
}
|
||||
|
||||
public String getMoonPhaseIcon() {
|
||||
return moonPhaseIcon;
|
||||
}
|
||||
|
||||
public void setMoonPhaseIcon(String moonPhaseIcon) {
|
||||
this.moonPhaseIcon = moonPhaseIcon;
|
||||
}
|
||||
|
||||
public String getTempMax() {
|
||||
return tempMax;
|
||||
}
|
||||
|
||||
public void setTempMax(String tempMax) {
|
||||
this.tempMax = tempMax;
|
||||
}
|
||||
|
||||
public String getTempMin() {
|
||||
return tempMin;
|
||||
}
|
||||
|
||||
public void setTempMin(String tempMin) {
|
||||
this.tempMin = tempMin;
|
||||
}
|
||||
|
||||
public String getIconDay() {
|
||||
return iconDay;
|
||||
}
|
||||
|
||||
public void setIconDay(String iconDay) {
|
||||
this.iconDay = iconDay;
|
||||
}
|
||||
|
||||
public String getTextDay() {
|
||||
return textDay;
|
||||
}
|
||||
|
||||
public void setTextDay(String textDay) {
|
||||
this.textDay = textDay;
|
||||
}
|
||||
|
||||
public String getIconNight() {
|
||||
return iconNight;
|
||||
}
|
||||
|
||||
public void setIconNight(String iconNight) {
|
||||
this.iconNight = iconNight;
|
||||
}
|
||||
|
||||
public String getTextNight() {
|
||||
return textNight;
|
||||
}
|
||||
|
||||
public void setTextNight(String textNight) {
|
||||
this.textNight = textNight;
|
||||
}
|
||||
|
||||
public String getWind360Day() {
|
||||
return wind360Day;
|
||||
}
|
||||
|
||||
public void setWind360Day(String wind360Day) {
|
||||
this.wind360Day = wind360Day;
|
||||
}
|
||||
|
||||
public String getWindDirDay() {
|
||||
return windDirDay;
|
||||
}
|
||||
|
||||
public void setWindDirDay(String windDirDay) {
|
||||
this.windDirDay = windDirDay;
|
||||
}
|
||||
|
||||
public String getWindScaleDay() {
|
||||
return windScaleDay;
|
||||
}
|
||||
|
||||
public void setWindScaleDay(String windScaleDay) {
|
||||
this.windScaleDay = windScaleDay;
|
||||
}
|
||||
|
||||
public String getWindSpeedDay() {
|
||||
return windSpeedDay;
|
||||
}
|
||||
|
||||
public void setWindSpeedDay(String windSpeedDay) {
|
||||
this.windSpeedDay = windSpeedDay;
|
||||
}
|
||||
|
||||
public String getWind360Night() {
|
||||
return wind360Night;
|
||||
}
|
||||
|
||||
public void setWind360Night(String wind360Night) {
|
||||
this.wind360Night = wind360Night;
|
||||
}
|
||||
|
||||
public String getWindDirNight() {
|
||||
return windDirNight;
|
||||
}
|
||||
|
||||
public void setWindDirNight(String windDirNight) {
|
||||
this.windDirNight = windDirNight;
|
||||
}
|
||||
|
||||
public String getWindScaleNight() {
|
||||
return windScaleNight;
|
||||
}
|
||||
|
||||
public void setWindScaleNight(String windScaleNight) {
|
||||
this.windScaleNight = windScaleNight;
|
||||
}
|
||||
|
||||
public String getWindSpeedNight() {
|
||||
return windSpeedNight;
|
||||
}
|
||||
|
||||
public void setWindSpeedNight(String windSpeedNight) {
|
||||
this.windSpeedNight = windSpeedNight;
|
||||
}
|
||||
|
||||
public String getPrecip() {
|
||||
return precip;
|
||||
}
|
||||
|
||||
public void setPrecip(String precip) {
|
||||
this.precip = precip;
|
||||
}
|
||||
|
||||
public String getUvIndex() {
|
||||
return uvIndex;
|
||||
}
|
||||
|
||||
public void setUvIndex(String uvIndex) {
|
||||
this.uvIndex = uvIndex;
|
||||
}
|
||||
|
||||
public String getHumidity() {
|
||||
return humidity;
|
||||
}
|
||||
|
||||
public void setHumidity(String humidity) {
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
public String getPressure() {
|
||||
return pressure;
|
||||
}
|
||||
|
||||
public void setPressure(String pressure) {
|
||||
this.pressure = pressure;
|
||||
}
|
||||
|
||||
public String getVis() {
|
||||
return vis;
|
||||
}
|
||||
|
||||
public void setVis(String vis) {
|
||||
this.vis = vis;
|
||||
}
|
||||
|
||||
public String getCloud() {
|
||||
return cloud;
|
||||
}
|
||||
|
||||
public void setCloud(String cloud) {
|
||||
this.cloud = cloud;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "ForecastWeatherDto", description = "接收数据")
|
||||
public class ForecastWeatherDto extends BaseDto{
|
||||
@ApiModelProperty("天气预报数据")
|
||||
private List<ForecastDto> daily;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static ForecastWeatherDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, ForecastWeatherDto.class);
|
||||
}
|
||||
|
||||
public List<ForecastDto> getDaily() {
|
||||
return daily;
|
||||
}
|
||||
|
||||
public void setDaily(List<ForecastDto> daily) {
|
||||
this.daily = daily;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "NmcForecastWeatherDto", description = "接收数据")
|
||||
public class NmcForecastWeatherDto extends NmcBaseDto{
|
||||
@ApiModelProperty("实时天气数据")
|
||||
private List<List<String>> data;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 NmcNowWeatherDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.NmcNowWeatherDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static NmcForecastWeatherDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, NmcForecastWeatherDto.class);
|
||||
}
|
||||
|
||||
public List<List<String>> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<List<String>> data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import com.rehome.jpahefengweather.dto.bean.NmcNowData;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "NmcNowWeatherDto", description = "接收数据")
|
||||
public class NmcNowWeatherDto extends NmcBaseDto{
|
||||
@ApiModelProperty("实时天气数据")
|
||||
private NmcNowData data;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 NmcNowWeatherDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.NmcNowWeatherDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static NmcNowWeatherDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, NmcNowWeatherDto.class);
|
||||
}
|
||||
|
||||
public NmcNowData getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(NmcNowData data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,179 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "NowDto", description = "实时天气数据")
|
||||
public class NowDto {
|
||||
@ApiModelProperty("数据观测时间")
|
||||
private String obsTime;
|
||||
@ApiModelProperty("温度,默认单位:摄氏度")
|
||||
private String temp;
|
||||
@ApiModelProperty("体感温度,默认单位:摄氏度")
|
||||
private String feelsLike;
|
||||
@ApiModelProperty("天气状况和图标的代码,图标可通过天气状况和图标下载")
|
||||
private String icon;
|
||||
@ApiModelProperty("天气状况的文字描述,包括阴晴雨雪等天气状态的描述")
|
||||
private String text;
|
||||
@ApiModelProperty("风向360角度")
|
||||
private String wind360;
|
||||
@ApiModelProperty("风向")
|
||||
private String windDir;
|
||||
@ApiModelProperty("风力等级")
|
||||
private String windScale;
|
||||
@ApiModelProperty("风速,公里/小时")
|
||||
private String windSpeed;
|
||||
@ApiModelProperty("相对湿度,百分比数值")
|
||||
private String humidity;
|
||||
@ApiModelProperty("当前小时累计降水量,默认单位:毫米")
|
||||
private String precip;
|
||||
@ApiModelProperty("大气压强,默认单位:百帕")
|
||||
private String pressure;
|
||||
@ApiModelProperty("能见度,默认单位:公里")
|
||||
private String vis;
|
||||
@ApiModelProperty("云量,百分比数值。可能为空")
|
||||
private String cloud;
|
||||
@ApiModelProperty("露点温度。可能为空")
|
||||
private String dew;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static NowDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, NowDto.class);
|
||||
}
|
||||
|
||||
public String getObsTime() {
|
||||
return obsTime;
|
||||
}
|
||||
|
||||
public void setObsTime(String obsTime) {
|
||||
this.obsTime = obsTime;
|
||||
}
|
||||
|
||||
public String getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
public void setTemp(String temp) {
|
||||
this.temp = temp;
|
||||
}
|
||||
|
||||
public String getFeelsLike() {
|
||||
return feelsLike;
|
||||
}
|
||||
|
||||
public void setFeelsLike(String feelsLike) {
|
||||
this.feelsLike = feelsLike;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getWind360() {
|
||||
return wind360;
|
||||
}
|
||||
|
||||
public void setWind360(String wind360) {
|
||||
this.wind360 = wind360;
|
||||
}
|
||||
|
||||
public String getWindDir() {
|
||||
return windDir;
|
||||
}
|
||||
|
||||
public void setWindDir(String windDir) {
|
||||
this.windDir = windDir;
|
||||
}
|
||||
|
||||
public String getWindScale() {
|
||||
return windScale;
|
||||
}
|
||||
|
||||
public void setWindScale(String windScale) {
|
||||
this.windScale = windScale;
|
||||
}
|
||||
|
||||
public String getWindSpeed() {
|
||||
return windSpeed;
|
||||
}
|
||||
|
||||
public void setWindSpeed(String windSpeed) {
|
||||
this.windSpeed = windSpeed;
|
||||
}
|
||||
|
||||
public String getHumidity() {
|
||||
return humidity;
|
||||
}
|
||||
|
||||
public void setHumidity(String humidity) {
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
public String getPrecip() {
|
||||
return precip;
|
||||
}
|
||||
|
||||
public void setPrecip(String precip) {
|
||||
this.precip = precip;
|
||||
}
|
||||
|
||||
public String getPressure() {
|
||||
return pressure;
|
||||
}
|
||||
|
||||
public void setPressure(String pressure) {
|
||||
this.pressure = pressure;
|
||||
}
|
||||
|
||||
public String getVis() {
|
||||
return vis;
|
||||
}
|
||||
|
||||
public void setVis(String vis) {
|
||||
this.vis = vis;
|
||||
}
|
||||
|
||||
public String getCloud() {
|
||||
return cloud;
|
||||
}
|
||||
|
||||
public void setCloud(String cloud) {
|
||||
this.cloud = cloud;
|
||||
}
|
||||
|
||||
public String getDew() {
|
||||
return dew;
|
||||
}
|
||||
|
||||
public void setDew(String dew) {
|
||||
this.dew = dew;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "NowWeatherDto", description = "接收数据")
|
||||
public class NowWeatherDto extends BaseDto{
|
||||
@ApiModelProperty("实时天气数据")
|
||||
private NowDto now;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static NowWeatherDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, NowWeatherDto.class);
|
||||
}
|
||||
|
||||
public NowDto getNow() {
|
||||
return now;
|
||||
}
|
||||
|
||||
public void setNow(NowDto now) {
|
||||
this.now = now;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "StormDataDto", description = "接收数据")
|
||||
@Data
|
||||
public class StormDataDto extends BaseDto{
|
||||
@ApiModelProperty("获取台风列表数据")
|
||||
List<List<String>> typhoonList;
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static StormDataDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, StormDataDto.class);
|
||||
}
|
||||
|
||||
public List<List<String>> getTyphoonList() {
|
||||
return typhoonList;
|
||||
}
|
||||
|
||||
public void setTyphoonList(List<List<String>> typhoonList) {
|
||||
this.typhoonList = typhoonList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,190 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-08-23 11:13
|
||||
*/
|
||||
@ApiModel(value = "TyhoonActivityDto", description = "实时活跃台风")
|
||||
public class TyhoonActivityDto {
|
||||
|
||||
@ApiModelProperty("台风英文名")
|
||||
private String enname;
|
||||
@ApiModelProperty("纬度")
|
||||
private String lat;
|
||||
@ApiModelProperty("经度")
|
||||
private String lng;
|
||||
@ApiModelProperty("台风移动方向")
|
||||
private String movedirection;
|
||||
@ApiModelProperty("台风移动速速")
|
||||
private String movespeed;
|
||||
@ApiModelProperty("台风中文名")
|
||||
private String name;
|
||||
@ApiModelProperty("台风风力等级")
|
||||
private String power;
|
||||
@ApiModelProperty("中心气压,大气压强,默认单位:百帕")
|
||||
private String pressure;
|
||||
@ApiModelProperty("七级风速圈半径")
|
||||
private String radius7;
|
||||
@ApiModelProperty("十级风速圈半径")
|
||||
private String radius10;
|
||||
@ApiModelProperty("十二级风速圈半径")
|
||||
private String radius12;
|
||||
@ApiModelProperty("台风风速")
|
||||
private String speed;
|
||||
@ApiModelProperty("台风等级名称")
|
||||
private String strong;
|
||||
@ApiModelProperty("台风id")
|
||||
private String tfid;
|
||||
@ApiModelProperty("发布时间")
|
||||
private String time;
|
||||
@ApiModelProperty("发布时间格式化")
|
||||
private String timeformate;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 TyhoonActivityDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.TyhoonActivityDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-08-23 11:13
|
||||
*/
|
||||
public static TyhoonActivityDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, TyhoonActivityDto.class);
|
||||
}
|
||||
|
||||
public String getEnname() {
|
||||
return enname;
|
||||
}
|
||||
|
||||
public void setEnname(String enname) {
|
||||
this.enname = enname;
|
||||
}
|
||||
|
||||
public String getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(String lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getLng() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public void setLng(String lng) {
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
public String getMovedirection() {
|
||||
return movedirection;
|
||||
}
|
||||
|
||||
public void setMovedirection(String movedirection) {
|
||||
this.movedirection = movedirection;
|
||||
}
|
||||
|
||||
public String getMovespeed() {
|
||||
return movespeed;
|
||||
}
|
||||
|
||||
public void setMovespeed(String movespeed) {
|
||||
this.movespeed = movespeed;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
public void setPower(String power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public String getPressure() {
|
||||
return pressure;
|
||||
}
|
||||
|
||||
public void setPressure(String pressure) {
|
||||
this.pressure = pressure;
|
||||
}
|
||||
|
||||
public String getRadius7() {
|
||||
return radius7;
|
||||
}
|
||||
|
||||
public void setRadius7(String radius7) {
|
||||
this.radius7 = radius7;
|
||||
}
|
||||
|
||||
public String getRadius10() {
|
||||
return radius10;
|
||||
}
|
||||
|
||||
public void setRadius10(String radius10) {
|
||||
this.radius10 = radius10;
|
||||
}
|
||||
|
||||
public String getRadius12() {
|
||||
return radius12;
|
||||
}
|
||||
|
||||
public void setRadius12(String radius12) {
|
||||
this.radius12 = radius12;
|
||||
}
|
||||
|
||||
public String getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(String speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public String getStrong() {
|
||||
return strong;
|
||||
}
|
||||
|
||||
public void setStrong(String strong) {
|
||||
this.strong = strong;
|
||||
}
|
||||
|
||||
public String getTfid() {
|
||||
return tfid;
|
||||
}
|
||||
|
||||
public void setTfid(String tfid) {
|
||||
this.tfid = tfid;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getTimeformate() {
|
||||
return timeformate;
|
||||
}
|
||||
|
||||
public void setTimeformate(String timeformate) {
|
||||
this.timeformate = timeformate;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "TyphoonBaseDto", description = "实时天气数据")
|
||||
public class TyphoonBaseDto {
|
||||
@ApiModelProperty("数据观测时间")
|
||||
private String year;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static TyphoonBaseDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, TyphoonBaseDto.class);
|
||||
}
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "TyphoonTfidDto", description = "实时天气数据")
|
||||
public class TyphoonTfidDto {
|
||||
@ApiModelProperty("数据观测时间")
|
||||
private String tfid;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static TyphoonTfidDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, TyphoonTfidDto.class);
|
||||
}
|
||||
|
||||
public String getTfid() {
|
||||
return tfid;
|
||||
}
|
||||
|
||||
public void setTfid(String tfid) {
|
||||
this.tfid = tfid;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.rehome.jpahefengweather.dto;
|
||||
|
||||
|
||||
import com.liuhuiyu.util.map.MapUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author HuangWenFei
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-05-01 16:22
|
||||
*/
|
||||
@ApiModel(value = "WztfStormInfoDto", description = "实时天气数据")
|
||||
public class WztfStormInfoDto {
|
||||
@ApiModelProperty("数据观测时间")
|
||||
private String tfbh;
|
||||
|
||||
|
||||
/**
|
||||
* 根据 map 还原 MaintenanceTemporaryFindDto
|
||||
*
|
||||
* @param map 映射map
|
||||
* @return com.rehome.jpahefengweather.dto.BaseDto
|
||||
* @author HuangWenFei
|
||||
* Created DateTime 2022-04-19 10:02
|
||||
*/
|
||||
public static WztfStormInfoDto ofSelfMap(Map<String, Object> map) {
|
||||
return MapUtil.fromMap(map, WztfStormInfoDto.class);
|
||||
}
|
||||
|
||||
public String getTfbh() {
|
||||
return tfbh;
|
||||
}
|
||||
|
||||
public void setTfbh(String tfbh) {
|
||||
this.tfbh = tfbh;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Air {
|
||||
private String forecasttime;
|
||||
private int aqi;
|
||||
private int aq;
|
||||
private String text;
|
||||
private String aqiCode;
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
public class NmcForecastData {
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import com.rehome.jpahefengweather.dto.NmcBaseDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class NmcNowData {
|
||||
//实时天气
|
||||
Real real;
|
||||
//空气
|
||||
Air air;
|
||||
//温度变化图表曲线图数据
|
||||
List<Tempchart> tempchart;
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Real {
|
||||
private String publish_time;
|
||||
private Station station;
|
||||
private Weather weather;
|
||||
private Wind wind;
|
||||
private Warn warn;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Station {
|
||||
private String code;
|
||||
private String province;
|
||||
private String city;
|
||||
private String url;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Tempchart {
|
||||
private String time;
|
||||
private int max_temp;
|
||||
private int min_temp;
|
||||
private String day_img;
|
||||
private String day_text;
|
||||
private String night_img;
|
||||
private String night_text;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Warn {
|
||||
private String alert;
|
||||
private String pic;
|
||||
private String province;
|
||||
private String city;
|
||||
private String url;
|
||||
private String issuecontent;
|
||||
private String fmeans;
|
||||
private String signaltype;
|
||||
private String signallevel;
|
||||
private String pic2;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Weather {
|
||||
private double temperature;
|
||||
private double temperatureDiff;
|
||||
private int airpressure;
|
||||
private int humidity;
|
||||
private int rain;
|
||||
private int rcomfort;
|
||||
private int icomfort;
|
||||
private String info;
|
||||
private String img;
|
||||
private double feelst;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.rehome.jpahefengweather.dto.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Wind {
|
||||
private String direct;
|
||||
private int degree;
|
||||
private String power;
|
||||
private double speed;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.rehome.jpahefengweather.entity;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Proxy(lazy = false)
|
||||
@Data
|
||||
@Entity
|
||||
public class TyphoonInfo implements Serializable {
|
||||
@Id
|
||||
private String tfid;
|
||||
|
||||
//存放长文本
|
||||
@Lob
|
||||
@Basic(fetch=FetchType.LAZY)
|
||||
private String stormData;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date createDate;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date lastUpdateDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.rehome.jpahefengweather.entity;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Proxy(lazy = false)
|
||||
@Data
|
||||
@Entity
|
||||
public class WztfStorm implements Serializable {
|
||||
@Id
|
||||
private String tfbh;
|
||||
|
||||
//台风中文名称
|
||||
private String name ;
|
||||
|
||||
//台风英文名称
|
||||
private String ename;
|
||||
|
||||
//台风结束时间
|
||||
private String end_time ;
|
||||
|
||||
//台风开始时间
|
||||
private String begin_time ;
|
||||
|
||||
//台风标识
|
||||
private String ident;
|
||||
|
||||
//是否为活跃台风 1:活跃台风 0:台风已停止
|
||||
private int is_current ;
|
||||
|
||||
//台风所处年份
|
||||
private String year ;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date createDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.rehome.jpahefengweather.entity;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Proxy(lazy = false)
|
||||
@Data
|
||||
@Entity
|
||||
public class WztfStormInfo implements Serializable {
|
||||
@Id
|
||||
private String tfbh;
|
||||
|
||||
//存放长文本
|
||||
@Lob
|
||||
@Basic(fetch=FetchType.LAZY)
|
||||
private String stormData;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date createDate;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date lastUpdateDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.rehome.jpahefengweather.entity;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Proxy(lazy = false)
|
||||
@Data
|
||||
@Entity
|
||||
public class ZjsltStorm implements Serializable {
|
||||
@Id
|
||||
private String tfid;
|
||||
|
||||
//台风英文名称
|
||||
private String enname;
|
||||
|
||||
//台风中文名称
|
||||
private String name ;
|
||||
|
||||
//台风结束时间
|
||||
private String endtime ;
|
||||
|
||||
//台风开始时间
|
||||
private String starttime ;
|
||||
|
||||
//提示等级
|
||||
private String warnlevel;
|
||||
|
||||
//是否为活跃台风 1:活跃台风 0:台风已停止
|
||||
private String isactive ;
|
||||
|
||||
//台风所处年份
|
||||
private String year ;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date createDate;
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.rehome.jpahefengweather.service.Impl;
|
||||
|
||||
import com.rehome.jpahefengweather.dao.TyphoonInfoRepository;
|
||||
import com.rehome.jpahefengweather.dao.WztfStormInfoRepository;
|
||||
import com.rehome.jpahefengweather.dao.WztfStormRepository;
|
||||
import com.rehome.jpahefengweather.dao.ZjsltStormRepository;
|
||||
import com.rehome.jpahefengweather.entity.WztfStorm;
|
||||
import com.rehome.jpahefengweather.entity.WztfStormInfo;
|
||||
import com.rehome.jpahefengweather.service.WztfStormService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class WztfStormServiceImpl implements WztfStormService {
|
||||
|
||||
@Resource
|
||||
private WztfStormRepository wztfStormRepository;
|
||||
@Resource
|
||||
private WztfStormInfoRepository wztfStormInfoRepository;
|
||||
|
||||
@Override
|
||||
public WztfStorm findByTfbh(String tfbh) {
|
||||
return this.wztfStormRepository.findByTfbh(tfbh);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WztfStorm> findByYear(String year) {
|
||||
return this.wztfStormRepository.findByYear(year);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWztfStorm(WztfStorm wztfStorm) {
|
||||
this.wztfStormRepository.save(wztfStorm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WztfStormInfo findWztfStormInfoByTfbh(String tfbh) {
|
||||
return this.wztfStormInfoRepository.findByTfbh(tfbh);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWztfStormInfo(WztfStormInfo wztfStormInfo) {
|
||||
this.wztfStormInfoRepository.save(wztfStormInfo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.rehome.jpahefengweather.service.Impl;
|
||||
|
||||
import com.rehome.jpahefengweather.dao.TyphoonInfoRepository;
|
||||
import com.rehome.jpahefengweather.dao.ZjsltStormRepository;
|
||||
import com.rehome.jpahefengweather.entity.TyphoonInfo;
|
||||
import com.rehome.jpahefengweather.entity.ZjsltStorm;
|
||||
import com.rehome.jpahefengweather.service.ZjsltStormService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ZjsltStormServiceImpl implements ZjsltStormService {
|
||||
@Resource
|
||||
private ZjsltStormRepository zjsltStormRepository;
|
||||
@Resource
|
||||
private TyphoonInfoRepository typhoonInfoRepository;
|
||||
|
||||
|
||||
@Override
|
||||
public ZjsltStorm findByTfid(String tfid) {
|
||||
return this.zjsltStormRepository.findByTfid(tfid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZjsltStorm> findByYear(String year) {
|
||||
return this.zjsltStormRepository.findByYear(year);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveZjsltStorm(ZjsltStorm zjsltStorm) {
|
||||
this.zjsltStormRepository.save(zjsltStorm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TyphoonInfo findTyphoonInfoByTfid(String tfid) {
|
||||
return this.typhoonInfoRepository.findByTfid(tfid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveTyphoonInfo(TyphoonInfo typhoonInfo) {
|
||||
this.typhoonInfoRepository.save(typhoonInfo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.rehome.jpahefengweather.service;
|
||||
|
||||
|
||||
import com.rehome.jpahefengweather.entity.WztfStorm;
|
||||
import com.rehome.jpahefengweather.entity.WztfStormInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WztfStormService {
|
||||
//根据id查询台风
|
||||
WztfStorm findByTfbh(String tfbh);
|
||||
//根据年份查询台风列表
|
||||
List<WztfStorm> findByYear(String year);
|
||||
/**
|
||||
* 保存台风数据
|
||||
*/
|
||||
void saveWztfStorm(WztfStorm wztfStorm);
|
||||
|
||||
WztfStormInfo findWztfStormInfoByTfbh(String tfbh);
|
||||
/**
|
||||
* 保存台风路径数据
|
||||
*/
|
||||
void saveWztfStormInfo(WztfStormInfo wztfStormInfo);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.rehome.jpahefengweather.service;
|
||||
|
||||
|
||||
import com.rehome.jpahefengweather.entity.TyphoonInfo;
|
||||
import com.rehome.jpahefengweather.entity.ZjsltStorm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ZjsltStormService {
|
||||
//根据id查询台风
|
||||
ZjsltStorm findByTfid(String tfid);
|
||||
//根据年份查询台风列表
|
||||
List<ZjsltStorm> findByYear(String year);
|
||||
/**
|
||||
* 保存台风数据
|
||||
*/
|
||||
void saveZjsltStorm(ZjsltStorm zjsltStorm);
|
||||
|
||||
TyphoonInfo findTyphoonInfoByTfid(String tfid);
|
||||
/**
|
||||
* 保存台风路径数据
|
||||
*/
|
||||
void saveTyphoonInfo(TyphoonInfo typhoonInfo);
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* dao工具类
|
||||
*
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-01-12 9:38
|
||||
*/
|
||||
public class DaoUtil {
|
||||
/**
|
||||
* oracle分页查询
|
||||
*
|
||||
* @param sqlBuilder 原始sql
|
||||
* @param paging 分页信息
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-12 9:39
|
||||
*/
|
||||
public static void paginationOracleSql(StringBuilder sqlBuilder, Paging paging) {
|
||||
String rowNumName;
|
||||
for(int i=0;;i++){
|
||||
rowNumName = "rowno_" + i;
|
||||
if(!sqlBuilder.toString().toLowerCase(Locale.ROOT).contains(rowNumName)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
sqlBuilder.insert(0, "SELECT * FROM (SELECT t_pagination.*, ROWNUM AS " + rowNumName + " FROM(");
|
||||
sqlBuilder.append(") t_pagination WHERE ROWNUM <= ")
|
||||
.append(paging.endRowNo())
|
||||
.append(") table_alias WHERE table_alias.")
|
||||
.append(rowNumName)
|
||||
.append(" >= ")
|
||||
.append(paging.beginRowNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前 sql查询语句转换成 统计数量的语句
|
||||
*
|
||||
* @param sqlBuilder sql 字符串的 StringBuilder
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-12 9:57
|
||||
*/
|
||||
public static void countOracleSql(StringBuilder sqlBuilder) {
|
||||
int index = sqlBuilder.toString().toLowerCase().indexOf(" from ");
|
||||
sqlBuilder.replace(0, index, "select count(1)");
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前 sql查询语句转换成 统计数量的语句
|
||||
*
|
||||
* @param sqlBuilder sql 字符串的 StringBuilder
|
||||
* @author LiuHuiYu
|
||||
* @deprecated 未启用字符串分析
|
||||
* Created DateTime 2022-01-12 9:57
|
||||
*/
|
||||
@Deprecated
|
||||
public static void countOracleSql2(StringBuilder sqlBuilder) {
|
||||
String fromString = " from ";
|
||||
int f = 0;
|
||||
int level = 0;
|
||||
for (int i = 0; i < sqlBuilder.length(); i++) {
|
||||
//字符串检测
|
||||
if (Arrays.asList('\'', '\"').contains(sqlBuilder.charAt(i))) {
|
||||
throw new RuntimeException("当前解析无法解析包含字符串的sql语句");
|
||||
}
|
||||
//包含检测
|
||||
if (sqlBuilder.charAt(i) == '(') {
|
||||
level++;
|
||||
}
|
||||
else if (sqlBuilder.charAt(i) == ')') {
|
||||
level--;
|
||||
}
|
||||
if (level < 0) {
|
||||
throw new RuntimeException("输入的sql语句异常");
|
||||
}
|
||||
|
||||
// if (f == fromString.length() && level == 0) {
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
int index = sqlBuilder.toString().toLowerCase().indexOf(" from ");
|
||||
sqlBuilder.replace(0, index, "select count(1)");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
/**
|
||||
* 分页接口
|
||||
* <pre>
|
||||
* @ApiModelProperty("分页信息")
|
||||
* private Paging paging = new Paging();
|
||||
*
|
||||
* @Override
|
||||
* public Paging getPaging() {
|
||||
* return paging;
|
||||
* }
|
||||
*
|
||||
* @Override
|
||||
* public void setPaging(Paging paging) {
|
||||
* this.paging = paging;
|
||||
* }
|
||||
* </pre>
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-01-12 10:22
|
||||
*/
|
||||
public interface IPaging {
|
||||
/**
|
||||
* 获取分页信息
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-20 15:29
|
||||
* @return cc.rehome.zhanjiang.data_center_model.domain.Paging
|
||||
*/
|
||||
Paging getPaging();
|
||||
/**
|
||||
* 设置分页信息
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-20 15:29
|
||||
* @param paging 分页信息
|
||||
*/
|
||||
void setPaging(Paging paging);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-01-08 9:45
|
||||
*/
|
||||
public interface ISerializationJson extends Serializable {
|
||||
/**
|
||||
* 将当前类序列化成json字符串
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-20 15:30
|
||||
* @return java.lang.String
|
||||
*/
|
||||
String toJson();
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import com.liuhuiyu.spring_util.SpringUtil;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Created by qhong on 2018/7/3 16:52
|
||||
**/
|
||||
@Configuration
|
||||
public class OkHttpConfig {
|
||||
|
||||
public static OkHttpConfig getInstance() {
|
||||
return SpringUtil.getBean(OkHttpConfig.class);
|
||||
}
|
||||
public OkHttpConfig() {}
|
||||
public OkHttpClient okHttpClient;
|
||||
public OkHttpClient getOkHttpClient(){
|
||||
if(okHttpClient==null){
|
||||
okHttpClient=OkHttpConfig.getInstance().okHttpClient();
|
||||
}
|
||||
return okHttpClient;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public X509TrustManager x509TrustManager() {
|
||||
return new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
|
||||
}
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
|
||||
}
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
}
|
||||
@Bean
|
||||
public SSLSocketFactory sslSocketFactory() {
|
||||
try {
|
||||
//信任任何链接
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
sslContext.init(null, new TrustManager[]{x509TrustManager()}, new SecureRandom());
|
||||
return sslContext.getSocketFactory();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (KeyManagementException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Create a new connection pool with tuning parameters appropriate for a single-user application.
|
||||
* The tuning parameters in this pool are subject to change in future OkHttp releases. Currently
|
||||
*/
|
||||
@Bean
|
||||
public ConnectionPool pool() {
|
||||
return new ConnectionPool(200, 5, TimeUnit.MINUTES);
|
||||
}
|
||||
@Bean
|
||||
public OkHttpClient okHttpClient() {
|
||||
return new OkHttpClient.Builder()
|
||||
.sslSocketFactory(sslSocketFactory(), x509TrustManager())
|
||||
.retryOnConnectionFailure(true)//是否开启缓存
|
||||
.connectionPool(pool())//连接池
|
||||
.connectTimeout(10L, TimeUnit.SECONDS)
|
||||
.readTimeout(30L, TimeUnit.SECONDS)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
/**
|
||||
* 简单的分页实现类
|
||||
*
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-03-21 17:28
|
||||
*/
|
||||
public class PagingImplDto implements IPaging, ISerializationJson {
|
||||
Paging paging;
|
||||
|
||||
public PagingImplDto() {
|
||||
this.paging = new Paging();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging getPaging() {
|
||||
return this.paging;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPaging(Paging paging) {
|
||||
this.paging = paging;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return new Gson().toJson(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.rehome.jpahefengweather.utils;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @author LiuHuiYu
|
||||
* @version v1.0.0.0
|
||||
* Created DateTime 2022-01-06 15:35
|
||||
*/
|
||||
public class TimestampUtil {
|
||||
public static final String FORMAT_YEAR_MONTH_DAY = "yyyy-MM-dd";
|
||||
public static final String FORMAT_YEAR_MONTH_DAY_HOUR = "yyyy-MM-dd HH";
|
||||
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE = "yyyy-MM-dd HH:mm";
|
||||
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/**
|
||||
* 转换成开始时间
|
||||
*
|
||||
* @param value 字符串
|
||||
* @return java.sql.Timestamp
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-06 15:38
|
||||
*/
|
||||
public static Timestamp beginTime(String value) {
|
||||
try {
|
||||
String tempV = value;
|
||||
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
|
||||
tempV += " 00:00:00";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
|
||||
tempV += ":00:00";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
|
||||
tempV += ":00";
|
||||
}
|
||||
return Timestamp.valueOf(tempV);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成结束时间
|
||||
*
|
||||
* @param value 字符串
|
||||
* @return java.sql.Timestamp
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-06 15:38
|
||||
*/
|
||||
public static Timestamp endTime(String value) {
|
||||
try {
|
||||
String tempV = value;
|
||||
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
|
||||
tempV += " 23:59:59";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
|
||||
tempV += ":59:59";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
|
||||
tempV += ":59";
|
||||
}
|
||||
return Timestamp.valueOf(tempV);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 可以转换为 Timestamp 的字符串
|
||||
*
|
||||
* @param value 字符串
|
||||
* @return boolean
|
||||
* @author LiuHuiYu
|
||||
* Created DateTime 2022-01-06 15:37
|
||||
*/
|
||||
public static boolean isTimestampString(String value) {
|
||||
try {
|
||||
String tempV = value;
|
||||
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
|
||||
tempV += " 23:59:59";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
|
||||
tempV += ":59:59";
|
||||
}
|
||||
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
|
||||
tempV += ":59";
|
||||
}
|
||||
Timestamp.valueOf(tempV);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String toString(Timestamp timestamp, String format) {
|
||||
try {
|
||||
return new SimpleDateFormat(format).format(timestamp);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,13 @@
|
||||
package com.rehome.jpahefengweather;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class JpahefengweatherApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue