1、实现参数设置模块pipIrr-param-set;
2、相关模块配置文件适应性调整。
| | |
| | | # gz: pipIrr_gz |
| | | # lz: pipIrr_lz |
| | | # jc: pipIrr_jc |
| | | spring_datasource_url_dbname: pipIrr_ym |
| | | spring_datasource_url_dbname: pipIrr_ym #æ°æ®åºåç§° |
| | |
| | | # åæ®µmoneyæä¸ºå©ä½éé¢ï¼å½ä¸ºtrueæ¶ç»ä¸è®¾ç½®å¼ä¸º10000 |
| | | # 233æå¡å¨ï¼false |
| | | # 121æå¡å¨ï¼true |
| | | virtual_card_set_default: false |
| | | virtual_card_set_default: false |
| | |
| | | </taskType> |
| | | </org4> |
| | | </orgs> |
| | | </config> |
| | | </config> |
| | |
| | | # éå·ï¼ 60105 |
| | | tcp.port=60000 |
| | | |
| | | #RTUä¸è¡æ°æ®æå°é´éï¼å¤§äºè¿ä¸ªé´é认为设å¤ç¦»çº¿äºï¼æµæ§ä¸ä½éæ¯3ï¼è¡¨éä¸ä½æºæ¯6 |
| | | #RTUä¸è¡æ°æ®æå°é´éï¼å¤§äºè¿ä¸ªé´é认为设å¤ç¦»çº¿äºï¼æµæ§ä¸ä½éæ¯3ï¼è¡¨éä¸ä½æºæ¯6ï¼é»è®¤éç¨æ¶é´æé¿ç6 |
| | | base.upData.min.interval=6 |
| | | |
New file |
| | |
| | | /mvnw text eol=lf |
| | | *.cmd text eol=crlf |
New file |
| | |
| | | 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/ |
New file |
| | |
| | | # 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. |
| | | wrapperVersion=3.3.2 |
| | | distributionType=only-script |
| | | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip |
New file |
| | |
| | | #!/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 |
| | | # |
| | | # 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. |
| | | # ---------------------------------------------------------------------------- |
| | | |
| | | # ---------------------------------------------------------------------------- |
| | | # Apache Maven Wrapper startup batch script, version 3.3.2 |
| | | # |
| | | # Optional ENV vars |
| | | # ----------------- |
| | | # JAVA_HOME - location of a JDK home dir, required when download maven via java source |
| | | # MVNW_REPOURL - repo url base for downloading maven distribution |
| | | # MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven |
| | | # MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output |
| | | # ---------------------------------------------------------------------------- |
| | | |
| | | set -euf |
| | | [ "${MVNW_VERBOSE-}" != debug ] || set -x |
| | | |
| | | # OS specific support. |
| | | native_path() { printf %s\\n "$1"; } |
| | | case "$(uname)" in |
| | | CYGWIN* | MINGW*) |
| | | [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" |
| | | native_path() { cygpath --path --windows "$1"; } |
| | | ;; |
| | | esac |
| | | |
| | | # set JAVACMD and JAVACCMD |
| | | set_java_home() { |
| | | # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched |
| | | 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" |
| | | JAVACCMD="$JAVA_HOME/jre/sh/javac" |
| | | else |
| | | JAVACMD="$JAVA_HOME/bin/java" |
| | | JAVACCMD="$JAVA_HOME/bin/javac" |
| | | |
| | | if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then |
| | | echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 |
| | | echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 |
| | | return 1 |
| | | fi |
| | | fi |
| | | else |
| | | JAVACMD="$( |
| | | 'set' +e |
| | | 'unset' -f command 2>/dev/null |
| | | 'command' -v java |
| | | )" || : |
| | | JAVACCMD="$( |
| | | 'set' +e |
| | | 'unset' -f command 2>/dev/null |
| | | 'command' -v javac |
| | | )" || : |
| | | |
| | | if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then |
| | | echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 |
| | | return 1 |
| | | fi |
| | | fi |
| | | } |
| | | |
| | | # hash string like Java String::hashCode |
| | | hash_string() { |
| | | str="${1:-}" h=0 |
| | | while [ -n "$str" ]; do |
| | | char="${str%"${str#?}"}" |
| | | h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) |
| | | str="${str#?}" |
| | | done |
| | | printf %x\\n $h |
| | | } |
| | | |
| | | verbose() { :; } |
| | | [ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } |
| | | |
| | | die() { |
| | | printf %s\\n "$1" >&2 |
| | | exit 1 |
| | | } |
| | | |
| | | trim() { |
| | | # MWRAPPER-139: |
| | | # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. |
| | | # Needed for removing poorly interpreted newline sequences when running in more |
| | | # exotic environments such as mingw bash on Windows. |
| | | printf "%s" "${1}" | tr -d '[:space:]' |
| | | } |
| | | |
| | | # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties |
| | | while IFS="=" read -r key value; do |
| | | case "${key-}" in |
| | | distributionUrl) distributionUrl=$(trim "${value-}") ;; |
| | | distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; |
| | | esac |
| | | done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" |
| | | [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" |
| | | |
| | | case "${distributionUrl##*/}" in |
| | | maven-mvnd-*bin.*) |
| | | MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ |
| | | case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in |
| | | *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; |
| | | :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; |
| | | :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; |
| | | :Linux*x86_64*) distributionPlatform=linux-amd64 ;; |
| | | *) |
| | | echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 |
| | | distributionPlatform=linux-amd64 |
| | | ;; |
| | | esac |
| | | distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" |
| | | ;; |
| | | maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; |
| | | *) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; |
| | | esac |
| | | |
| | | # apply MVNW_REPOURL and calculate MAVEN_HOME |
| | | # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> |
| | | [ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" |
| | | distributionUrlName="${distributionUrl##*/}" |
| | | distributionUrlNameMain="${distributionUrlName%.*}" |
| | | distributionUrlNameMain="${distributionUrlNameMain%-bin}" |
| | | MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" |
| | | MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" |
| | | |
| | | exec_maven() { |
| | | unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : |
| | | exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" |
| | | } |
| | | |
| | | if [ -d "$MAVEN_HOME" ]; then |
| | | verbose "found existing MAVEN_HOME at $MAVEN_HOME" |
| | | exec_maven "$@" |
| | | fi |
| | | |
| | | case "${distributionUrl-}" in |
| | | *?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; |
| | | *) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; |
| | | esac |
| | | |
| | | # prepare tmp dir |
| | | if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then |
| | | clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } |
| | | trap clean HUP INT TERM EXIT |
| | | else |
| | | die "cannot create temp dir" |
| | | fi |
| | | |
| | | mkdir -p -- "${MAVEN_HOME%/*}" |
| | | |
| | | # Download and Install Apache Maven |
| | | verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." |
| | | verbose "Downloading from: $distributionUrl" |
| | | verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" |
| | | |
| | | # select .zip or .tar.gz |
| | | if ! command -v unzip >/dev/null; then |
| | | distributionUrl="${distributionUrl%.zip}.tar.gz" |
| | | distributionUrlName="${distributionUrl##*/}" |
| | | fi |
| | | |
| | | # verbose opt |
| | | __MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' |
| | | [ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v |
| | | |
| | | # normalize http auth |
| | | case "${MVNW_PASSWORD:+has-password}" in |
| | | '') MVNW_USERNAME='' MVNW_PASSWORD='' ;; |
| | | has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; |
| | | esac |
| | | |
| | | if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then |
| | | verbose "Found wget ... using wget" |
| | | wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" |
| | | elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then |
| | | verbose "Found curl ... using curl" |
| | | curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" |
| | | elif set_java_home; then |
| | | verbose "Falling back to use Java to download" |
| | | javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" |
| | | targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" |
| | | cat >"$javaSource" <<-END |
| | | public class Downloader extends java.net.Authenticator |
| | | { |
| | | protected java.net.PasswordAuthentication getPasswordAuthentication() |
| | | { |
| | | return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); |
| | | } |
| | | public static void main( String[] args ) throws Exception |
| | | { |
| | | setDefault( new Downloader() ); |
| | | java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); |
| | | } |
| | | } |
| | | END |
| | | # For Cygwin/MinGW, switch paths to Windows format before running javac and java |
| | | verbose " - Compiling Downloader.java ..." |
| | | "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" |
| | | verbose " - Running Downloader.java ..." |
| | | "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" |
| | | fi |
| | | |
| | | # If specified, validate the SHA-256 sum of the Maven distribution zip file |
| | | if [ -n "${distributionSha256Sum-}" ]; then |
| | | distributionSha256Result=false |
| | | if [ "$MVN_CMD" = mvnd.sh ]; then |
| | | echo "Checksum validation is not supported for maven-mvnd." >&2 |
| | | echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 |
| | | exit 1 |
| | | elif command -v sha256sum >/dev/null; then |
| | | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then |
| | | distributionSha256Result=true |
| | | fi |
| | | elif command -v shasum >/dev/null; then |
| | | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then |
| | | distributionSha256Result=true |
| | | fi |
| | | else |
| | | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 |
| | | echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 |
| | | exit 1 |
| | | fi |
| | | if [ $distributionSha256Result = false ]; then |
| | | echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 |
| | | echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 |
| | | exit 1 |
| | | fi |
| | | fi |
| | | |
| | | # unzip and move |
| | | if command -v unzip >/dev/null; then |
| | | unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" |
| | | else |
| | | tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" |
| | | fi |
| | | printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" |
| | | mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" |
| | | |
| | | clean || : |
| | | exec_maven "$@" |
New file |
| | |
| | | <# : batch portion |
| | | @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 http://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 Apache Maven Wrapper startup batch script, version 3.3.2 |
| | | @REM |
| | | @REM Optional ENV vars |
| | | @REM MVNW_REPOURL - repo url base for downloading maven distribution |
| | | @REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven |
| | | @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output |
| | | @REM ---------------------------------------------------------------------------- |
| | | |
| | | @IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) |
| | | @SET __MVNW_CMD__= |
| | | @SET __MVNW_ERROR__= |
| | | @SET __MVNW_PSMODULEP_SAVE=%PSModulePath% |
| | | @SET PSModulePath= |
| | | @FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( |
| | | IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) |
| | | ) |
| | | @SET PSModulePath=%__MVNW_PSMODULEP_SAVE% |
| | | @SET __MVNW_PSMODULEP_SAVE= |
| | | @SET __MVNW_ARG0_NAME__= |
| | | @SET MVNW_USERNAME= |
| | | @SET MVNW_PASSWORD= |
| | | @IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) |
| | | @echo Cannot start maven from wrapper >&2 && exit /b 1 |
| | | @GOTO :EOF |
| | | : end batch / begin powershell #> |
| | | |
| | | $ErrorActionPreference = "Stop" |
| | | if ($env:MVNW_VERBOSE -eq "true") { |
| | | $VerbosePreference = "Continue" |
| | | } |
| | | |
| | | # calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties |
| | | $distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl |
| | | if (!$distributionUrl) { |
| | | Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" |
| | | } |
| | | |
| | | switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { |
| | | "maven-mvnd-*" { |
| | | $USE_MVND = $true |
| | | $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" |
| | | $MVN_CMD = "mvnd.cmd" |
| | | break |
| | | } |
| | | default { |
| | | $USE_MVND = $false |
| | | $MVN_CMD = $script -replace '^mvnw','mvn' |
| | | break |
| | | } |
| | | } |
| | | |
| | | # apply MVNW_REPOURL and calculate MAVEN_HOME |
| | | # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> |
| | | if ($env:MVNW_REPOURL) { |
| | | $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } |
| | | $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" |
| | | } |
| | | $distributionUrlName = $distributionUrl -replace '^.*/','' |
| | | $distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' |
| | | $MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" |
| | | if ($env:MAVEN_USER_HOME) { |
| | | $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" |
| | | } |
| | | $MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' |
| | | $MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" |
| | | |
| | | if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { |
| | | Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" |
| | | Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" |
| | | exit $? |
| | | } |
| | | |
| | | if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { |
| | | Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" |
| | | } |
| | | |
| | | # prepare tmp dir |
| | | $TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile |
| | | $TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" |
| | | $TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null |
| | | trap { |
| | | if ($TMP_DOWNLOAD_DIR.Exists) { |
| | | try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } |
| | | catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } |
| | | } |
| | | } |
| | | |
| | | New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null |
| | | |
| | | # Download and Install Apache Maven |
| | | Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." |
| | | Write-Verbose "Downloading from: $distributionUrl" |
| | | Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" |
| | | |
| | | $webclient = New-Object System.Net.WebClient |
| | | if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { |
| | | $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) |
| | | } |
| | | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
| | | $webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null |
| | | |
| | | # If specified, validate the SHA-256 sum of the Maven distribution zip file |
| | | $distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum |
| | | if ($distributionSha256Sum) { |
| | | if ($USE_MVND) { |
| | | Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." |
| | | } |
| | | Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash |
| | | if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { |
| | | Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." |
| | | } |
| | | } |
| | | |
| | | # unzip and move |
| | | Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null |
| | | Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null |
| | | try { |
| | | Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null |
| | | } catch { |
| | | if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { |
| | | Write-Error "fail to move MAVEN_HOME" |
| | | } |
| | | } finally { |
| | | try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } |
| | | catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } |
| | | } |
| | | |
| | | Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <artifactId>pipIrr-mw</artifactId> |
| | | <groupId>com.dy</groupId> |
| | | <version>1.0.0</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | |
| | | <packaging>jar</packaging> |
| | | <artifactId>pipIrr-param-set</artifactId> |
| | | <version>1.0.0</version> |
| | | <name>pipIrr-param-set</name> |
| | | <description>模ååæ°è®¾ç½®å¨</description> |
| | | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-json</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 卿å è½½æ°ç¼è¯çç±» --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-api</artifactId> |
| | | <version>2.0.7</version> |
| | | </dependency> |
| | | |
| | | <!-- æµè¯ --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <!-- çæä¸å
å«ä¾èµjarç坿§è¡jarå
|
| | | <plugin> |
| | | !- spring bootæä¾çmavenæå
æä»¶ - |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | !- |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | - |
| | | <configuration> |
| | | !- ä¸å çè¯æç»å
å为: ${artifactId}-${version}.jar, å äºçè¯æç»å
å: ${artifactId}-${version}-${classifier}.jar - |
| | | <classifier>execute</classifier> |
| | | !- 䏿å®çæè·¯å¾çè¯, é»è®¤ä¿åå¨ ${build.directory} ä¸ - |
| | | <outputDirectory>${project.build.directory}/execute</outputDirectory> |
| | | <finalName>${artifactId}-${version}</finalName> |
| | | <layout>ZIP</layout> |
| | | <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> |
| | | <includes> |
| | | <include> |
| | | <groupId>com.dy</groupId> |
| | | <artifactId>pipIrr-common</artifactId> |
| | | </include> |
| | | <include> |
| | | <groupId>com.dy</groupId> |
| | | <artifactId>pipIrr-global</artifactId> |
| | | </include> |
| | | </includes> |
| | | <excludes> |
| | | <exclude> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | |
| | | </plugin> |
| | | --> |
| | | <!-- æ·è´ä¾èµçjarå
å°libç®å½--> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <configuration> |
| | | <!-- ä¸å çè¯æç»å
å为: ${artifactId}-${version}.jar, å äºçè¯æç»å
å: ${artifactId}-${version}-${classifier}.jar |
| | | <classifier>execute</classifier> |
| | | --> |
| | | <!-- ${project.build.directory}æ¯mavenåéï¼å
ç½®çï¼è¡¨ç¤ºtargetç®å½,妿ä¸åï¼å°å¨æ ¹ç®å½ä¸å建/lib --> |
| | | <outputDirectory>${project.build.directory}/lib</outputDirectory> |
| | | <!-- excludeTransitive:æ¯å¦ä¸å
å«é´æ¥ä¾èµå
ï¼æ¯å¦æä»¬ä¾èµAï¼ä½æ¯Aåä¾èµäºBï¼æä»¬æ¯å¦ä¹è¦æBæè¿å» é»è®¤ä¸æ--> |
| | | <excludeTransitive>false</excludeTransitive> |
| | | <!-- å¤å¶çjaræä»¶å»æçæ¬ä¿¡æ¯ --> |
| | | <stripVersion>false</stripVersion> |
| | | <finalName>${project.artifactId}-${project.version}</finalName> |
| | | <layout>ZIP</layout> |
| | | <mainClass>com.dy.pipIrrParamSet.PipIrrParamSetApplication</mainClass> |
| | | <includes> |
| | | <include> |
| | | <groupId>com.dy</groupId> |
| | | <artifactId>pipIrr-common</artifactId> |
| | | </include> |
| | | <include> |
| | | <groupId>com.dy</groupId> |
| | | <artifactId>pipIrr-global</artifactId> |
| | | </include> |
| | | </includes> |
| | | <excludes> |
| | | <exclude> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <!-- 设置javaç¼è¯çæ¬ï¼è¿è¡ç¯å¢çæ¬ --> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <!-- sourceï¼ æºä»£ç ç¼è¯çæ¬ï¼targetï¼ ç®æ å¹³å°ç¼è¯çæ¬ï¼encodingï¼ å符éç¼ç ã --> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${encoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <!-- è§£å³èµæºæä»¶çç¼ç é®é¢ --> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-resources-plugin</artifactId> |
| | | <configuration> |
| | | <encoding>${encoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <!-- mavenéæ§è¡æµè¯ç¨ä¾çæä»¶ --> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <configuration> |
| | | <skipTests>true</skipTests> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <!-- ä¸é¢è§£å³ï¼å½è¿è¡Maven Lifecycle packageæ¶æ¥éï¼Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> |
| | | <groupId>org.apache.felix</groupId> |
| | | <artifactId>maven-bundle-plugin</artifactId> |
| | | <extensions>true</extensions> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | </project> |
New file |
| | |
| | | package com.dy.pipIrrParamSet; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.boot.WebApplicationType; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.context.annotation.FilterType; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 15:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) //ç¦æ¢å¯å¨æ°æ®åºè¿æ¥æ± |
| | | @ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.pipIrrParamSet"}, |
| | | excludeFilters = { |
| | | @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = { |
| | | com.dy.common.apiDoc.SpringApiConfig.class, //ä¸ç§æé¤ç±»çæ¹å¼ |
| | | com.dy.pipIrrGlobal.config.DingTalk.class |
| | | }), |
| | | @ComponentScan.Filter(type = FilterType.REGEX, pattern = { |
| | | //äºç§æé¤ç±»çæ¹å¼ï¼åæ£å表达å¼ï¼éè¦å¯¹ç®æ ç±»çå®å
¨éå®åå®å
¨å¹é
ï¼å¦åä¸çæ |
| | | "com.dy.common.aop..*", |
| | | "com.dy.common.apiDoc..*", |
| | | "com.dy.common.multiDataSource..*", |
| | | "com.dy.common.singleDataSource..*", |
| | | "com.dy.common.mybatis..*", |
| | | "com.dy.common.webFilter..*", |
| | | "com.dy.common.webListener..*", |
| | | "com.dy.pipIrrGlobal.config..*", |
| | | "com.dy.pipIrrGlobal.webCtrls..*" |
| | | }) |
| | | } |
| | | ) |
| | | public class PipIrrParamSetApplication implements CommandLineRunner { |
| | | |
| | | /** |
| | | * åæ°: è½¯ä»¶ç©ºé´æ ¹ç®å½ï¼ä¾å¦ï¼E:\javaWorkspaces\pipIrr\pipIrr-platform\ |
| | | * @param args |
| | | */ |
| | | public static void main(String[] args) { |
| | | parseArg(args) ; |
| | | new SpringApplicationBuilder(PipIrrParamSetApplication.class) |
| | | .web(WebApplicationType.NONE)//ä¸å¯å¨webæå¡ |
| | | .run(args); |
| | | } |
| | | |
| | | |
| | | private static void parseArg(String[] args){ |
| | | if(args != null |
| | | && args.length > 0 |
| | | && args[0] != null |
| | | && !args[0].trim().equals("")){ |
| | | ServerProperties.WorkspaceRoot = args[0] ; |
| | | if(!ServerProperties.WorkspaceRoot.endsWith("\\") && !ServerProperties.WorkspaceRoot.endsWith("/")){ |
| | | ServerProperties.WorkspaceRoot += "\\" ; |
| | | } |
| | | log.info("åæ°ãè½¯ä»¶ç©ºé´æ ¹ç®å½ãï¼" + ServerProperties.WorkspaceRoot); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Spring容å¨å¯å¨å®æåï¼æ§è¡ä¸é¢æ¹æ³ |
| | | * @param args åæ° |
| | | * @throws Exception å¼å¸¸ |
| | | */ |
| | | @Override |
| | | public void run(String... args) throws Exception { |
| | | try{ |
| | | //çå¾
ä¸ä¸ |
| | | Thread.sleep(500L); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | finally { |
| | | this.startMwSv() ; |
| | | } |
| | | } |
| | | |
| | | private void startMwSv(){ |
| | | if(sv != null){ |
| | | try { |
| | | sv.startServer(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Server sv ; |
| | | |
| | | @Autowired |
| | | public void setSv(Server sv){ |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet; |
| | | |
| | | import com.dy.pipIrrParamSet.console.CommandConsole; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Console; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 15:36 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | public class Server { |
| | | |
| | | private CommandConsole mwConsole ; |
| | | |
| | | @Autowired |
| | | public void setBean(CommandConsole console){ |
| | | this.mwConsole = console; |
| | | } |
| | | |
| | | public void startServer() throws Exception{ |
| | | Console console = System.console(); |
| | | if (console == null) { |
| | | throw new Exception("严ééè¯¯ï¼æªè½å¾å°æ§å¶å°å¯¹è±¡!"); |
| | | } |
| | | mwConsole.init(console); |
| | | boolean exit = mwConsole.execute() ; |
| | | if(exit){ |
| | | System.exit(-1); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet; |
| | | |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 15:36 |
| | | * @Description |
| | | */ |
| | | public class ServerProperties { |
| | | |
| | | public static String WorkspaceRoot ;//è½¯ä»¶ç©ºé´æ ¹ç®å½ |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.console; |
| | | |
| | | import com.dy.pipIrrParamSet.ServerProperties; |
| | | import com.dy.pipIrrParamSet.paramSet.ParamSet; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 15:36 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | @Scope("prototype") |
| | | public class Command { |
| | | |
| | | private static String[] commands ; |
| | | static{ |
| | | commands = new String[]{ |
| | | "config æ¥çé
置信æ¯", |
| | | "mw 121 [tag] å½ä»¤å«ä¹ï¼éä¿¡ä¸é´ä»¶å¨äºæå¡å¨ï¼121.199.41.121ï¼ä¸ç[tag](å
è°ym,æ²çspæµè¯testï¼æ¢
æ±mjï¼æ°å¤mqï¼å»¶åºyqï¼é»é¾æ±hljï¼çå·gzï¼åå·lzï¼éå·jc)ç³»ç»é
ç½®", |
| | | "mw 233 [tag] å½ä»¤å«ä¹ï¼éä¿¡ä¸é´ä»¶å¨äºæå¡å¨ï¼8.130.130.233ï¼ä¸ç[tag](å
è°ym,æ²çspæµè¯testï¼æ¢
æ±mjï¼æ°å¤mqï¼å»¶åºyqï¼é»é¾æ±hljï¼çå·gzï¼åå·lzï¼éå·jc)ç³»ç»é
ç½®", |
| | | "web 121 å½ä»¤å«ä¹ï¼web模åå¨äºæå¡å¨ï¼121.199.41.121ï¼ä¸çé
ç½®", |
| | | "web 233 å½ä»¤å«ä¹ï¼web模åå¨äºæå¡å¨ï¼8.130.130.233ï¼ä¸çé
ç½®", |
| | | "exit éåº", |
| | | }; |
| | | } |
| | | private PrintWriter prtWrt ; |
| | | |
| | | private String[] nowCom ; |
| | | |
| | | private ParamSet paramSet ; |
| | | |
| | | @Autowired |
| | | public void setBean(ParamSet paramSet){ |
| | | this.paramSet = paramSet; |
| | | } |
| | | |
| | | public boolean dealCommand(String comLine, PrintWriter prtWrt) throws Exception{ |
| | | this.prtWrt = prtWrt ; |
| | | boolean exit = false ; |
| | | comLine = comLine.trim() ; |
| | | if (comLine.equals("help")) { |
| | | outHelp(); |
| | | }else if (comLine.equals("config")) { |
| | | outConfig(); |
| | | }else if(comLine.equals("exit")){ |
| | | exit = true ; |
| | | }else if(isParamSetCom(comLine)){ |
| | | paramSet.dealCom(nowCom, this); |
| | | }else { |
| | | outNoIdentify(); |
| | | } |
| | | return exit ; |
| | | } |
| | | public boolean isParamSetCom(String command){ |
| | | nowCom = null ; |
| | | String[] inputs = command.split(" "); |
| | | int count = 0 ; |
| | | for (String in : inputs){ |
| | | if(!in.equals("")){ |
| | | count++ ; |
| | | } |
| | | } |
| | | if(count > 0){ |
| | | nowCom = new String[count] ; |
| | | } |
| | | int index = 0 ; |
| | | for (String in : inputs){ |
| | | if(!in.equals("")){ |
| | | nowCom[index++] = in ; |
| | | } |
| | | } |
| | | return nowCom == null? false : (nowCom.length > 0 ? true : false) ; |
| | | } |
| | | |
| | | public void out(String str){ |
| | | prtWrt.println(str==null?"":str); |
| | | prtWrt.println(""); |
| | | } |
| | | public void out1(String str){ |
| | | prtWrt.println(str==null?"":str); |
| | | } |
| | | private void outHelp(){ |
| | | prtWrt.println("å½ä»¤"); |
| | | for(String s : commands){ |
| | | prtWrt.println(" " + s); |
| | | } |
| | | prtWrt.println(""); |
| | | } |
| | | public void outConfig(){ |
| | | prtWrt.println("é¢å
设置"); |
| | | prtWrt.println(" è½¯ä»¶ç©ºé´æ ¹ç®å½ï¼" + ServerProperties.WorkspaceRoot); |
| | | prtWrt.println(""); |
| | | } |
| | | public void outNoIdentify(){ |
| | | prtWrt.println("å½ä»¤ä¸å¯è¯å«ï¼"); |
| | | prtWrt.println(""); |
| | | } |
| | | public void outNoParams(){ |
| | | prtWrt.println("请è¾å
¥å½ä»¤åæ°ï¼"); |
| | | prtWrt.println(""); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String com = " 02 123 345 789"; |
| | | com = com.trim() ; |
| | | String[] coms = com.split(" "); |
| | | for(String s : coms){ |
| | | System.out.println(s); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.console; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Console; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 15:36 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @Scope("prototype") |
| | | public class CommandConsole { |
| | | |
| | | private Console console ; |
| | | private PrintWriter prtWrt ; |
| | | private static final String myPassword = "123456" ; |
| | | private static final String commandPrefix1 = ">>" ; |
| | | private static final String commandPrefix2 = "$: " ; |
| | | private static String commandPrefix = commandPrefix1 + commandPrefix2 ; |
| | | |
| | | private Command command ; |
| | | |
| | | @Autowired |
| | | public void setBean(Command command){ |
| | | this.command = command; |
| | | } |
| | | |
| | | /** |
| | | * åå§ï¼æ£æ¥å¹¶è¾åºä¸äºä¿¡æ¯ |
| | | * @throws Exception |
| | | */ |
| | | public void init(Console console) throws Exception{ |
| | | this.console = console ; |
| | | if(this.console == null){ |
| | | throw new Exception("严éé误ï¼javaæ§å¶å°å¯¹è±¡ä¸ºç©ºï¼"); |
| | | } |
| | | prtWrt = console.writer() ; |
| | | prtWrt.println("----------------------------------------"); |
| | | prtWrt.println("-- --"); |
| | | prtWrt.println("-- 欢è¿ä½¿ç¨åæ°é
ç½®å¨ --"); |
| | | prtWrt.println("-- --"); |
| | | prtWrt.println("----------------------------------------"); |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡æ§å¶å°æ§å¶ |
| | | * @return |
| | | */ |
| | | public boolean execute(){ |
| | | boolean exit = false ; |
| | | try { |
| | | this.login() ; |
| | | exit = this.doConsole(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return exit ; |
| | | } |
| | | |
| | | private boolean login(){ |
| | | while (true) { |
| | | //String username = console.readLine(">>Username: "); |
| | | char[] password = console.readPassword(">>Password: "); |
| | | String passwordStr = String.valueOf(password) ; |
| | | if (passwordStr.equals("help")) { |
| | | console.printf("å¯ç æ¯%1$s\n", myPassword); |
| | | // 使ç¨ååºç«å³å°æ°ç»æ¸
空ï¼ä»¥åå°å
¶å¨å
åä¸å ç¨çæ¶é´ï¼å¢å¼ºå®å
¨æ§ |
| | | password = null; |
| | | } else if(passwordStr.equals(myPassword)){ |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private boolean doConsole(){ |
| | | boolean exit = false ; |
| | | while (!exit) { |
| | | String inputLine = console.readLine(commandPrefix); |
| | | try { |
| | | exit = command.dealCommand(inputLine, prtWrt) ; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public void changeCommandPrefix(String prefix){ |
| | | commandPrefix = commandPrefix1 + prefix ; |
| | | } |
| | | public void recoverCommandPrefix(){ |
| | | commandPrefix = commandPrefix1 + commandPrefix2 ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.paramSet; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/29 9:57 |
| | | * @Description |
| | | */ |
| | | public class ParamKey { |
| | | |
| | | public static final String AbstractPathOfMGlobal= "pipIrr-global\\" ; |
| | | public static final String AbstractPathOfMw = "pipIrr-mw\\pipIrr-mw-rtu\\" ; |
| | | public static final String AbstractPathOfWeb = "pipIrr-web\\" ; |
| | | public static final String AbstractPathOfResources = "src\\main\\resources\\" ; |
| | | |
| | | public static final String FileOfConfigProperties = "config.properties" ; |
| | | public static final String FileOfApplicationCommonMwYml = "application-common-mw.yml" ; |
| | | |
| | | public static final String FileOfApplicationCommonWebYml_MainName = "application-common-web" ; |
| | | public static final String FileOfApplicationCommonWebYml_ExeName = "yml" ; |
| | | |
| | | public static final String FileOfInitConfigXml_MainName = "init-config" ; |
| | | public static final String FileOfInitConfigXml_ExeName = "xml" ; |
| | | |
| | | public static final String FileOfApplication_MainName = "application" ; |
| | | public static final String FileOfApplication_ExeName = "yml" ; |
| | | |
| | | public static final String FileOfModelNamePre = "(" ; |
| | | public static final String FileOfModelNameTail = "æå¡å¨)" ; |
| | | |
| | | public static final String OrgTag = "orgTag" ; |
| | | public static final String TcpPort = "tcpPort" ; |
| | | public static final String UpDataMinInterval = "upDataMinInterval" ; |
| | | public static final String WebPort = "webPort" ; |
| | | public static final String ActutorPort = "actutorPort" ; |
| | | public static final String DbName = "dbName" ; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.paramSet; |
| | | |
| | | import com.dy.pipIrrParamSet.console.Command; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 16:29 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @Scope("prototype") |
| | | public class ParamSet { |
| | | private Environment env ; |
| | | private ParamSetMw paramSetMw ; |
| | | private ParamSetWeb paramSetWeb ; |
| | | @Autowired |
| | | public void setBean(Environment env){ |
| | | this.env = env ; |
| | | } |
| | | @Autowired |
| | | public void setBean(ParamSetMw paramSetMw){ |
| | | this.paramSetMw = paramSetMw ; |
| | | } |
| | | @Autowired |
| | | public void setBean(ParamSetWeb paramSetWeb){ |
| | | this.paramSetWeb = paramSetWeb ; |
| | | } |
| | | |
| | | public void dealCom(String[] comIn, Command command){ |
| | | if (comIn.length < 2) { |
| | | command.outNoIdentify(); |
| | | } |
| | | switch (comIn[0]) { |
| | | case "mw" : { |
| | | if (comIn.length != 3) { |
| | | command.outNoIdentify(); |
| | | }else{ |
| | | this.paramSetMw.set(env, comIn, command); |
| | | } |
| | | break; |
| | | } |
| | | case "web" : { |
| | | this.paramSetWeb.set(comIn, command); |
| | | break; |
| | | } |
| | | default: command.outNoIdentify(); break; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.paramSet; |
| | | |
| | | import com.dy.pipIrrParamSet.ServerProperties; |
| | | import com.dy.pipIrrParamSet.console.Command; |
| | | import com.dy.pipIrrParamSet.util.FileUtil; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.nio.file.Path; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/29 13:43 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | @Scope("prototype") |
| | | public class ParamSetMw { |
| | | |
| | | protected void set(Environment env, String[] comIn, Command command){ |
| | | String paramNamePre = "mw.sv" + comIn[1] + "." + comIn[2] + "." ; |
| | | this.set(env, comIn, command, paramNamePre) ; |
| | | } |
| | | |
| | | private void set(Environment env, String[] comIn, Command command, String paramNamePre){ |
| | | Map<String, String> paramMap = null ; |
| | | try{ |
| | | paramMap = this.getConfigs(env, paramNamePre); |
| | | }catch (Exception e){ |
| | | command.out(e.getMessage()); |
| | | paramMap = null ; |
| | | } |
| | | if(paramMap != null){ |
| | | boolean flag = this.setApplicationCommonMwYml(comIn, command, paramMap); |
| | | if(flag){ |
| | | flag = this.setConfigProperties(comIn, command, paramMap); |
| | | } |
| | | if(flag){ |
| | | command.out("åæ°è®¾ç½®å®æ"); |
| | | } |
| | | } |
| | | } |
| | | private boolean setApplicationCommonMwYml(String[] comIn, Command command, Map<String, String> paramMap){ |
| | | String filePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMGlobal |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfApplicationCommonMwYml ; |
| | | Path applicationCommonMwYmlPath = FileUtil.getFilePath(filePath) ; |
| | | if(applicationCommonMwYmlPath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + filePath); |
| | | return false ; |
| | | } |
| | | List<String> oldLines ; |
| | | try{ |
| | | oldLines = FileUtil.readFile(applicationCommonMwYmlPath); |
| | | }catch (Exception e){ |
| | | command.out("读åæä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | if(oldLines == null || oldLines.size() == 0){ |
| | | command.out("æä»¶" + filePath + "æ¯ç©ºæä»¶"); |
| | | return false ; |
| | | }else{ |
| | | List<String> newLines = new ArrayList<>(); |
| | | String newLine = null ; |
| | | for(String line : oldLines){ |
| | | newLine = line ; |
| | | if(newLine != null && newLine.trim().startsWith("pipIrr_mw_webPort")){ |
| | | newLine = " pipIrr_mw_webPort: " + paramMap.get(ParamKey.WebPort) + " #éä¿¡ä¸é´ä»¶ä¸åºç¨ï¼ä¸è½å¨web模åç³»ç»ä¸åºç¨" ; |
| | | }else if(newLine != null && newLine.trim().startsWith("pipIrr_mw_actutorPort")){ |
| | | newLine = " pipIrr_mw_actutorPort: " + paramMap.get(ParamKey.ActutorPort) + " #éä¿¡ä¸é´ä»¶ä¸åºç¨ï¼ä¸è½å¨web模åç³»ç»ä¸åºç¨" ; |
| | | }else if(newLine != null && newLine.trim().startsWith("spring_datasource_url_dbname")){ |
| | | newLine = " spring_datasource_url_dbname: " + paramMap.get(ParamKey.DbName) + " #æ°æ®åºåç§°" ; |
| | | } |
| | | newLines.add(newLine); |
| | | } |
| | | if(newLines.size() > 0){ |
| | | try { |
| | | FileUtil.writeFile(applicationCommonMwYmlPath, newLines); |
| | | }catch (Exception e){ |
| | | command.out("åå
¥æä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | private boolean setConfigProperties(String[] comIn, Command command, Map<String, String> paramMap){ |
| | | String filePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMw |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfConfigProperties ; |
| | | Path configPropertiesPath = FileUtil.getFilePath(filePath) ; |
| | | if(configPropertiesPath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + filePath); |
| | | return false ; |
| | | } |
| | | List<String> oldLines = null ; |
| | | try{ |
| | | oldLines = FileUtil.readFile(configPropertiesPath); |
| | | }catch (Exception e){ |
| | | command.out("读åæä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | if(oldLines == null || oldLines.size() == 0){ |
| | | command.out("æä»¶" + filePath + "æ¯ç©ºæä»¶"); |
| | | return false ; |
| | | }else{ |
| | | List<String> newLines = new ArrayList<>(); |
| | | String newLine = null ; |
| | | for(String line : oldLines){ |
| | | newLine = line ; |
| | | if(newLine != null && newLine.trim().startsWith("base.orgTag=")){ |
| | | newLine = "base.orgTag=" + comIn[2] ; |
| | | }else if(newLine != null && newLine.trim().startsWith("tcp.port=")){ |
| | | newLine = "tcp.port=" + paramMap.get(ParamKey.TcpPort); |
| | | }else if(newLine != null && newLine.trim().startsWith("base.upData.min.interval=")){ |
| | | newLine = "base.upData.min.interval=" + paramMap.get(ParamKey.UpDataMinInterval); |
| | | } |
| | | newLines.add(newLine); |
| | | } |
| | | if(newLines.size() > 0){ |
| | | try { |
| | | FileUtil.writeFile(configPropertiesPath, newLines); |
| | | }catch (Exception e){ |
| | | command.out("åå
¥æä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | |
| | | private Map<String, String> getConfigs(Environment env, String paramNamePre) throws Exception{ |
| | | Map<String, String> map = new HashMap<>() ; |
| | | String key = ParamKey.OrgTag; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | key = ParamKey.TcpPort; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | key = ParamKey.UpDataMinInterval; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | key = ParamKey.WebPort; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | key = ParamKey.ActutorPort; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | key = ParamKey.DbName; |
| | | this.getConfig(env, map, paramNamePre + key, key); |
| | | |
| | | return map ; |
| | | } |
| | | private void getConfig(Environment env, Map<String, String> map, String paramName, String key) throws Exception{ |
| | | String paramValue = env.getProperty(paramName); |
| | | if(paramValue == null){ |
| | | throw new Exception("åæ°è®¾ç½®å¨æªé
ç½®" + paramName); |
| | | }else{ |
| | | map.put(key, paramValue) ; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.paramSet; |
| | | |
| | | import com.dy.pipIrrParamSet.ServerProperties; |
| | | import com.dy.pipIrrParamSet.console.Command; |
| | | import com.dy.pipIrrParamSet.util.FileUtil; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.nio.file.Path; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/29 13:44 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | @Scope("prototype") |
| | | public class ParamSetWeb { |
| | | |
| | | protected void set(String[] comIn, Command command){ |
| | | boolean flag = setApplicationCommonWebYml(comIn, command) ; |
| | | if(flag){ |
| | | flag = setInitConfig(comIn, command) ; |
| | | if(flag){ |
| | | List<File> webModules = this.getWebModules(comIn, command); |
| | | if(webModules == null || webModules.size() == 0){ |
| | | command.out("æªå¾å°ä»»ä½web模å"); |
| | | }else{ |
| | | /* |
| | | command.out1("åç°web模åï¼"); |
| | | for(File webModule : webModules){ |
| | | command.out1(" " + webModule.getName()); |
| | | command.out1(" " + webModule.getPath()); |
| | | } |
| | | command.out1(""); |
| | | */ |
| | | Boolean banner = null ; |
| | | int countCancel = 0 ; |
| | | int countSuccess = 0 ; |
| | | int countFailure = 0 ; |
| | | for(File webModule : webModules){ |
| | | banner = setWebModuleApplicationYml(comIn, command, webModule.getPath() + "\\") ; |
| | | if(banner == null){ |
| | | countCancel ++ ; |
| | | }else if(banner.booleanValue()){ |
| | | countSuccess ++ ; |
| | | }else if(!banner.booleanValue()){ |
| | | countFailure ++ ; |
| | | } |
| | | } |
| | | command.out("åæ°è®¾ç½®å®æï¼å
¶ä¸" + countSuccess + "个模åæåï¼" + countFailure + "个模å失败ï¼" + countCancel + "个模å忽ç¥"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private boolean setApplicationCommonWebYml(String[] comIn, Command command){ |
| | | String filePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMGlobal |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfApplicationCommonWebYml_MainName |
| | | + "." |
| | | + ParamKey.FileOfApplicationCommonWebYml_ExeName ; |
| | | String modelFilePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMGlobal |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfApplicationCommonWebYml_MainName |
| | | + ParamKey.FileOfModelNamePre |
| | | + comIn[1] |
| | | + ParamKey.FileOfModelNameTail |
| | | + "." |
| | | + ParamKey.FileOfApplicationCommonWebYml_ExeName ; |
| | | Path appFilePath = FileUtil.getFilePath(filePath) ; |
| | | if(appFilePath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + filePath); |
| | | return false ; |
| | | } |
| | | Path appModelFilePath = FileUtil.getFilePath(modelFilePath) ; |
| | | if(appModelFilePath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + modelFilePath); |
| | | return false ; |
| | | } |
| | | List<String> modelLines; |
| | | try{ |
| | | modelLines = FileUtil.readFile(appModelFilePath); |
| | | }catch (Exception e){ |
| | | command.out("读åæä»¶" + modelFilePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | if(modelLines == null || modelLines.size() == 0){ |
| | | command.out("æä»¶" + modelFilePath + "æ¯ç©ºæä»¶"); |
| | | return false ; |
| | | }else{ |
| | | try { |
| | | FileUtil.writeFile(appFilePath, modelLines); |
| | | }catch (Exception e){ |
| | | command.out("åå
¥æä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | |
| | | private boolean setInitConfig(String[] comIn, Command command){ |
| | | String filePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMGlobal |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfInitConfigXml_MainName |
| | | + "." |
| | | + ParamKey.FileOfInitConfigXml_ExeName ; |
| | | String modelFilePath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfMGlobal |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfInitConfigXml_MainName |
| | | + ParamKey.FileOfModelNamePre |
| | | + comIn[1] |
| | | + ParamKey.FileOfModelNameTail |
| | | + "." |
| | | + ParamKey.FileOfInitConfigXml_ExeName ; |
| | | Path appFilePath = FileUtil.getFilePath(filePath) ; |
| | | if(appFilePath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + filePath); |
| | | return false ; |
| | | } |
| | | Path appModelFilePath = FileUtil.getFilePath(modelFilePath) ; |
| | | if(appModelFilePath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + modelFilePath); |
| | | return false ; |
| | | } |
| | | List<String> modelLines; |
| | | try{ |
| | | modelLines = FileUtil.readFile(appModelFilePath); |
| | | }catch (Exception e){ |
| | | command.out("读åæä»¶" + modelFilePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | if(modelLines == null || modelLines.size() == 0){ |
| | | command.out("æä»¶" + modelFilePath + "æ¯ç©ºæä»¶"); |
| | | return false ; |
| | | }else{ |
| | | try { |
| | | FileUtil.writeFile(appFilePath, modelLines); |
| | | }catch (Exception e){ |
| | | command.out("åå
¥æä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | |
| | | |
| | | private Boolean setWebModuleApplicationYml(String[] comIn, Command command, String absolutePath){ |
| | | String modelFilePath = absolutePath |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfApplication_MainName |
| | | + ParamKey.FileOfModelNamePre |
| | | + comIn[1] |
| | | + ParamKey.FileOfModelNameTail |
| | | + "." |
| | | + ParamKey.FileOfApplication_ExeName ; |
| | | File f = new File(modelFilePath) ; |
| | | if(!f.exists()){ |
| | | return null ; |
| | | } |
| | | |
| | | Path appModelFilePath = FileUtil.getFilePath(modelFilePath) ; |
| | | if(appModelFilePath == null){ |
| | | return false ; |
| | | } |
| | | String filePath = absolutePath |
| | | + ParamKey.AbstractPathOfResources |
| | | + ParamKey.FileOfApplication_MainName |
| | | + "." |
| | | + ParamKey.FileOfApplication_ExeName ; |
| | | Path appFilePath = FileUtil.getFilePath(filePath) ; |
| | | if(appFilePath == null){ |
| | | command.out("æªæ¾å°é
ç½®æä»¶" + filePath); |
| | | return false ; |
| | | } |
| | | |
| | | List<String> modelLines; |
| | | try{ |
| | | modelLines = FileUtil.readFile(appModelFilePath); |
| | | }catch (Exception e){ |
| | | command.out("读åæä»¶" + modelFilePath + "åçå¼å¸¸"); |
| | | return false ; |
| | | } |
| | | if(modelLines == null || modelLines.size() == 0){ |
| | | command.out("æä»¶" + modelFilePath + "æ¯ç©ºæä»¶"); |
| | | return false ; |
| | | }else{ |
| | | try { |
| | | FileUtil.writeFile(appFilePath, modelLines); |
| | | }catch (Exception e){ |
| | | command.out("åå
¥æä»¶" + filePath + "åçå¼å¸¸ï¼" + e.getMessage()); |
| | | return false ; |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | |
| | | private List<File> getWebModules(String[] comIn, Command command){ |
| | | List<File> webModules = new ArrayList<>(); |
| | | String dirPath = ServerProperties.WorkspaceRoot |
| | | + ParamKey.AbstractPathOfWeb ; |
| | | File dir = new File(dirPath) ; |
| | | if(dir.exists() && dir.isDirectory()){ |
| | | File[] subFiles = dir.listFiles() ; |
| | | if(subFiles != null && subFiles.length > 0){ |
| | | for(File subFile : subFiles){ |
| | | if(subFile.isDirectory()){ |
| | | webModules.add(subFile); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return webModules ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrParamSet.util; |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/28 17:54 |
| | | * @Description |
| | | */ |
| | | public class FileUtil { |
| | | /** |
| | | * @param absolutePath ç»å¯¹è·¯å¾ |
| | | * @param abstractPath ç¸å¯¹è·¯å¾ |
| | | * @param fileName æä»¶å |
| | | * @return |
| | | */ |
| | | public static Path getFilePath(String absolutePath, String abstractPath, String fileName){ |
| | | boolean flag ; |
| | | do { |
| | | flag = false ; |
| | | if (absolutePath.endsWith("/")) { |
| | | absolutePath = absolutePath.substring(0, absolutePath.length() - 1); |
| | | flag = true ; |
| | | } else if (absolutePath.endsWith("\\")) { |
| | | absolutePath = absolutePath.substring(0, absolutePath.length() - 1); |
| | | flag = true ; |
| | | } |
| | | }while (flag) ; |
| | | |
| | | do { |
| | | flag = false ; |
| | | if (abstractPath.startsWith("/")) { |
| | | abstractPath = abstractPath.substring(1); |
| | | flag = true ; |
| | | } else if (abstractPath.startsWith("\\")) { |
| | | abstractPath = abstractPath.substring(1); |
| | | flag = true ; |
| | | } |
| | | }while (flag) ; |
| | | abstractPath = "\\" + abstractPath ; |
| | | |
| | | do { |
| | | flag = false ; |
| | | if (abstractPath.endsWith("/")) { |
| | | abstractPath = abstractPath.substring(0, abstractPath.length() - 1); |
| | | flag = true ; |
| | | } else if (abstractPath.endsWith("\\")) { |
| | | abstractPath = abstractPath.substring(0, abstractPath.length() - 1); |
| | | flag = true ; |
| | | } |
| | | }while (flag) ; |
| | | abstractPath = abstractPath + "\\" ; |
| | | |
| | | do { |
| | | flag = false ; |
| | | if (fileName.startsWith("/")) { |
| | | fileName = fileName.substring(1); |
| | | flag = true ; |
| | | } else if (fileName.startsWith("\\")) { |
| | | fileName = fileName.substring(1); |
| | | flag = true ; |
| | | } |
| | | }while (flag) ; |
| | | String filePath = absolutePath + abstractPath + fileName ; |
| | | |
| | | return Paths.get(filePath) ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param filePath æä»¶è·¯å¾ |
| | | * @return |
| | | */ |
| | | public static Path getFilePath(String filePath){ |
| | | return Paths.get(filePath) ; |
| | | } |
| | | |
| | | /** |
| | | * 读æä»¶ææè¡ |
| | | * @param filePath |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static List<String> readFile(Path filePath) throws IOException { |
| | | // è¯»åææè¡ |
| | | return Files.readAllLines(filePath); |
| | | } |
| | | |
| | | public static void writeFile(Path filePath, List<String> lines) throws IOException { |
| | | Files.write(filePath, lines); |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception{ |
| | | Path path = FileUtil.getFilePath("E:\\javaWorkspaces\\pipIrr\\pipIrr-platform\\pipIrr-global", "\\src\\main\\resources", "test.xml") ; |
| | | List<String> lines = readFile(path) ; |
| | | for(String line : lines){ |
| | | System.out.println(line); |
| | | } |
| | | writeFile(path, lines); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | mw: |
| | | sv233: |
| | | ym: |
| | | orgTag: ym |
| | | tcpPort: 60000 |
| | | upDataMinInterval: 6 |
| | | webPort: 8070 |
| | | actutorPort: 9070 |
| | | dbName: pipIrr_ym |
| | | sp: |
| | | orgTag: sp |
| | | tcpPort: 62000 |
| | | upDataMinInterval: 6 |
| | | webPort: 8073 |
| | | actutorPort: 9073 |
| | | dbName: pipIrr_sp |
| | | test: |
| | | orgTag: test |
| | | tcpPort: 65000 |
| | | upDataMinInterval: 6 |
| | | webPort: 8072 |
| | | actutorPort: 9072 |
| | | dbName: pipIrr_test |
| | | mj: |
| | | orgTag: mj |
| | | tcpPort: 61000 |
| | | upDataMinInterval: 6 |
| | | webPort: 8071 |
| | | actutorPort: 9071 |
| | | dbName: pipIrr_mj |
| | | sv121: |
| | | mq: |
| | | orgTag: mq |
| | | tcpPort: 60100 |
| | | upDataMinInterval: 6 |
| | | webPort: 8100 |
| | | actutorPort: 9100 |
| | | dbName: pipIrr_mq |
| | | yq: |
| | | orgTag: yq |
| | | tcpPort: 60101 |
| | | upDataMinInterval: 6 |
| | | webPort: 8101 |
| | | actutorPort: 9101 |
| | | dbName: pipIrr_yq |
| | | hlj: |
| | | orgTag: hlj |
| | | tcpPort: 60102 |
| | | upDataMinInterval: 6 |
| | | webPort: 8102 |
| | | actutorPort: 9102 |
| | | dbName: pipIrr_hlj |
| | | gz: |
| | | orgTag: gz |
| | | tcpPort: 60103 |
| | | upDataMinInterval: 6 |
| | | webPort: 8103 |
| | | actutorPort: 9103 |
| | | dbName: pipIrr_gz |
| | | lz: |
| | | orgTag: lz |
| | | tcpPort: 60104 |
| | | upDataMinInterval: 6 |
| | | webPort: 8104 |
| | | actutorPort: 9104 |
| | | dbName: pipIrr_lz |
| | | jc: |
| | | orgTag: jc |
| | | tcpPort: 60105 |
| | | upDataMinInterval: 6 |
| | | webPort: 8105 |
| | | actutorPort: 9105 |
| | | dbName: pipIrr_jc |
| | | web: |
| | | sv233: |
| | | ymlFileName: application(233æå¡å¨).yml |
| | | sv121: |
| | | ymlFileName: application(121æå¡å¨).yml |
New file |
| | |
| | | logging: |
| | | charset: |
| | | console: UTF-8 |
| | | config: |
| | | classpath: log4j2.yml |
| | | spring: |
| | | devtools: |
| | | livereload: |
| | | enabled: false |
| | | main: |
| | | banner-mode: off #Spring Bootå¯å¨æ¶ç¦è¾åºBanner |
New file |
| | |
| | | spring: |
| | | profiles: |
| | | include: self, params |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <Configuration status="OFF"> |
| | | <Appenders> |
| | | <Console name="Console" target="SYSTEM_OUT"> |
| | | <PatternLayout charset="UTF-8" pattern="%d %-5p [%t] (%F:%L) - %m%n%throwable"/> |
| | | </Console> |
| | | <RollingFile name="File" fileName="logs/pipIrrParamSet.log" filePattern="logs/pipIrrParamSet-%d{yyyyMMdd}-%i.log"> |
| | | <PatternLayout charset="UTF-8" pattern="%d %-5p [%t] (%class.%method:%L) - %m%n%throwable"/> |
| | | <Policies> |
| | | <TimeBasedTriggeringPolicy interval="7" /> |
| | | <SizeBasedTriggeringPolicy size="10MB"/> |
| | | </Policies> |
| | | <DefaultRolloverStrategy max="50" /> |
| | | </RollingFile> |
| | | </Appenders> |
| | | <Loggers> |
| | | <!-- Rootä¸å个Loggeråæ¶èµ·ä½ç¨ --> |
| | | <Root level="error"> |
| | | <AppenderRef ref="Console"/> |
| | | <AppenderRef ref="File"/> |
| | | </Root> |
| | | </Loggers> |
| | | </Configuration> |
New file |
| | |
| | | package com.dy.pipIrrParamSet; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @SpringBootTest |
| | | class PipIrrParamSetApplicationTests { |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 忍¡ååæ°è®¾ç½®å¨ï¼ |
| | | 管çç³»ç»å叿¶ï¼é对ä¸åæå¡å¨ï¼121ã233ï¼åä¸åçæºæï¼å°åºï¼æä¸åçé
ç½®ï¼ |
| | | ä¸åå°åºä¸åæå¡å¨ç³»ç»åå¸ä¸éï¼è¦å¤æ¬¡ä¿®æ¹é
ç½®ï¼æ¯è¾ç¦éº»ï¼æä»¥ç¼å¶äºè¯¥åæ°è®¾ç½®å¨ã |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | |
| | | spring: |
| | | profiles: |
| | | #121æå¡å¨ï¼common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | | include: common-web, global, database, database-mq, database-yq, database-hlj, database-gz, database-lz, database-jc, self |
| | |
| | | spring: |
| | | profiles: |
| | | #233æå¡å¨ï¼common-web, global, database, database-ym, database-sp, database-test,database-mj, self |
| | | include: common-web, global, database, database-ym, database-sp, database-test,database-mj, self |