diff --git a/Dockerfile b/Dockerfile
index b57515fc2b08959a9ec250c9558e95bdf59b8f93..6a89df5dbdef9dd847924f8793286efa88d16a2f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -38,17 +38,13 @@ ENV WORKSPACE=/home/easysoftware
WORKDIR ${WORKSPACE}
-COPY --chown=easysoftware --from=Builder /EasySoftware/target ${WORKSPACE}/target
+COPY --chown=easysoftware --from=Builder /EasySoftware/target/easysoftware-0.0.1-SNAPSHOT.jar ${WORKSPACE}/target/easysoftware-0.0.1-SNAPSHOT.jar
RUN echo "umask 027" >> /home/easysoftware/.bashrc \
&& echo "umask 027" >> /root/.bashrc \
&& source /home/easysoftware/.bashrc \
- && mkdir -p /home/easysoftware/tomcat/log \
- && chmod 550 -R /home/easysoftware \
- && chown -R easysoftware:easysoftware /home/easysoftware/tomcat/ \
- && chmod 700 -R /home/easysoftware/tomcat \
- && echo "set +o history" >> /etc/bashrc \
- && echo "set +o history" >> /home/easysoftware/bashrc \
+ && echo "set +o history" >> /etc/bashrc \
+ && echo "set +o history" >> /home/easysoftware/.bashrc \
&& sed -i "s|HISTSIZE=1000|HISTSIZE=0|" /etc/profile \
&& sed -i "s|PASS_MAX_DAYS[ \t]*99999|PASS_MAX_DAYS 30|" /etc/login.defs
@@ -62,7 +58,8 @@ RUN passwd -l easysoftware \
RUN dnf install -y wget \
&& wget https://mirrors.tuna.tsinghua.edu.cn/Adoptium/17/jre/x64/linux/OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz \
&& tar -zxvf OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz \
- && rm OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz
+ && rm OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz \
+ && chown -R easysoftware:easysoftware jdk-17.0.11+9-jre
RUN rm -rf `find / -iname "*tcpdump*"` \
&& rm -rf `find / -iname "*sniffer*"` \
@@ -83,7 +80,8 @@ RUN rm -rf /usr/bin/gdb* \
&& rm -rf /usr/share/gdb \
&& rm -rf /usr/share/gcc-10.3.1 \
&& yum remove gdb-gdbserver findutils passwd shadow -y \
- && yum clean all
+ && yum clean all \
+ && chmod 500 -R /home/easysoftware
ENV JAVA_HOME=${WORKSPACE}/jdk-17.0.11+9-jre
ENV PATH=${JAVA_HOME}/bin:$PATH
diff --git a/mvnw b/mvnw
deleted file mode 100644
index 66df2854281f4cb6869e4830dd1a7abd1e946c18..0000000000000000000000000000000000000000
--- a/mvnw
+++ /dev/null
@@ -1,308 +0,0 @@
-#!/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.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Apache Maven Wrapper startup batch script, version 3.2.0
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# 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
- JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
- else
- JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=$(java-config --jre-home)
- fi
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -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 "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
- JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); 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 2>/dev/null; \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
-
-# 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/.." || exit 1; pwd)
- fi
- # end of workaround
- done
- printf '%s' "$(cd "$basedir" || exit 1; pwd)"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- # Remove \r in case we run on Windows within Git Bash
- # and check out the repository with auto CRLF management
- # enabled. Otherwise, we may read lines that are delimited with
- # \r\n and produce $'-Xarg\r' rather than -Xarg due to word
- # splitting rules.
- tr -s '\r\n' ' ' < "$1"
- fi
-}
-
-log() {
- if [ "$MVNW_VERBOSE" = true ]; then
- printf '%s\n' "$1"
- fi
-}
-
-BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
-log "$MAVEN_PROJECTBASEDIR"
-
-##########################################################################################
-# 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.
-##########################################################################################
-wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
-if [ -r "$wrapperJarPath" ]; then
- log "Found $wrapperJarPath"
-else
- log "Couldn't find $wrapperJarPath, downloading it ..."
-
- if [ -n "$MVNW_REPOURL" ]; then
- wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
- else
- wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
- fi
- while IFS="=" read -r key value; do
- # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
- safeValue=$(echo "$value" | tr -d '\r')
- case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
- esac
- done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
- log "Downloading from: $wrapperUrl"
-
- if $cygwin; then
- wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
- fi
-
- if command -v wget > /dev/null; then
- log "Found wget ... using wget"
- [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
- else
- wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
- fi
- elif command -v curl > /dev/null; then
- log "Found curl ... using curl"
- [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
- else
- curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
- fi
- else
- log "Falling back to using Java to download"
- javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
- javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
- # For Cygwin, switch paths to Windows format before running javac
- if $cygwin; then
- javaSource=$(cygpath --path --windows "$javaSource")
- javaClass=$(cygpath --path --windows "$javaClass")
- fi
- if [ -e "$javaSource" ]; then
- if [ ! -e "$javaClass" ]; then
- log " - Compiling MavenWrapperDownloader.java ..."
- ("$JAVA_HOME/bin/javac" "$javaSource")
- fi
- if [ -e "$javaClass" ]; then
- log " - Running MavenWrapperDownloader.java ..."
- ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
- fi
- fi
- fi
-fi
-##########################################################################################
-# End of extension
-##########################################################################################
-
-# If specified, validate the SHA-256 sum of the Maven wrapper jar file
-wrapperSha256Sum=""
-while IFS="=" read -r key value; do
- case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
- esac
-done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
-if [ -n "$wrapperSha256Sum" ]; then
- wrapperSha256Result=false
- if command -v sha256sum > /dev/null; then
- if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
- wrapperSha256Result=true
- fi
- elif command -v shasum > /dev/null; then
- if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
- wrapperSha256Result=true
- fi
- else
- echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
- echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
- exit 1
- fi
- if [ $wrapperSha256Result = false ]; then
- echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
- echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
- echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
- exit 1
- fi
-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 "$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
-
-# shellcheck disable=SC2086 # safe args
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- $MAVEN_DEBUG_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
deleted file mode 100644
index 95ba6f54ac526de46248af840bab26f33f946b93..0000000000000000000000000000000000000000
--- a/mvnw.cmd
+++ /dev/null
@@ -1,205 +0,0 @@
-@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 Apache Maven Wrapper startup batch script, version 3.2.0
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@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 WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
-
-FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
- IF "%%A"=="wrapperUrl" SET WRAPPER_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 WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
- )
- if "%MVNW_VERBOSE%" == "true" (
- echo Couldn't find %WRAPPER_JAR%, downloading it ...
- echo Downloading from: %WRAPPER_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('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
- "}"
- if "%MVNW_VERBOSE%" == "true" (
- echo Finished downloading %WRAPPER_JAR%
- )
-)
-@REM End of extension
-
-@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
-SET WRAPPER_SHA_256_SUM=""
-FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
- IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
-)
-IF NOT %WRAPPER_SHA_256_SUM%=="" (
- powershell -Command "&{"^
- "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
- "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
- " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
- " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
- " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
- " exit 1;"^
- "}"^
- "}"
- if ERRORLEVEL 1 goto error
-)
-
-@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%
diff --git a/pom.xml b/pom.xml
index 509b378c3864d212461adfc8c682a64cc3a7e36d..42445f6342f309eab80d48ba7bc5c52ce4104352 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 3.2.2
+ 3.3.0
com
@@ -51,8 +51,6 @@
5.0.2
-
-
org.springframework.boot
spring-boot-starter-web
@@ -147,12 +145,6 @@
bcprov-jdk18on
1.78.1
-
-
- org.apache.kafka
- kafka-clients
- 3.7.0
-
@@ -168,8 +160,9 @@
- org.springframework.kafka
- spring-kafka
+ commons-codec
+ commons-codec
+ 1.15
diff --git a/src/main/java/com/easysoftware/EasysoftwareApplication.java b/src/main/java/com/easysoftware/EasysoftwareApplication.java
index 9960813e38489dbaf9b72bf7636ea45165d5582b..75b0bf198b0332c1dd59638161bb1c0fc9695791 100644
--- a/src/main/java/com/easysoftware/EasysoftwareApplication.java
+++ b/src/main/java/com/easysoftware/EasysoftwareApplication.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware;
import com.baomidou.mybatisplus.autoconfigure.DdlApplicationRunner;
diff --git a/src/main/java/com/easysoftware/adapter/execute/ApplicationPackageExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/ApplicationPackageExecuteAdapter.java
deleted file mode 100644
index e3b713c4088fd41442c056feb5b46fc45a1c8e55..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/ApplicationPackageExecuteAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.applicationpackage.ApplicationPackageService;
-import com.easysoftware.application.applicationpackage.dto.InputApplicationPackage;
-import jakarta.validation.Valid;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/apppkg")
-public class ApplicationPackageExecuteAdapter {
-
- /**
- * Autowired instance of ApplicationPackageService for handling application package operations.
- */
- @Autowired
- private ApplicationPackageService appPkgService;
-
- /**
- * Insert AppPkg info.
- *
- * @param inputAppPackage AppPkg information entity class.
- * @return ResponseEntity.
- */
- @PostMapping
- public ResponseEntity insertAppPkg(@Valid @RequestBody final InputApplicationPackage inputAppPackage) {
- return appPkgService.insertAppPkg(inputAppPackage);
- }
-
- /**
- * Update AppPkg info.
- *
- * @param inputAppPackage AppPkg information entity class.
- * @return ResponseEntity.
- */
- @PutMapping
- public ResponseEntity updateAppPkg(@Valid @RequestBody final InputApplicationPackage inputAppPackage) {
- return appPkgService.updateAppPkg(inputAppPackage);
- }
-
- /**
- * Delete AppPkg info.
- *
- * @param names AppPkg name collection.
- * @return ResponseEntity.
- */
- @DeleteMapping(value = "/{names}")
- public ResponseEntity deleteAppPkg(@PathVariable final List names) {
- return appPkgService.deleteAppPkg(names);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/ApplicationVersionExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/ApplicationVersionExecuteAdapter.java
deleted file mode 100644
index 9be1d9816088e508e7fffdfe58bf3fefc675033d..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/ApplicationVersionExecuteAdapter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.applicationversion.ApplicationVersionService;
-import com.easysoftware.application.applicationversion.dto.InputApplicationVersion;
-import com.easysoftware.common.aop.LimitRequest;
-import jakarta.validation.Valid;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/appVersion")
-public class ApplicationVersionExecuteAdapter {
-
- /**
- *Autowired instance of ApplicationVersionService for handling application package operations.
- */
- @Autowired
- private ApplicationVersionService appVersionService;
-
- /**
- * Inserts a new application version.
- *
- * @param inputAppVersion The input data for the new application version.
- * @return ResponseEntity.
- */
- @PostMapping
- @LimitRequest
- public ResponseEntity insertAppVersion(@Valid @RequestBody final InputApplicationVersion inputAppVersion) {
- return appVersionService.insertAppVersion(inputAppVersion);
- }
-
-
- /**
- * Updates an existing application version with the provided input data.
- *
- * @param inputAppVersion The input data for updating the application version.
- * @return ResponseEntity.
- */
- @PutMapping
- @LimitRequest
- public ResponseEntity updateAppVersion(@Valid @RequestBody final InputApplicationVersion inputAppVersion) {
- return appVersionService.updateAppVersion(inputAppVersion);
- }
-
- /**
- * Deletes application versions based on the provided list of names.
- *
- * @param names names List of names of application versions to be deleted.
- * @return ResponseEntity.
- */
- @DeleteMapping(value = "/{names}")
- @LimitRequest
- public ResponseEntity deleteAppVersion(@PathVariable final List names) {
- return appVersionService.deleteAppVersion(names);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/EPKGPackageExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/EPKGPackageExecuteAdapter.java
deleted file mode 100644
index d451cdeddf6e6693b3fa98363f2d157452c993a9..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/EPKGPackageExecuteAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.epkgpackage.EPKGPackageService;
-import com.easysoftware.application.epkgpackage.dto.InputEPKGPackage;
-import jakarta.validation.Valid;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/epkgpkg")
-public class EPKGPackageExecuteAdapter {
-
- /**
- * Autowired instance of EPKGPackageService for handling application package operations.
- */
- @Autowired
- private EPKGPackageService epkgPackageService;
-
- /**
- * insert EPKG Package.
- *
- * @param inputEPKGPackage The input EPKG Package details to be inserted.
- * @return ResponseEntity.
- */
- @PostMapping
- public ResponseEntity insertEPKGPkg(@Valid @RequestBody final InputEPKGPackage inputEPKGPackage) {
- return epkgPackageService.insertEPKGPkg(inputEPKGPackage);
- }
-
- /**
- * update EPKG Package.
- *
- * @param inputEPKGPackage The input EPKG Package details to be updated.
- * @return ResponseEntity.
- */
- @PutMapping
- public ResponseEntity updateEPKGPkg(@Valid @RequestBody final InputEPKGPackage inputEPKGPackage) {
- return epkgPackageService.updateEPKGPkg(inputEPKGPackage);
- }
-
- /**
- * delete EPKG Packages by their Ids.
- *
- * @param ids List of IDs of the EPKG Packages to be deleted.
- * @return ResponseEntity.
- */
- @DeleteMapping(value = "/{ids}")
- public ResponseEntity deleteEPKGPkg(@PathVariable final List ids) {
- return epkgPackageService.deleteEPKGPkg(ids);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/ExternalOsExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/ExternalOsExecuteAdapter.java
deleted file mode 100644
index 5104f4d784542cac05370ec46e182e3893612877..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/ExternalOsExecuteAdapter.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.externalos.ExternalOsService;
-import com.easysoftware.application.externalos.dto.InputExternalOs;
-import jakarta.validation.Valid;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/externalos")
-public class ExternalOsExecuteAdapter {
-
-
- /**
- * Autowired service responsible for handling External OS related operations.
- */
- @Autowired
- private ExternalOsService externalOsService;
-
- /**
- * Endpoint to insert a new package mapping.
- *
- * @param input The input data for creating a new package mapping.
- * @return ResponseEntity.
- */
- @PostMapping("")
- public ResponseEntity insertPkgMap(@Valid @RequestBody final InputExternalOs input) {
- return externalOsService.insertPkgMap(input);
- }
-
- /**
- * Endpoint to update an existing package mapping.
- *
- * @param input The input data for updating an existing package mapping.
- * @return ResponseEntity.
- */
- @PutMapping()
- public ResponseEntity updatePkgMap(@Valid @RequestBody final InputExternalOs input) {
- return externalOsService.updatePkgMap(input);
- }
-
- /**
- * Endpoint to delete package mappings associated with specified IDs.
- *
- * @param ids List of IDs of package mappings to be deleted.
- * @return ResponseEntity.
- */
- @DeleteMapping(value = "/{ids}")
- public ResponseEntity deletePkgMap(@PathVariable final List ids) {
- return externalOsService.deletePkgMap(ids);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/OperationConfigExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/OperationConfigExecuteAdapter.java
deleted file mode 100644
index 6b403d0036473f34cea68e1a932e1eb562993a7a..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/OperationConfigExecuteAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.operationconfig.OperationConfigService;
-import com.easysoftware.application.operationconfig.dto.InputOperationConfig;
-import com.easysoftware.common.entity.MessageCode;
-import com.easysoftware.common.utils.ResultUtil;
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.Size;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/operationconfig")
-public class OperationConfigExecuteAdapter {
-
-
- /**
- * Autowired service for handling operation configurations.
- */
- @Autowired
- private OperationConfigService service;
-
-
- /**
- * Endpoint to insert a new operation configuration.
- *
- * @param input The input data for creating a new operation configuration.
- * @return ResponseEntity.
- */
- @PostMapping("")
- public ResponseEntity insertOperationConfig(@Valid @RequestBody final InputOperationConfig input) {
- boolean succeed = service.insertOperationConfig(input);
- if (succeed) {
- return ResultUtil.success(HttpStatus.OK);
- }
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0006);
- }
-
- /**
- * Endpoint to delete operation configurations by type.
- *
- * @param type Type of operation configuration to be deleted.
- * @return ResponseEntity.
- */
- @DeleteMapping("/{type}")
- public ResponseEntity deleteByType(@Size(max = 255) @PathVariable final String type) {
- boolean succeed = service.deleteByType(type);
- if (succeed) {
- return ResultUtil.success(HttpStatus.OK);
- }
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0005);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/RPMPackageExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/RPMPackageExecuteAdapter.java
deleted file mode 100644
index fd3ac1e0602978c3fbcdef441a1179da25dae41e..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/RPMPackageExecuteAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import com.easysoftware.application.rpmpackage.RPMPackageService;
-import com.easysoftware.application.rpmpackage.dto.InputRPMPackage;
-import jakarta.validation.Valid;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/rpmpkg")
-public class RPMPackageExecuteAdapter {
-
- /**
- * Autowired service for handling RPM package operations.
- */
- @Autowired
- private RPMPackageService rPMPkgService;
-
- /**
- * Endpoint to insert a new RPM package.
- *
- * @param inputrPMPackage The input data for inserting a new RPM package.
- * @return ResponseEntity.
- */
- @PostMapping("")
- public ResponseEntity insertRPMPkg(@Valid @RequestBody final InputRPMPackage inputrPMPackage) {
- return rPMPkgService.insertRPMPkg(inputrPMPackage);
- }
-
-
- /**
- * Endpoint to insert a new RPM package.
- *
- * @param inputrPMPackage The input data for inserting a new RPM package.
- * @return ResponseEntity.
- */
- @PutMapping()
- public ResponseEntity updateRPMPkg(@Valid @RequestBody final InputRPMPackage inputrPMPackage) {
- return rPMPkgService.updateRPMPkg(inputrPMPackage);
- }
-
-
- /**
- * Endpoint to delete RPM packages associated with specified IDs.
- *
- * @param ids List of IDs of RPM packages to be deleted.
- * @return ResponseEntity.
- */
- @DeleteMapping(value = "/{ids}")
- public ResponseEntity deleteRPMPkg(@PathVariable final List ids) {
- return rPMPkgService.deleteRPMPkg(ids);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/execute/RedisExecuteAdapter.java b/src/main/java/com/easysoftware/adapter/execute/RedisExecuteAdapter.java
deleted file mode 100644
index e8efbb0d556b4c0876ba82d048b7e774d3d7a9e2..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/execute/RedisExecuteAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.easysoftware.adapter.execute;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import com.easysoftware.redis.RedisService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-
-@RestController
-@RequestMapping("/redis")
-public class RedisExecuteAdapter {
-
- /**
- * Autowired service for interacting with Redis.
- */
- @Autowired
- private RedisService redisService;
-
- /**
- * Endpoint to update Redis cache by namespace, updating all pages under the specified namespace.
- *
- * @param namespace The namespace for which cache needs to be updated.
- * @return ResponseEntity.
- */
- // key更新操作,传入namespace更新namespace下所有页面缓存
- @GetMapping("/update")
- public ResponseEntity updateRedisByNameSapce(@RequestParam final String namespace) {
- return redisService.updateRedisByNameSapce(namespace);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/query/ApplicationPackageQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/ApplicationPackageQueryAdapter.java
index a9702596e731fb81937779adfb50bc61a151a5ef..a01052d6f7a479f092076e3080a4ae8bccdc3e3e 100644
--- a/src/main/java/com/easysoftware/adapter/query/ApplicationPackageQueryAdapter.java
+++ b/src/main/java/com/easysoftware/adapter/query/ApplicationPackageQueryAdapter.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.adapter.query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -6,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.easysoftware.application.applicationpackage.ApplicationPackageService;
+import com.easysoftware.application.applicationpackage.dto.ApplicationPackageNameSearchCondition;
import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition;
import com.easysoftware.common.aop.RequestLimitRedis;
@@ -41,7 +53,7 @@ public class ApplicationPackageQueryAdapter {
*/
@GetMapping("/tags")
@RequestLimitRedis()
- public ResponseEntity queryByTags(@Valid final ApplicationPackageSearchCondition condition) {
+ public ResponseEntity queryByTags(@Valid final ApplicationPackageNameSearchCondition condition) {
return appPkgService.queryPkgByTags(condition);
}
@@ -55,21 +67,8 @@ public class ApplicationPackageQueryAdapter {
*/
@GetMapping("/eulerver")
@RequestLimitRedis()
- public ResponseEntity queryEulerVersionsByName(@Valid final ApplicationPackageSearchCondition condition) {
+ public ResponseEntity queryEulerVersionsByName(
+ @Valid final ApplicationPackageNameSearchCondition condition) {
return appPkgService.queryEulerVersionsByName(condition);
}
-
- /**
- * Endpoint to query for all avalaible openEuler arch of application packages
- * based
- * on the provided search condition.
- *
- * @param condition The search condition for querying application packages.
- * @return ResponseEntity.
- */
- @GetMapping("/eulerarch")
- @RequestLimitRedis()
- public ResponseEntity queryEulerArchsByName(@Valid final ApplicationPackageSearchCondition condition) {
- return appPkgService.queryEulerArchsByName(condition);
- }
}
diff --git a/src/main/java/com/easysoftware/adapter/query/ApplicationVersionQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/ApplicationVersionQueryAdapter.java
index 8ca7c5f4de24181a1d505b5ebc473c0328c4b25c..fae4df846f5a1f67f0b1e19e03c34d58b97880c5 100644
--- a/src/main/java/com/easysoftware/adapter/query/ApplicationVersionQueryAdapter.java
+++ b/src/main/java/com/easysoftware/adapter/query/ApplicationVersionQueryAdapter.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.adapter.query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -5,17 +16,16 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-
import com.easysoftware.application.applicationversion.ApplicationVersionService;
+import com.easysoftware.application.applicationversion.dto.ApplicationColumnSearchCondition;
import com.easysoftware.application.applicationversion.dto.ApplicationVersionSearchCondition;
-import com.easysoftware.common.aop.LimitRequest;
+import com.easysoftware.common.aop.RequestLimitRedis;
import jakarta.validation.Valid;
@RestController
@RequestMapping("/appVersion")
public class ApplicationVersionQueryAdapter {
-
/**
* Autowired service for handling application version-related operations.
*/
@@ -23,31 +33,28 @@ public class ApplicationVersionQueryAdapter {
private ApplicationVersionService appVersionService;
/**
- * Endpoint to search for application versions based on the provided search condition.
+ * Endpoint to search for application versions based on the provided search
+ * condition.
*
* @param condition The search condition for querying application versions.
* @return ResponseEntity.
*/
@GetMapping()
- @LimitRequest()
- // @OneidToken
- // @CompatibleToken
+ @RequestLimitRedis()
public ResponseEntity searchAppVersion(@Valid final ApplicationVersionSearchCondition condition) {
return appVersionService.searchAppVersion(condition);
}
/**
- * Endpoint to search for application versions based on the provided search condition.
+ * Endpoint to search for application versions based on the provided search
+ * condition.
*
* @param condition The search condition for querying application versions.
* @return ResponseEntity.
*/
@GetMapping("/column")
- @LimitRequest()
- // @OneidToken
- // @CompatibleToken
- public ResponseEntity searchAppVerColumn(@Valid final ApplicationVersionSearchCondition condition) {
+ @RequestLimitRedis()
+ public ResponseEntity searchAppVerColumn(@Valid final ApplicationColumnSearchCondition condition) {
return appVersionService.searchAppVerColumn(condition);
}
-
}
diff --git a/src/main/java/com/easysoftware/adapter/query/DomainPackageQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/DomainPackageQueryAdapter.java
deleted file mode 100644
index 3e33f244367340ea31cc62abf90ab948dd86ab11..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/query/DomainPackageQueryAdapter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.easysoftware.adapter.query;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.easysoftware.application.domainpackage.DomainPackageService;
-import com.easysoftware.application.domainpackage.dto.DomainColumnCondition;
-import com.easysoftware.application.domainpackage.dto.DomainDetailSearchCondition;
-import com.easysoftware.application.domainpackage.dto.DomainSearchCondition;
-import com.easysoftware.common.aop.RequestLimitRedis;
-import jakarta.validation.Valid;
-
-@RestController
-@RequestMapping("/domain")
-public class DomainPackageQueryAdapter {
-
- /**
- * Autowired service for managing domain packages.
- */
- @Autowired
- private DomainPackageService domainService;
-
- /**
- * Endpoint to query domains by name.
- *
- * @param condition The search condition for querying domains.
- * @return ResponseEntity.
- */
- @GetMapping()
- @RequestLimitRedis()
- public ResponseEntity queryByName(@Valid final DomainSearchCondition condition) {
- return domainService.searchDomain(condition);
- }
-
- /**
- * Endpoint to query detailed information about a domain.
- *
- * @param condition The search condition for querying domain details.
- * @return ResponseEntity.
- */
- @GetMapping("/detail")
- @RequestLimitRedis()
- public ResponseEntity queryDomainDetail(@Valid final DomainDetailSearchCondition condition) {
- return domainService.searchDomainDetail(condition);
- }
-
- /**
- * Endpoint to query domain columns.
- *
- * @param condition The search condition for querying domain columns.
- * @return ResponseEntity.
- */
- @GetMapping("/column")
- @RequestLimitRedis()
- public ResponseEntity queryColumn(@Valid final DomainColumnCondition condition) {
- return domainService.searchColumn(condition);
- }
-
- /**
- * Endpoint to query domain statistics.
- *
- * @return ResponseEntity.
- */
- @GetMapping("/stat")
- @RequestLimitRedis()
- public ResponseEntity queryStat() {
- return domainService.queryStat();
- }
-
-
-}
diff --git a/src/main/java/com/easysoftware/adapter/query/EPKGPackageQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/EPKGPackageQueryAdapter.java
index fb3035563a1c1f29cc85c06e53eccbd7977ec457..514dc779a4935bc94d887be3db1269ed1129f21b 100644
--- a/src/main/java/com/easysoftware/adapter/query/EPKGPackageQueryAdapter.java
+++ b/src/main/java/com/easysoftware/adapter/query/EPKGPackageQueryAdapter.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.adapter.query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -7,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.easysoftware.application.epkgpackage.EPKGPackageService;
+import com.easysoftware.application.epkgpackage.dto.EPKGPackageNameSearchCondition;
import com.easysoftware.application.epkgpackage.dto.EPKGPackageSearchCondition;
import com.easysoftware.common.aop.RequestLimitRedis;
@@ -43,20 +55,7 @@ public class EPKGPackageQueryAdapter {
*/
@GetMapping("/eulerver")
@RequestLimitRedis()
- public ResponseEntity queryEulerVersionsByName(@Valid final EPKGPackageSearchCondition condition) {
+ public ResponseEntity queryEulerVersionsByName(@Valid final EPKGPackageNameSearchCondition condition) {
return ePKGPackageService.queryEulerVersionsByName(condition);
}
-
- /**
- * Endpoint to query for all avalaible openEuler arch of epkg packages based
- * on the provided search condition.
- *
- * @param condition The search condition for querying epkg packages.
- * @return ResponseEntity.
- */
- @GetMapping("/eulerarch")
- @RequestLimitRedis()
- public ResponseEntity queryEulerArchsByName(@Valid final EPKGPackageSearchCondition condition) {
- return ePKGPackageService.queryEulerArchsByName(condition);
- }
}
diff --git a/src/main/java/com/easysoftware/adapter/query/ExternalOsQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/ExternalOsQueryAdapter.java
deleted file mode 100644
index c36c414df5ee8726da54c8795f85a2e714efe568..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/adapter/query/ExternalOsQueryAdapter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.easysoftware.adapter.query;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.easysoftware.application.externalos.ExternalOsService;
-import com.easysoftware.application.externalos.dto.ExternalOsSearchCondiiton;
-import com.easysoftware.common.aop.RequestLimitRedis;
-
-import jakarta.validation.Valid;
-
-@RestController
-@RequestMapping("/externalos")
-public class ExternalOsQueryAdapter {
-
- /**
- * Autowired service for interacting with external operating systems.
- */
- @Autowired
- private ExternalOsService externalOsService;
-
-
- /**
- * Handles a request to search package mappings in the external operating system.
- *
- * @param condition The search condition for querying package mappings.
- * @return ResponseEntity.
- */
- @GetMapping()
- @RequestLimitRedis()
- public ResponseEntity searchPkgMap(@Valid final ExternalOsSearchCondiiton condition) {
- return externalOsService.searchPkgMap(condition);
- }
-}
diff --git a/src/main/java/com/easysoftware/adapter/query/FieldApplicationQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/FieldApplicationQueryAdapter.java
index 09a67b106bd1095fe9c468ab7f564b56936e4c7f..e5818adf6b54d40d7e6896e591b886177f39842f 100644
--- a/src/main/java/com/easysoftware/adapter/query/FieldApplicationQueryAdapter.java
+++ b/src/main/java/com/easysoftware/adapter/query/FieldApplicationQueryAdapter.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.adapter.query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,11 +28,6 @@ import jakarta.validation.Valid;
@RestController
@RequestMapping("/field")
public class FieldApplicationQueryAdapter {
- /**
- * Health status.
- */
- private static final String HEALTH_STATUS = "health";
-
/**
* Autowired service for handling field application-related operations.
*/
@@ -74,15 +80,4 @@ public class FieldApplicationQueryAdapter {
public ResponseEntity searchStat() {
return service.queryStat();
}
-
- /**
- * Endpoint to health check.
- *
- * @return ResponseEntity.
- */
- @GetMapping("/health")
- @RequestLimitRedis()
- public String checkHealth() {
- return HEALTH_STATUS;
- }
}
diff --git a/src/main/java/com/easysoftware/adapter/query/RPMPackageQueryAdapter.java b/src/main/java/com/easysoftware/adapter/query/RPMPackageQueryAdapter.java
index 9cc7aeda1f0df0c2e22424e65975b7cadd200141..93bc33f4841ba84530670854ba44261c95cee0ba 100644
--- a/src/main/java/com/easysoftware/adapter/query/RPMPackageQueryAdapter.java
+++ b/src/main/java/com/easysoftware/adapter/query/RPMPackageQueryAdapter.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.adapter.query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -6,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.easysoftware.application.rpmpackage.RPMPackageService;
+import com.easysoftware.application.rpmpackage.dto.RPMPackageNameSearchCondition;
import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition;
import com.easysoftware.common.aop.RequestLimitRedis;
@@ -42,20 +54,21 @@ public class RPMPackageQueryAdapter {
*/
@GetMapping("/eulerver")
@RequestLimitRedis()
- public ResponseEntity queryEulerVersionsByName(@Valid final RPMPackageSearchCondition condition) {
+ public ResponseEntity queryEulerVersionsByName(@Valid final RPMPackageNameSearchCondition condition) {
return rPMPkgService.queryEulerVersionsByName(condition);
}
/**
- * Endpoint to query for all avalaible openEuler arch of RPM packages based
+ * Endpoint to query for all newst version of RPM packages based
* on the provided search condition.
*
- * @param condition The search condition for querying RPM packages.
+ * @param condition The search condition for querying versions of RPM packages.
* @return ResponseEntity.
*/
- @GetMapping("/eulerarch")
+ @GetMapping("/rpmver")
@RequestLimitRedis()
- public ResponseEntity queryEulerArchsByName(@Valid final RPMPackageSearchCondition condition) {
- return rPMPkgService.queryEulerArchsByName(condition);
+ public ResponseEntity queryNewstRpmVersion(@Valid final RPMPackageNameSearchCondition condition) {
+ return rPMPkgService.queryNewstRpmVersion(condition);
}
+
}
diff --git a/src/main/java/com/easysoftware/application/BaseIService.java b/src/main/java/com/easysoftware/application/BaseIService.java
index 3daa850f6e6432884bc6c1b803880d2ff1272ee6..ef0948eba41f2b6346489b0cc0636a5c9cc88355 100644
--- a/src/main/java/com/easysoftware/application/BaseIService.java
+++ b/src/main/java/com/easysoftware/application/BaseIService.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application;
import com.baomidou.mybatisplus.extension.service.IService;
diff --git a/src/main/java/com/easysoftware/application/ServiceMap.java b/src/main/java/com/easysoftware/application/ServiceMap.java
index 444909225cb4dd69f1483f5ba2592c193faafe0e..013a713fd5dba48fe3e5a203b1f0aa1d5f96cfe7 100644
--- a/src/main/java/com/easysoftware/application/ServiceMap.java
+++ b/src/main/java/com/easysoftware/application/ServiceMap.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageService.java b/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageService.java
index 6133335ce924bde50384a8e3a92c6e594779af2a..ba60844fa3f41df7380a2449b7c130280d75bda1 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageService.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageService.java
@@ -1,37 +1,24 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage;
+import com.easysoftware.application.applicationpackage.dto.ApplicationPackageNameSearchCondition;
import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition;
-import com.easysoftware.application.applicationpackage.dto.InputApplicationPackage;
import com.easysoftware.application.applicationpackage.vo.ApplicationPackageMenuVo;
import org.springframework.http.ResponseEntity;
import java.util.List;
public interface ApplicationPackageService {
- /**
- * Insert a new application package.
- *
- * @param listApp The input application package to be inserted.
- * @return ResponseEntity.
- */
- ResponseEntity insertAppPkg(InputApplicationPackage listApp);
-
- /**
- * Update an existing application package.
- *
- * @param inputAppPackage The input application package for updating.
- * @return ResponseEntity.
- */
- ResponseEntity updateAppPkg(InputApplicationPackage inputAppPackage);
-
- /**
- * Delete application packages by their names.
- *
- * @param names List of names of the application packages to be deleted.
- * @return ResponseEntity.
- */
- ResponseEntity deleteAppPkg(List names);
-
/**
* Search for application packages based on the provided search condition.
*
@@ -56,7 +43,7 @@ public interface ApplicationPackageService {
* application packages.
* @return ResponseEntity.
*/
- ResponseEntity queryPkgByTags(ApplicationPackageSearchCondition condition);
+ ResponseEntity queryPkgByTags(ApplicationPackageNameSearchCondition condition);
/**
* Queries available openEuler version of application package.
@@ -64,13 +51,5 @@ public interface ApplicationPackageService {
* @param condition The search condition.
* @return Map containing the openEuler versions.
*/
- ResponseEntity queryEulerVersionsByName(ApplicationPackageSearchCondition condition);
-
- /**
- * Queries available openEuler archs of application package.
- *
- * @param condition The search condition.
- * @return Map containing the openEuler versions.
- */
- ResponseEntity queryEulerArchsByName(ApplicationPackageSearchCondition condition);
+ ResponseEntity queryEulerVersionsByName(ApplicationPackageNameSearchCondition condition);
}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageServiceImpl.java b/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageServiceImpl.java
index fa3a84930a76674dc003d492a57a632f7904cd82..276f9bfd2e1ce6027bb671c8206ba3fab3e6f2f9 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageServiceImpl.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/ApplicationPackageServiceImpl.java
@@ -1,22 +1,32 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage;
+import com.easysoftware.application.applicationpackage.dto.ApplicationPackageNameSearchCondition;
import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition;
-import com.easysoftware.application.applicationpackage.dto.InputApplicationPackage;
+import com.easysoftware.application.applicationpackage.vo.ApplicationPackageDetailVo;
import com.easysoftware.application.applicationpackage.vo.ApplicationPackageMenuVo;
-import com.easysoftware.common.entity.MessageCode;
-import com.easysoftware.common.obs.ObsService;
+import com.easysoftware.application.applicationpackage.vo.ApplicationPackageTagsVo;
+import com.easysoftware.common.exception.NoneResException;
+import com.easysoftware.common.exception.ParamErrorException;
import com.easysoftware.common.utils.ResultUtil;
-import com.easysoftware.domain.applicationpackage.ApplicationPackage;
import com.easysoftware.domain.applicationpackage.gateway.ApplicationPackageGateway;
import jakarta.annotation.Resource;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
+
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -29,12 +39,6 @@ public class ApplicationPackageServiceImpl implements ApplicationPackageService
@Resource
private ApplicationPackageGateway appPkgGateway;
- /**
- * Autowired service for interacting with Object Storage Service (OBS).
- */
- @Autowired
- private ObsService obsService;
-
/**
* Value injection for the repoMaintainerApi configuration property.
*/
@@ -67,66 +71,14 @@ public class ApplicationPackageServiceImpl implements ApplicationPackageService
* @return ResponseEntity.
*/
@Override
- public ResponseEntity queryPkgByTags(final ApplicationPackageSearchCondition condition) {
+ public ResponseEntity queryPkgByTags(final ApplicationPackageNameSearchCondition condition) {
Map res = appPkgGateway.queryTagsByName(condition);
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
- /**
- * Insert a new application package.
- *
- * @param inputAppPkg The input application package to be inserted.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity insertAppPkg(final InputApplicationPackage inputAppPkg) {
- ApplicationPackage appPkg = new ApplicationPackage();
- BeanUtils.copyProperties(inputAppPkg, appPkg);
- boolean succeed = appPkgGateway.save(appPkg);
- return succeed ? ResultUtil.success(HttpStatus.OK)
- : ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0006);
- }
-
- /**
- * Update an existing application package.
- *
- * @param inputAppPkg The input application package for updating.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity updateAppPkg(final InputApplicationPackage inputAppPkg) {
- // 数据库中是否已存在该包
- ApplicationPackage appPkg = new ApplicationPackage();
- BeanUtils.copyProperties(inputAppPkg, appPkg);
- boolean succeed = appPkgGateway.update(appPkg);
- return succeed ? ResultUtil.success(HttpStatus.OK)
- : ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0004);
- }
-
- /**
- * Delete application packages by their names.
- *
- * @param names List of names of the application packages to be deleted.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity deleteAppPkg(final List names) {
- List existedNames = new ArrayList<>();
- for (String name : names) {
- if (appPkgGateway.existApp(name)) {
- existedNames.add(name);
- }
+ Long total = (Long) res.get("total");
+ List list = (List) res.get("list");
+ if (total == 0 || list.size() == 0) {
+ throw new ParamErrorException("the tag does not exist");
}
- List deletedNames = new ArrayList<>();
- for (String name : existedNames) {
- if (appPkgGateway.delete(name)) {
- deletedNames.add(name);
- }
- }
-
- String msg = String.format("请求删除的数据: %s, 在数据库中的数据: %s, 成功删除的数据: %s",
- names, existedNames, deletedNames);
- return ResultUtil.success(HttpStatus.OK);
+ return ResultUtil.success(HttpStatus.OK, res);
}
/**
@@ -138,7 +90,16 @@ public class ApplicationPackageServiceImpl implements ApplicationPackageService
@Override
public ResponseEntity searchAppPkg(final ApplicationPackageSearchCondition condition) {
condition.setTimeOrder("");
+ if (StringUtils.isBlank(condition.getPkgId())) {
+ throw new ParamErrorException("the pkgid can not be null");
+ }
+
Map res = appPkgGateway.queryDetailByName(condition);
+ Long total = (Long) res.get("total");
+ List list = (List) res.get("list");
+ if (total == 0 || list.size() == 0) {
+ throw new ParamErrorException("the image pkg does not exist");
+ }
return ResultUtil.success(HttpStatus.OK, res);
}
@@ -152,7 +113,12 @@ public class ApplicationPackageServiceImpl implements ApplicationPackageService
@Override
public List queryPkgMenuList(final ApplicationPackageSearchCondition condition) {
Map map = appPkgGateway.queryMenuByName(condition);
- return (List) map.get("list");
+ Long total = (Long) map.get("total");
+ List menus = (List) map.get("list");
+ if (total == 0 || menus.size() == 0) {
+ throw new NoneResException("the image package does not exist");
+ }
+ return menus;
}
/**
@@ -162,20 +128,8 @@ public class ApplicationPackageServiceImpl implements ApplicationPackageService
* @return Map containing the epkg package menu.
*/
@Override
- public ResponseEntity queryEulerVersionsByName(ApplicationPackageSearchCondition condition) {
+ public ResponseEntity queryEulerVersionsByName(ApplicationPackageNameSearchCondition condition) {
Map res = appPkgGateway.queryEulerVersionByName(condition);
return ResultUtil.success(HttpStatus.OK, res);
}
-
- /**
- * Queries all available openEuler archs of application package.
- *
- * @param condition The search condition.
- * @return Map containing the epkg package menu.
- */
- @Override
- public ResponseEntity queryEulerArchsByName(ApplicationPackageSearchCondition condition) {
- Map res = appPkgGateway.queryEulerArchsByName(condition);
- return ResultUtil.success(HttpStatus.OK, res);
- }
}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageNameSearchCondition.java b/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageNameSearchCondition.java
new file mode 100644
index 0000000000000000000000000000000000000000..1282b92dd76fe12dddd6306f6cfa0c5ae7d383a8
--- /dev/null
+++ b/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageNameSearchCondition.java
@@ -0,0 +1,35 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
+package com.easysoftware.application.applicationpackage.dto;
+
+import com.easysoftware.common.constant.PackageConstant;
+
+import jakarta.validation.constraints.Size;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApplicationPackageNameSearchCondition {
+ /**
+ * Field name with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
+ */
+ @Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
+ @NotNull
+ private String name;
+
+}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageSearchCondition.java b/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageSearchCondition.java
index 0a0fae58d521cda1aef72ff94aa0ba51604accbc..63b3480bae5e43ef198cd43f206b221652e30235 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/dto/ApplicationPackageSearchCondition.java
@@ -1,8 +1,22 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage.dto;
import org.hibernate.validator.constraints.Range;
import com.easysoftware.common.constant.PackageConstant;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -17,18 +31,21 @@ public class ApplicationPackageSearchCondition {
* Field name with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String name;
/**
* Package ID with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String pkgId;
/**
* Subpath with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String subPath;
/**
@@ -36,6 +53,7 @@ public class ApplicationPackageSearchCondition {
* MAX_PAGE_NUM, default value is 1.
*/
@Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
+ @NotNull
private Integer pageNum = 1;
/**
@@ -43,48 +61,56 @@ public class ApplicationPackageSearchCondition {
* MAX_PAGE_SIZE, default value is 10.
*/
@Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
+ @NotNull
private Integer pageSize = 10;
/**
* Version number with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String version;
/**
* Operating system with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String os;
/**
* Architecture with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String arch;
/**
* Category with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String category;
/**
* Application update time with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String appUpdateAt;
/**
* Time order.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String timeOrder;
/**
* Name order.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String nameOrder;
}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/dto/InputApplicationPackage.java b/src/main/java/com/easysoftware/application/applicationpackage/dto/InputApplicationPackage.java
deleted file mode 100644
index 97b4b7538189582d7562bf5a1812033715fe3742..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/applicationpackage/dto/InputApplicationPackage.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package com.easysoftware.application.applicationpackage.dto;
-
-import org.hibernate.validator.constraints.URL;
-
-import com.easysoftware.common.exception.enumvalid.AppCategoryEnum;
-import com.easysoftware.common.exception.enumvalid.EnumValue;
-
-import jakarta.validation.constraints.Email;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class InputApplicationPackage {
- /**
- * Description with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of description can not exceed 10000")
- private String description;
-
- /**
- * Name cannot be null and must have a maximum length of 255 characters.
- */
- @NotBlank(message = "name can not be null")
- @Size(max = 255, message = "the length of name can not exceed 255")
- private String name;
-
- /**
- * License with a maximum length of 1000 characters.
- */
- @Size(max = 1000, message = "the length of arch can not exceed 5000")
- private String license;
- /**
- * download with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of download can not exceed 10000")
- private String download;
- /**
- * environment with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of environment can not exceed 10000")
- private String environment;
- /**
- * installation with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of installation can not exceed 10000")
- private String installation;
-
- /**
- * Similar packages with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of similarPkgs can not exceed 10000")
- private String similarPkgs;
-
- /**
- * Dependency packages with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of dependencyPkgs can not exceed 10000")
- private String dependencyPkgs;
-
- /**
- * Category validated using the AppCategoryEnum class's isValidCategory method.
- */
- @EnumValue(enumClass = AppCategoryEnum.class, enumMethod = "isValidCategory")
- private String category;
-
- /**
- * type with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of type can not exceed 100")
- private String type;
-
- /**
- * iconUrl with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of iconUrl can not exceed 100")
- private String iconUrl;
- /**
- * appVer with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of appVer can not exceed 100")
- private String appVer;
- /**
- * osSupport with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of osSupport can not exceed 100")
- private String osSupport;
- /**
- * os with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of os can not exceed 100")
- private String os;
- /**
- * arch with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of arch can not exceed 100")
- private String arch;
- /**
- * maintainerId with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerId can not exceed 100")
- private String maintainerId;
- /**
- * maintainerEmail with a maximum length of 100 characters.
- */
- @Email
- @Size(max = 100, message = "the length of maintainerEmail can not exceed 100")
- private String maintainerEmail;
- /**
- * maintainerGiteeId with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerGiteeId can not exceed 100")
- private String maintainerGiteeId;
- /**
- * maintainerUpdateAt with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerUpdateAt can not exceed 100")
- private String maintainerUpdateAt;
- /**
- * securityLevel with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of securityLevel can not exceed 100")
- private String securityLevel;
- /**
- * safeLabel with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of safeLabel can not exceed 100")
- private String safeLabel;
- /**
- * downloadCount with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of downloadCount can not exceed 100")
- private String downloadCount;
- /**
- * appSize with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of appSize can not exceed 100")
- private String appSize;
- /**
- * srcRepo with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of srcRepo can not exceed 100")
- private String srcRepo;
- /**
- * srcDownloadUrl with a maximum length of 200 characters.
- */
- @URL
- @Size(max = 200, message = "the length of srcDownloadUrl can not exceed 200")
- private String srcDownloadUrl;
- /**
- * binDownloadUrl with a maximum length of 200 characters.
- */
- @URL
- @Size(max = 200, message = "the length of binDownloadUrl can not exceed 200")
- private String binDownloadUrl;
- /**
- * pkgId with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of pkgId can not exceed 100")
- private String pkgId;
- /**
- * imageTags with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of tags can not exceed 10000")
- private String imageTags;
- /**
- * imageUsage with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of usage can not exceed 10000")
- private String imageUsage;
-/**
- * imageUsage with a maximum length of 10000 characters.
- */
- @Size(max = 50, message = "the length of latestOsSupport can not exceed 50")
- private String latestOsSupport;
-}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageDetailVo.java b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageDetailVo.java
index a47d8fbdad62476982d976e6b6680ed6cc5f5f29..86b874923ee73c41bf3976dc82836c3b47e62ad8 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageDetailVo.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageDetailVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerArchsVo.java b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerArchsVo.java
deleted file mode 100644
index 596c6f7a18814944274fc53d209158f8eb4688ee..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerArchsVo.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.easysoftware.application.applicationpackage.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class ApplicationPackageEulerArchsVo {
- /**
- * OpenEuler arch of the package.
- */
- private String arch;
-}
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerVersionVo.java b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerVersionVo.java
index 275d9c46d088cc051b033b16da4a9fa549a1cb40..fe12285551bd4c9211db92c6b4a5bfe71418765e 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerVersionVo.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageEulerVersionVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageMenuVo.java b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageMenuVo.java
index b45b0816fe82e5e9b880db541335258c94974bbd..d17be5f013fd010038d810885fc9ea26764192e3 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageMenuVo.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageMenuVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageTagsVo.java b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageTagsVo.java
index 7e651fe15723012e9b97da794b13c24cc3006163..03d11e9178a85284b2c3b40e2bfa60419630a719 100644
--- a/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageTagsVo.java
+++ b/src/main/java/com/easysoftware/application/applicationpackage/vo/ApplicationPackageTagsVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionService.java b/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionService.java
index d43b30a21850c7df456660d852ce7a51cfa122bd..ab73ef3b6104f86f5a45453151322ba179aadefc 100644
--- a/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionService.java
+++ b/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionService.java
@@ -1,38 +1,23 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationversion;
import com.easysoftware.application.BaseIService;
+import com.easysoftware.application.applicationversion.dto.ApplicationColumnSearchCondition;
import com.easysoftware.application.applicationversion.dto.ApplicationVersionSearchCondition;
-import com.easysoftware.application.applicationversion.dto.InputApplicationVersion;
import com.easysoftware.infrastructure.applicationversion.gatewayimpl.dataobject.ApplicationVersionDO;
import org.springframework.http.ResponseEntity;
-import java.util.List;
-
public interface ApplicationVersionService extends BaseIService {
- /**
- * Inserts a new application version based on the provided input.
- *
- * @param listApp The input application version to be inserted.
- * @return ResponseEntity.
- */
- ResponseEntity insertAppVersion(InputApplicationVersion listApp);
-
- /**
- * Updates an existing application version using the provided input.
- *
- * @param inputAppVersion The updated application version information.
- * @return ResponseEntity.
- */
- ResponseEntity updateAppVersion(InputApplicationVersion inputAppVersion);
-
- /**
- * Deletes application versions based on the provided list of names.
- *
- * @param names List of names of application versions to be deleted.
- * @return ResponseEntity.
- */
- ResponseEntity deleteAppVersion(List names);
-
/**
* Searches for application versions based on the specified search conditions.
*
@@ -47,5 +32,5 @@ public interface ApplicationVersionService extends BaseIService.
*/
- ResponseEntity searchAppVerColumn(ApplicationVersionSearchCondition condition);
+ ResponseEntity searchAppVerColumn(ApplicationColumnSearchCondition condition);
}
diff --git a/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionServiceImpl.java b/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionServiceImpl.java
index 5814261fb7038943996588af4a5418651bbdaa1a..763ef0cb7d8e0e4f0b6800d0ef68425942862f66 100644
--- a/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionServiceImpl.java
+++ b/src/main/java/com/easysoftware/application/applicationversion/ApplicationVersionServiceImpl.java
@@ -1,44 +1,36 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationversion;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.easysoftware.application.applicationversion.dto.ApplicationColumnSearchCondition;
import com.easysoftware.application.applicationversion.dto.ApplicationVersionSearchCondition;
-import com.easysoftware.application.applicationversion.dto.InputApplicationVersion;
-import com.easysoftware.common.entity.MessageCode;
import com.easysoftware.common.utils.QueryWrapperUtil;
import com.easysoftware.common.utils.ResultUtil;
-import com.easysoftware.domain.applicationversion.ApplicationVersion;
import com.easysoftware.domain.applicationversion.gateway.ApplicationVersionGateway;
import com.easysoftware.infrastructure.applicationversion.gatewayimpl.dataobject.ApplicationVersionDO;
import com.easysoftware.infrastructure.mapper.ApplicationVersionDOMapper;
-import com.easysoftware.kafka.Producer;
import jakarta.annotation.Resource;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
import java.util.List;
+import java.util.ArrayList;
import java.util.Map;
@Service("ApplicationVersionService")
-public class ApplicationVersionServiceImpl extends ServiceImpl implements ApplicationVersionService {
-
- /**
- * Autowired Kafka producer for sending messages.
- */
- @Autowired
- private Producer kafkaProducer;
-
- /**
- * Topic name for the Kafka producer related to application versions.
- */
- @Value("${producer.topic}")
- private String topicAppVersion;
-
+public class ApplicationVersionServiceImpl extends ServiceImpl
+ implements ApplicationVersionService {
/**
* API endpoint for repository information.
*/
@@ -51,22 +43,6 @@ public class ApplicationVersionServiceImpl extends ServiceImpl.
- */
- @Override
- public ResponseEntity insertAppVersion(final InputApplicationVersion inputAppVersion) {
- ApplicationVersion appVersion = new ApplicationVersion();
- BeanUtils.copyProperties(inputAppVersion, appVersion);
- boolean success = appVersionGateway.save(appVersion);
- return success ? ResultUtil.success(HttpStatus.OK)
- : ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0006);
- }
-
/**
* Searches for application versions based on the specified search conditions.
*
@@ -79,37 +55,6 @@ public class ApplicationVersionServiceImpl extends ServiceImpl.
- */
- @Override
- public ResponseEntity updateAppVersion(final InputApplicationVersion inputAppVersion) {
- ApplicationVersion appVersion = new ApplicationVersion();
- BeanUtils.copyProperties(inputAppVersion, appVersion);
-
- boolean succeed = appVersionGateway.update(appVersion);
- return succeed ? ResultUtil.success(HttpStatus.OK)
- : ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0004);
- }
-
- /**
- * Deletes application versions based on the provided list of names.
- *
- * @param names List of names of application versions to be deleted.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity deleteAppVersion(final List names) {
- List existedNames = names.stream().filter(appVersionGateway::existApp).toList();
- List deletedNames = existedNames.stream().filter(appVersionGateway::delete).toList();
- String msg = String.format("请求删除的数据: %s, 在数据库中的数据: %s, 成功删除的数据: %s",
- names, existedNames, deletedNames);
- return ResultUtil.success(HttpStatus.OK, msg);
- }
-
/**
* Saves a batch of data objects.
*
@@ -117,7 +62,7 @@ public class ApplicationVersionServiceImpl extends ServiceImpl dataObject) {
- saveOrUpdateBatch(appVersionGateway.convertBatch(dataObject));
+ return;
}
/**
@@ -126,7 +71,7 @@ public class ApplicationVersionServiceImpl extends ServiceImpl searchAppVerColumn(ApplicationVersionSearchCondition condition) {
+ public ResponseEntity searchAppVerColumn(ApplicationColumnSearchCondition condition) {
List columns = QueryWrapperUtil.splitStr(condition.getColumn());
Map> res = appVersionGateway.queryColumn(columns);
return ResultUtil.success(HttpStatus.OK, res);
diff --git a/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationColumnSearchCondition.java b/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationColumnSearchCondition.java
new file mode 100644
index 0000000000000000000000000000000000000000..8cf14c4ec8bf4d25b7f8285b52f50d96bc9beaf2
--- /dev/null
+++ b/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationColumnSearchCondition.java
@@ -0,0 +1,32 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
+package com.easysoftware.application.applicationversion.dto;
+
+import com.easysoftware.common.constant.PackageConstant;
+
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApplicationColumnSearchCondition {
+ /**
+ * column.
+ */
+ @Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
+ private String column;
+}
diff --git a/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationVersionSearchCondition.java b/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationVersionSearchCondition.java
index 04496565e64c626bf74d6f7c851f300d5dc444e6..4b903ac1c2adb76921193fc5aa601eaf19a8cc20 100644
--- a/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationVersionSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/applicationversion/dto/ApplicationVersionSearchCondition.java
@@ -1,9 +1,21 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.applicationversion.dto;
import org.hibernate.validator.constraints.Range;
import com.easysoftware.common.constant.PackageConstant;
+import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
@@ -16,38 +28,42 @@ public class ApplicationVersionSearchCondition {
* Name of the package. Restricted by length and character pattern.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
- @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9.()$\\-_ ]+$",
- message = "Include only letters, digits, and special characters(_-()$.)")
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String name;
/**
* Page number within the allowable range.
*/
@Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
+ @NotNull
private Integer pageNum = 1;
/**
* Page size within the allowable range.
*/
@Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
+ @NotNull
private Integer pageSize = 10;
/**
* eulerOSVersion.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String eulerOsVersion;
/**
* column.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String column;
/**
* Name order.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String nameOrder;
}
diff --git a/src/main/java/com/easysoftware/application/applicationversion/dto/InputApplicationVersion.java b/src/main/java/com/easysoftware/application/applicationversion/dto/InputApplicationVersion.java
deleted file mode 100644
index d4ff86ff86aad7dc293aca55b970805c2698be43..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/applicationversion/dto/InputApplicationVersion.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.easysoftware.application.applicationversion.dto;
-
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Pattern;
-import jakarta.validation.constraints.Size;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class InputApplicationVersion {
- /**
- * Name of the software. Restricted by length and character pattern.
- */
- @NotBlank(message = "name can not be null")
- @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9.()$\\-_:/ ]+$",
- message = "Include only letters, digits, and special characters(_-()$.)")
- @Size(max = 45, message = "the length of name can not exceed 45")
- private String name;
-
- /**
- * Homepage URL with length restriction and character pattern.
- */
- @Size(max = 255, message = "the length of homepage can not exceed 255")
- @Pattern(regexp = "^[A-Za-z0-9.()\\-_:/ ]+$",
- message = "Include only letters, digits, and special characters(_-()$.)")
- private String eulerHomepage;
-
- /**
- * Upstream homepage URL with length restriction and character pattern.
- */
- @Size(max = 255, message = "the length of homepage can not exceed 255")
- @Pattern(regexp = "^[A-Za-z0-9.()\\-_:/ ]+$",
- message = "Include only letters, digits, and special characters(_-()$.)")
- private String upHomepage;
-
- /**
- * Backend information with length restriction and character pattern.
- */
- @Size(max = 45, message = "the length of backend can not exceed 45")
- @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9.()$\\-_:/ ]+$",
- message = "Include only letters, digits, and special characters(_-()$.)")
- private String backend;
-
- /**
- * Status information with length restriction.
- */
- @Size(max = 45, message = "the length of status can not exceed 45")
- private String status;
-
- /**
- * Upstream version with length restriction.
- */
- @Size(max = 45, message = "the length of upstreamVersion can not exceed 45")
- private String upstreamVersion;
-
- /**
- * OpenEuler version with length restriction.
- */
- @Size(max = 45, message = "the length of compatibleVersion can not exceed 45")
- private String openeulerVersion;
-
- /**
- * Continuous Integration (CI) version with length restriction.
- */
- @Size(max = 45, message = "the length of compatibleVersion can not exceed 45")
- private String ciVersion;
-
- /**
- * Version of openEuler os: openEuler-22.03.
- */
- @Size(max = 45, message = "the length of compatibleVersion can not exceed 45")
- private String eulerOsVersion;
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageService.java b/src/main/java/com/easysoftware/application/domainpackage/DomainPackageService.java
deleted file mode 100644
index edfe98682e3dc355d6ea0e5072680edb7795edd8..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.easysoftware.application.domainpackage;
-
-import org.springframework.http.ResponseEntity;
-
-import com.easysoftware.application.domainpackage.dto.DomainColumnCondition;
-import com.easysoftware.application.domainpackage.dto.DomainDetailSearchCondition;
-import com.easysoftware.application.domainpackage.dto.DomainSearchCondition;
-
-public interface DomainPackageService {
- /**
- * Search for domains based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return ResponseEntity.
- */
- ResponseEntity searchDomain(DomainSearchCondition condition);
-
- /**
- * Search for domain details based on the provided search condition.
- *
- * @param condition The DomainDetailSearchCondition for searching.
- * @return ResponseEntity.
- */
- ResponseEntity searchDomainDetail(DomainDetailSearchCondition condition);
-
- /**
- * Search for columns based on the provided condition.
- *
- * @param condition The DomainColumnCondition for searching.
- * @return ResponseEntity.
- */
- ResponseEntity searchColumn(DomainColumnCondition condition);
-
- /**
- * Query statistics.
- *
- * @return ResponseEntity.
- */
- ResponseEntity queryStat();
-
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java b/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java
deleted file mode 100644
index 30b6fe7d4c384edd1dac9d85632947665e14cf8b..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java
+++ /dev/null
@@ -1,479 +0,0 @@
-package com.easysoftware.application.domainpackage;
-
-import com.easysoftware.application.applicationpackage.ApplicationPackageService;
-import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition;
-import com.easysoftware.application.applicationpackage.vo.ApplicationPackageDetailVo;
-import com.easysoftware.application.applicationpackage.vo.ApplicationPackageMenuVo;
-import com.easysoftware.application.domainpackage.converter.DomainPackageConverter;
-import com.easysoftware.application.domainpackage.dto.DomainColumnCondition;
-import com.easysoftware.application.domainpackage.dto.DomainDetailSearchCondition;
-import com.easysoftware.application.domainpackage.dto.DomainSearchCondition;
-import com.easysoftware.application.domainpackage.vo.DomainPackageMenuVo;
-import com.easysoftware.application.epkgpackage.EPKGPackageService;
-import com.easysoftware.application.epkgpackage.dto.EPKGPackageSearchCondition;
-import com.easysoftware.application.epkgpackage.vo.EPKGPackageDetailVo;
-import com.easysoftware.application.epkgpackage.vo.EPKGPackageMenuVo;
-import com.easysoftware.application.rpmpackage.RPMPackageService;
-import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition;
-import com.easysoftware.application.rpmpackage.vo.RPMPackageDetailVo;
-import com.easysoftware.application.rpmpackage.vo.RPMPackageDomainVo;
-import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo;
-import com.easysoftware.common.entity.MessageCode;
-import com.easysoftware.common.exception.ParamErrorException;
-import com.easysoftware.common.exception.enumvalid.AppCategoryEnum;
-import com.easysoftware.common.utils.QueryWrapperUtil;
-import com.easysoftware.common.utils.ResultUtil;
-import com.easysoftware.domain.applicationpackage.gateway.ApplicationPackageGateway;
-import com.easysoftware.domain.epkgpackage.gateway.EPKGPackageGateway;
-import com.easysoftware.domain.rpmpackage.gateway.RPMPackageGateway;
-import com.easysoftware.ranking.Ranker;
-import com.easysoftware.redis.RedisGateway;
-import com.easysoftware.redis.RedisUtil;
-import jakarta.annotation.Resource;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-@Service
-public class DomainPackageServiceImpl implements DomainPackageService {
-
- /**
- * Logger for DomainPackageServiceImpl class.
- */
- private static final Logger LOGGER = LoggerFactory.getLogger(DomainPackageServiceImpl.class);
-
- /**
- * Resource injection for the ApplicationPackageService.
- */
- @Resource
- private ApplicationPackageService appPkgService;
-
- /**
- * Resource injection for the RPMPackageService.
- */
- @Resource
- private RPMPackageService rPMPkgService;
-
- /**
- * Resource injection for the EPKGPackageService.
- */
- @Resource
- private EPKGPackageService epkgPackageService;
-
- /**
- * Resource injection for the RPMPackageGateway.
- */
- @Resource
- private RPMPackageGateway rpmPackageGateway;
-
- /**
- * Resource injection for the EPKGPackageGateway.
- */
- @Resource
- private EPKGPackageGateway epkgPackageGateway;
-
- /**
- * Resource injection for the ApplicationPackageGateway.
- */
- @Resource
- private ApplicationPackageGateway applicationPackageGateway;
-
- /**
- * Resource injection for the RedisGateway.
- */
- @Resource
- private RedisGateway redisGateway;
-
- /**
- * Resource injection for the Ranker.
- */
- @Resource
- private Ranker ranker;
-
- /**
- * Timeout value for Redis global expiration.
- */
- @Value("${redis-global.expiration}")
- private int timeOut;
-
- /**
- * Search for domains based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity searchDomain(final DomainSearchCondition condition) {
- String name = condition.getName();
- String entity = condition.getEntity();
-
- // 搜索domain页面多个软件包
- if (StringUtils.isBlank(entity) && StringUtils.isNotBlank(name)) {
- return searchDomainPage(condition);
- // 搜索domain页面单个软件包
- } else if (StringUtils.isBlank(name) && StringUtils.isNotBlank(entity)) {
- return searchDomainEntity(condition);
- } else {
- throw new ParamErrorException("unspecified param: name, entity");
- }
- }
-
- /**
- * Search domain entity based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return ResponseEntity.
- */
- private ResponseEntity searchDomainEntity(final DomainSearchCondition condition) {
- String entity = condition.getEntity();
- DomainPackageMenuVo domain = new DomainPackageMenuVo();
- domain.setName(entity);
- extendIds(domain);
- Map res = Map.ofEntries(
- Map.entry("total", "-1"),
- Map.entry("list", domain));
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
- /**
- * Search for a domain page based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return ResponseEntity containing the search results.
- */
- private ResponseEntity searchDomainPage(final DomainSearchCondition condition) {
- // 展示精品应用
- if ("apppkg".equals(condition.getName())) {
- Map res = searchAppPkgPage(condition);
- return ResultUtil.success(HttpStatus.OK, res);
- // 展示rpm软件包
- } else if ("rpmpkg".equals(condition.getName())) {
- RPMPackageSearchCondition rpmCon = DomainPackageConverter.toRpm(condition);
- Map rpmMenuList = rPMPkgService.queryAllRPMPkgMenu(rpmCon);
- return ResultUtil.success(HttpStatus.OK, rpmMenuList);
- // 展示epkg软件包
- } else if ("epkgpkg".equals(condition.getName())) {
- EPKGPackageSearchCondition epkgCon = DomainPackageConverter.toEpkg(condition);
- Map epkgMenu = epkgPackageService.queryAllEPKGPkgMenu(epkgCon);
- return ResultUtil.success(HttpStatus.OK, epkgMenu);
- // 展示领域应用
- } else if ("all".equals(condition.getName())) {
- return searchAllEntity(condition);
- } else {
- throw new ParamErrorException("unsupported param");
- }
- }
-
- /**
- * Search application package page based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return A Map containing the search results.
- */
- private Map searchAppPkgPage(final DomainSearchCondition condition) {
- ApplicationPackageSearchCondition appCon = DomainPackageConverter.toApp(condition);
- return applicationPackageGateway.queryMenuByName(appCon);
- }
-
- /**
- * Search all entities based on the provided search condition.
- *
- * @param condition The DomainSearchCondition for searching.
- * @return ResponseEntity containing the search results.
- */
- private ResponseEntity searchAllEntity(final DomainSearchCondition condition) {
- // 根据请求参数生成唯一redis key
- String redisKeyStr = RedisUtil.objectToString(condition);
- String redisKeyFormat = "domainPage_%s";
- String redisKey = String.format(redisKeyFormat, DigestUtils.sha256Hex(redisKeyStr));
- try {
- // 结果未过期,直接返回
- if (redisGateway.hasKey(redisKey)) {
- String resJson = redisGateway.get(redisKey);
- Object res = RedisUtil.convertToObject(resJson);
- return ResultUtil.success(HttpStatus.OK, res);
- }
- } catch (Exception e) {
- LOGGER.info(MessageCode.EC00015.getMsgEn());
- }
-
- ApplicationPackageSearchCondition appCon = DomainPackageConverter.toApp(condition);
- appCon.setPageSize(Integer.MAX_VALUE);
- List appMenus = appPkgService.queryPkgMenuList(appCon);
-
- RPMPackageSearchCondition rpmCon = DomainPackageConverter.toRpm(condition);
- rpmCon.setPageSize(Integer.MAX_VALUE);
- rpmCon.setTimeOrder("");
- List rpmMenus = rPMPkgService.queryPartAppPkgMenu(rpmCon);
-
- List domainMenus = mergeMenuVOs(appMenus, rpmMenus);
- // 对 domainMenus 中的每个菜单调用 extendIds 方法。
- domainMenus.forEach(this::extendIds);
- Map> cateMap = getCategorys();
- // 对 domainMenus 中的每个菜单,将其添加到 cateMap 中对应类别的列表中。
- domainMenus.forEach(menu -> cateMap.get(menu.getCategory()).add(menu));
- List> mapList = assembleMap(cateMap);
- List> rankedMapList = ranker.rankingDomainPageByOperationConfig(mapList);
- Map res = Map.ofEntries(
- Map.entry("total", domainMenus.size()),
- Map.entry("list", rankedMapList));
- try {
- // 结果转json
- String resJson = RedisUtil.convertToJson(res);
- // 设置超时时间 配置默认超时时间
- redisGateway.setWithExpire(redisKey, resJson, timeOut, TimeUnit.HOURS);
- } catch (Exception e) {
- LOGGER.info(MessageCode.EC00015.getMsgEn());
- }
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
- /**
- * Extend IDs for a DomainPackageMenuVo object.
- *
- * @param domain The DomainPackageMenuVo to extend IDs for.
- */
- private void extendIds(final DomainPackageMenuVo domain) {
- String name = domain.getName();
- Set tags = domain.getTags();
-
- ApplicationPackageMenuVo app = applicationPackageGateway.selectOne(name);
- if (StringUtils.isNotBlank(app.getPkgId())) {
- tags.add("IMAGE");
- domain.getPkgIds().put("IMAGE", app.getPkgId());
- }
-
- RPMPackageMenuVo rpm = rpmPackageGateway.selectOne(name);
- if (StringUtils.isNotBlank(rpm.getPkgId())) {
- tags.add("RPM");
- domain.getPkgIds().put("RPM", rpm.getPkgId());
- }
-
- EPKGPackageMenuVo epkg = epkgPackageGateway.selectOne(name);
- if (StringUtils.isNotBlank(epkg.getPkgId())) {
- tags.add("EPKG");
- domain.getPkgIds().put("EPKG", epkg.getPkgId());
- }
-
- }
-
- /**
- * Merge menu VOs from ApplicationPackageMenuVo and RPMPackageDomainVo.
- *
- * @param appMenus List of ApplicationPackageMenuVo instances.
- * @param rpmMenus List of RPMPackageDomainVo instances.
- * @return List of merged DomainPackageMenuVo instances.
- */
- private List mergeMenuVOs(final List appMenus,
- final List rpmMenus) {
- Map domainMap = new HashMap<>();
- // 遍历 appMenus 列表
- appMenus.forEach(app -> {
- // 创建新的 DomainPackageMenuVo 对象,复制属性并设置标签和包 ID,然后将其放入 domainMap 中
- DomainPackageMenuVo domain = new DomainPackageMenuVo();
- BeanUtils.copyProperties(app, domain);
- domain.getTags().add("IMAGE");
- domain.getPkgIds().put("IMAGE", app.getPkgId());
- domainMap.put(app.getName(), domain);
- });
-
- // 遍历 rpmMenus 列表
- rpmMenus.forEach(rpm -> {
- String name = rpm.getName();
- // 如果 domainMap 包含名称,则将 "RPM" 添加到标签中并继续下一个循环
- if (domainMap.containsKey(name)) {
- domainMap.get(name).getTags().add("RPM");
- return;
- }
- // 创建新的 DomainPackageMenuVo 对象,复制属性并设置标签和包 ID,然后将其放入 domainMap 中
- DomainPackageMenuVo domain = new DomainPackageMenuVo();
- BeanUtils.copyProperties(rpm, domain);
- domain.getTags().add("RPM");
- domain.getPkgIds().put("RPM", rpm.getPkgId());
- domainMap.put(name, domain);
- });
-
- return new ArrayList<>(domainMap.values());
- }
-
- /**
- * Get categories with corresponding objects.
- *
- * @return A Map containing category names as keys and lists of objects as
- * values.
- */
- private Map> getCategorys() {
- Map> map = new HashMap<>();
- // 使用流遍历所有的 AppCategoryEnum 值,将别名映射为新的 ArrayList 放入 map 中。
- Arrays.stream(AppCategoryEnum.values())
- .map(AppCategoryEnum::getAlias)
- .forEach(category -> map.put(category, new ArrayList<>()));
- return map;
- }
-
- /**
- * Assemble a list of maps from a map of objects.
- *
- * @param mapObj The map of objects to assemble.
- * @return A list of maps containing the assembled data.
- */
- private List> assembleMap(final Map> mapObj) {
- List> res = new ArrayList<>();
- mapObj.forEach((category, list) -> {
- // 为支持排序需求,修改为可变map
- Map map = new HashMap<>();
- map.put("name", category);
- map.put("children", list);
- res.add(map);
- });
- return res;
- }
-
- /**
- * Search for columns based on the provided condition.
- *
- * @param condition The DomainColumnCondition for searching.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity searchColumn(final DomainColumnCondition condition) {
- List columns = QueryWrapperUtil.splitStr(condition.getColumn());
- if ("rpmpkg".equals(condition.getName())) {
- try {
- Map> res = rpmPackageGateway.queryColumn(columns);
- return ResultUtil.success(HttpStatus.OK, res);
- } catch (ParamErrorException e) {
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0002);
- }
- } else if ("epkgpkg".equals(condition.getName())) {
- try {
- Map> res = epkgPackageGateway.queryColumn(columns);
- return ResultUtil.success(HttpStatus.OK, res);
- } catch (ParamErrorException e) {
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0002);
- }
- } else if ("apppkg".equals(condition.getName())) {
- try {
- Map> res = applicationPackageGateway.queryColumn(columns);
- return ResultUtil.success(HttpStatus.OK, res);
- } catch (ParamErrorException e) {
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0002);
- }
-
- } else {
- throw new ParamErrorException("unsupported param");
- }
- }
-
- /**
- * Query statistics.
- *
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity queryStat() {
- long rpmNum = rpmPackageGateway.queryTableLength();
- Long appNum = applicationPackageGateway.queryTableLength();
- long epkgNum = epkgPackageGateway.queryTableLength();
-
- Map res = Map.ofEntries(
- Map.entry("apppkg", appNum),
- Map.entry("total", Math.addExact(rpmNum, epkgNum)));
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
- /**
- * Search for domain details based on the provided search condition.
- *
- * @param condition The DomainDetailSearchCondition for searching.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity searchDomainDetail(final DomainDetailSearchCondition condition) {
- Map res = new HashMap<>();
- Set tags = new HashSet<>();
-
- String appPkgId = condition.getAppPkgId();
- if (StringUtils.isNotBlank(appPkgId)) {
- ApplicationPackageDetailVo app = searchAppDetail(appPkgId);
- res.put("IMAGE", app);
- tags.add("IMAGE");
- }
-
- String rpmPkgId = condition.getRpmPkgId();
- if (StringUtils.isNotBlank(rpmPkgId)) {
- RPMPackageDetailVo rpm = searchRpmDetail(rpmPkgId);
- res.put("RPM", rpm);
- tags.add("RPM");
- }
-
- String epkgPkgId = condition.getEpkgPkgId();
- if (StringUtils.isNotBlank(epkgPkgId)) {
- EPKGPackageDetailVo epkg = searchEpkgDetail(epkgPkgId);
- res.put("EPKG", epkg);
- tags.add("EPKG");
- }
-
- res.put("tags", tags);
- return ResultUtil.success(HttpStatus.OK, res);
-
- }
-
- /**
- * Search for EPKG package detail based on the provided EPKG package ID.
- *
- * @param epkgPkgId The EPKG package ID to search for.
- * @return An EPKGPackageDetailVo object containing the details.
- */
- private EPKGPackageDetailVo searchEpkgDetail(final String epkgPkgId) {
- List epkgList = epkgPackageGateway.queryDetailByPkgId(epkgPkgId);
- if (epkgList.size() != 1) {
- throw new ParamErrorException(String.format(MessageCode.EC00014.getMsgEn(), "epkgPkgId"));
- }
- return epkgList.get(0);
- }
-
- /**
- * Search for application package detail based on the provided application
- * package ID.
- *
- * @param appPkgId The application package ID to search for.
- * @return An ApplicationPackageDetailVo object containing the details.
- */
- private ApplicationPackageDetailVo searchAppDetail(final String appPkgId) {
- List appList = applicationPackageGateway.queryDetailByPkgId(appPkgId);
- if (appList.size() != 1) {
- throw new ParamErrorException(String.format(MessageCode.EC00014.getMsgEn(), "appPkgId"));
- }
- return appList.get(0);
- }
-
- /**
- * Search for RPM package detail based on the provided RPM package ID.
- *
- * @param rpmPkgId The RPM package ID to search for.
- * @return An RPMPackageDetailVo object containing the details.
- */
- private RPMPackageDetailVo searchRpmDetail(final String rpmPkgId) {
- List rpmList = rpmPackageGateway.queryDetailByPkgId(rpmPkgId);
- if (rpmList.size() != 1) {
- throw new ParamErrorException(String.format(MessageCode.EC00014.getMsgEn(), "rpmPkgId"));
- }
- return rpmList.get(0);
- }
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/converter/DomainPackageConverter.java b/src/main/java/com/easysoftware/application/domainpackage/converter/DomainPackageConverter.java
deleted file mode 100644
index e510f67c0dd8029b5bc2bdf976694025e03b8556..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/converter/DomainPackageConverter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.easysoftware.application.domainpackage.converter;
-
-import org.springframework.beans.BeanUtils;
-
-import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition;
-import com.easysoftware.application.domainpackage.dto.DomainSearchCondition;
-import com.easysoftware.application.epkgpackage.dto.EPKGPackageSearchCondition;
-import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition;
-
-public final class DomainPackageConverter {
-
- // Private constructor to prevent instantiation of the utility class
- private DomainPackageConverter() {
- // private constructor to hide the implicit public one
- throw new AssertionError("Cannot instantiate DomainPackageConverter class");
- }
-
- /**
- * Converts a DomainSearchCondition object to an ApplicationPackageSearchCondition object.
- *
- * @param con The DomainSearchCondition to convert.
- * @return An ApplicationPackageSearchCondition object.
- */
- public static ApplicationPackageSearchCondition toApp(final DomainSearchCondition con) {
- ApplicationPackageSearchCondition appCon = new ApplicationPackageSearchCondition();
- BeanUtils.copyProperties(con, appCon);
- appCon.setName("");
- appCon.setTimeOrder("");
- return appCon;
- }
-
- /**
- * Converts a DomainSearchCondition object to an RPMPackageSearchCondition object.
- *
- * @param con The DomainSearchCondition to convert.
- * @return An RPMPackageSearchCondition object.
- */
- public static RPMPackageSearchCondition toRpm(final DomainSearchCondition con) {
- RPMPackageSearchCondition rPMCon = new RPMPackageSearchCondition();
- BeanUtils.copyProperties(con, rPMCon);
- rPMCon.setName("");
- return rPMCon;
- }
-
- /**
- * Converts a DomainSearchCondition object to an EPKGPackageSearchCondition object.
- *
- * @param con The DomainSearchCondition to convert.
- * @return An EPKGPackageSearchCondition object.
- */
- public static EPKGPackageSearchCondition toEpkg(final DomainSearchCondition con) {
- EPKGPackageSearchCondition eCon = new EPKGPackageSearchCondition();
- BeanUtils.copyProperties(con, eCon);
- eCon.setName("");
- return eCon;
- }
-
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainColumnCondition.java b/src/main/java/com/easysoftware/application/domainpackage/dto/DomainColumnCondition.java
deleted file mode 100644
index 8a2bf03c92f516dc8b49c7d4e42d909181c4b0a7..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainColumnCondition.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.easysoftware.application.domainpackage.dto;
-
-import org.hibernate.validator.constraints.Range;
-
-import com.easysoftware.common.constant.PackageConstant;
-
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class DomainColumnCondition {
- /**
- * Page number within the range of PackageConstant.MIN_PAGE_NUM and PackageConstant.MAX_PAGE_NUM.
- */
- @Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
- private Integer pageNum = 1;
-
- /**
- * Page size within the range of PackageConstant.MIN_PAGE_SIZE and PackageConstant.MAX_PAGE_SIZE.
- */
- @Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
- private Integer pageSize = 10;
-
- /**
- * Name with a maximum size of 50 characters and must not be blank.
- */
- @Size(max = 50)
- @NotBlank
- private String name;
-
- /**
- * Column with a maximum size of 50 characters and must not be blank.
- */
- @Size(max = 50)
- @NotBlank
- private String column;
-
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainDetailSearchCondition.java b/src/main/java/com/easysoftware/application/domainpackage/dto/DomainDetailSearchCondition.java
deleted file mode 100644
index fbf933412aafddc31e2de00226c9441d6f7b6043..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainDetailSearchCondition.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.easysoftware.application.domainpackage.dto;
-
-import com.easysoftware.common.constant.PackageConstant;
-
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class DomainDetailSearchCondition {
- /**
- * RPM package ID with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String rpmPkgId;
-
- /**
- * EPKG package ID with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String epkgPkgId;
-
- /**
- * Application package ID with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String appPkgId;
-
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainSearchCondition.java b/src/main/java/com/easysoftware/application/domainpackage/dto/DomainSearchCondition.java
deleted file mode 100644
index 5e62419bc88cf09655166e6306838a670e46999e..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/dto/DomainSearchCondition.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.easysoftware.application.domainpackage.dto;
-
-import org.hibernate.validator.constraints.Range;
-import com.easysoftware.common.constant.PackageConstant;
-import com.easysoftware.common.exception.enumvalid.DomainNameEnum;
-import com.easysoftware.common.exception.enumvalid.EnumValue;
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class DomainSearchCondition {
- /**
- * Domain name with an enum value from DomainNameEnum.isValidCategory.
- */
- @EnumValue(enumClass = DomainNameEnum.class, enumMethod = "isValidCategory")
- private String name;
-
- /**
- * Software package entity with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- // 软件包名称
- private String entity;
-
- /**
- * Operating system with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String os;
-
- /**
- * Architecture with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String arch;
-
- /**
- * Category with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String category;
-
- /**
- * Version with a maximum length of PackageConstant.MAX_FIELD_LENGTH.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String version;
-
- /**
- * Time order.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String timeOrder;
-
- /**
- * Page number within the range of PackageConstant.MIN_PAGE_NUM and PackageConstant.MAX_PAGE_NUM.
- */
- @Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
- private Integer pageNum = 1;
-
- /**
- * Page size within the range of PackageConstant.MIN_PAGE_SIZE and PackageConstant.MAX_PAGE_SIZE.
- */
- @Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
- private Integer pageSize = 10;
-
- /**
- * Name order.
- */
- @Size(max = PackageConstant.MAX_FIELD_LENGTH)
- private String nameOrder;
-
-}
-
diff --git a/src/main/java/com/easysoftware/application/domainpackage/dto/InputDomainPackage.java b/src/main/java/com/easysoftware/application/domainpackage/dto/InputDomainPackage.java
deleted file mode 100644
index 4b5da603efd4f145e5d6b7fe8cc2771b5775f17b..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/dto/InputDomainPackage.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package com.easysoftware.application.domainpackage.dto;
-
-import org.hibernate.validator.constraints.URL;
-
-import com.easysoftware.common.exception.enumvalid.AppCategoryEnum;
-import com.easysoftware.common.exception.enumvalid.EnumValue;
-
-import jakarta.validation.constraints.Email;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class InputDomainPackage {
- /**
- * Description with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of description can not exceed 10000")
- private String description;
-
- /**
- * Name that cannot be null and has a maximum length of 255 characters.
- */
- @NotBlank(message = "name can not be null")
- @Size(max = 255, message = "the length of name can not exceed 255")
- private String name;
-
- /**
- * Description with a license length of 10000 characters.
- */
- @Size(max = 1000, message = "the length of arch can not exceed 1000")
- private String license;
-
- /**
- * Download information with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of download can not exceed 10000")
- private String download;
-
- /**
- * Environment details with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of environment can not exceed 10000")
- private String environment;
-
- /**
- * Installation instructions with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of installation can not exceed 10000")
- private String installation;
-
- /**
- * Similar packages information with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of similarPkgs can not exceed 10000")
- private String similarPkgs;
-
- /**
- * Dependency packages information with a maximum length of 10000 characters.
- */
- @Size(max = 10000, message = "the length of dependencyPkgs can not exceed 10000")
- private String dependencyPkgs;
-
- /**
- * Category with validation against AppCategoryEnum's valid categories.
- */
- @EnumValue(enumClass = AppCategoryEnum.class, enumMethod = "isValidCategory")
- private String category;
-
- /**
- * Type with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of type can not exceed 100")
- private String type;
-
-
- /**
- * URL to the icon of maximum length 100 characters.
- */
- @Size(max = 100, message = "the length of iconUrl can not exceed 100")
- private String iconUrl;
-
- /**
- * Application version with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of appVer can not exceed 100")
- private String appVer;
-
- /**
- * Operating system support information with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of osSupport can not exceed 100")
- private String osSupport;
-
- /**
- * Operating system details with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of os can not exceed 100")
- private String os;
-
- /**
- * Architecture details with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of arch can not exceed 100")
- private String arch;
-
- /**
- * Maintainer ID with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerId can not exceed 100")
- private String maintainerId;
-
- /**
- * Email address of the maintainer with a maximum length of 100 characters.
- */
- @Email
- @Size(max = 100, message = "the length of maintainerEmail can not exceed 100")
- private String maintainerEmail;
-
- /**
- * Gitee ID of the maintainer with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerGiteeId can not exceed 100")
- private String maintainerGiteeId;
-
- /**
- * Last update timestamp for the maintainer with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of maintainerUpdateAt can not exceed 100")
- private String maintainerUpdateAt;
-
- /**
- * Security level information with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of securityLevel can not exceed 100")
- private String securityLevel;
-
- /**
- * Safe label information with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of safeLabel can not exceed 100")
- private String safeLabel;
-
- /**
- * Download count information with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of downloadCount can not exceed 100")
- private String downloadCount;
-
- /**
- * Application size information with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of appSize can not exceed 100")
- private String appSize;
-
- /**
- * Source repository URL with a maximum length of 100 characters.
- */
- @Size(max = 100, message = "the length of srcRepo can not exceed 100")
- private String srcRepo;
-
- /**
- * URL for downloading the source code with a maximum length of 200 characters.
- */
- @URL
- @Size(max = 200, message = "the length of srcDownloadUrl can not exceed 200")
- private String srcDownloadUrl;
-
- /**
- * URL for downloading the binary with a maximum length of 200 characters.
- */
- @URL
- @Size(max = 200, message = "the length of binDownloadUrl can not exceed 200")
- private String binDownloadUrl;
-
-}
diff --git a/src/main/java/com/easysoftware/application/domainpackage/vo/DomainPackageMenuVo.java b/src/main/java/com/easysoftware/application/domainpackage/vo/DomainPackageMenuVo.java
deleted file mode 100644
index 44ee81052ed97a1b689bf126bdd604dc6207952e..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/domainpackage/vo/DomainPackageMenuVo.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.easysoftware.application.domainpackage.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-@Data
-@AllArgsConstructor
-public class DomainPackageMenuVo {
- /**
- * Category of the package.
- */
- private String category;
-
- /**
- * Name of the package.
- */
- private String name;
-
- /**
- * Description of the package.
- */
- private String description;
-
- /**
- * URL to the icon of the package.
- */
- private String iconUrl;
-
- /**
- * Set of tags associated with the package.
- */
- private Set tags;
-
- /**
- * Map of package IDs where the key is the ID and the value is additional information.
- */
- private Map pkgIds;
-
-
- /**
- * Constructor for DomainPackageMenuVo class.
- * Initializes tags as a new HashSet and pkgIds as a new HashMap with default values.
- */
- public DomainPackageMenuVo() {
- this.tags = new HashSet<>();
- this.pkgIds = new HashMap<>();
- this.pkgIds.put("RPM", "");
- this.pkgIds.put("EPKG", "");
- this.pkgIds.put("IMAGE", "");
- }
-}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageService.java b/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageService.java
index 9b3f31108d13aa355752143129af9a2c074451cc..9e919d0bfac88cee9a7be94be9f6be9e385a4194 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageService.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageService.java
@@ -1,40 +1,23 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage;
import com.easysoftware.application.BaseIService;
+import com.easysoftware.application.epkgpackage.dto.EPKGPackageNameSearchCondition;
import com.easysoftware.application.epkgpackage.dto.EPKGPackageSearchCondition;
-import com.easysoftware.application.epkgpackage.dto.InputEPKGPackage;
import com.easysoftware.infrastructure.epkgpackage.gatewayimpl.dataobject.EPKGPackageDO;
import org.springframework.http.ResponseEntity;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
public interface EPKGPackageService extends BaseIService {
- /**
- * Inserts an EPKG package.
- *
- * @param inputrPMPackage InputEPKGPackage object.
- * @return ResponseEntity.
- */
- ResponseEntity insertEPKGPkg(InputEPKGPackage inputrPMPackage);
-
- /**
- * Updates an EPKG package.
- *
- * @param inputrPMPackage InputEPKGPackage object.
- * @return ResponseEntity.
- */
- ResponseEntity updateEPKGPkg(InputEPKGPackage inputrPMPackage);
-
- /**
- * Deletes EPKG packages by their names.
- *
- * @param names List of package names to delete.
- * @return ResponseEntity.
- */
- ResponseEntity deleteEPKGPkg(List names);
-
/**
* Searches for EPKG packages based on search conditions.
*
@@ -43,50 +26,11 @@ public interface EPKGPackageService extends BaseIService {
*/
ResponseEntity searchEPKGPkg(EPKGPackageSearchCondition condition);
- /**
- * Queries all EPKG package menus based on search conditions.
- *
- * @param condition EPKGPackageSearchCondition object.
- * @return Map containing the menu data.
- */
- Map queryAllEPKGPkgMenu(EPKGPackageSearchCondition condition);
-
- /**
- * Checks if an application with a given name exists.
- *
- * @param name Name of the application.
- * @return boolean indicating if the application exists.
- */
- boolean existApp(String name);
-
- /**
- * Saves a single data object.
- *
- * @param dataObject Data object to save.
- */
- void saveDataObject(String dataObject);
-
- /**
- * Saves a batch of data objects.
- *
- * @param dataObject ArrayList of data objects to save.
- */
- void saveDataObjectBatch(ArrayList dataObject);
-
/**
* Queries available openEuler version of epkg package.
*
* @param condition The search condition.
* @return Map containing the openEuler versions.
*/
- ResponseEntity queryEulerVersionsByName(EPKGPackageSearchCondition condition);
-
- /**
- * Queries available openEuler archs of epkg package.
- *
- * @param condition The search condition.
- * @return Map containing the openEuler versions.
- */
- ResponseEntity queryEulerArchsByName(EPKGPackageSearchCondition condition);
-
+ ResponseEntity queryEulerVersionsByName(EPKGPackageNameSearchCondition condition);
}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageServiceImpl.java b/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageServiceImpl.java
index ffcfde107eabf06c98d07641b2c7e300ffa81a5c..857fca2d5cc6cc28764ad55600244b4e367e79e2 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageServiceImpl.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/EPKGPackageServiceImpl.java
@@ -1,23 +1,28 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.easysoftware.application.epkgpackage.dto.EPKGPackageNameSearchCondition;
import com.easysoftware.application.epkgpackage.dto.EPKGPackageSearchCondition;
-import com.easysoftware.application.epkgpackage.dto.InputEPKGPackage;
import com.easysoftware.application.epkgpackage.vo.EPKGPackageDetailVo;
-import com.easysoftware.common.utils.ObjectMapperUtil;
+import com.easysoftware.common.exception.NoneResException;
+import com.easysoftware.common.exception.ParamErrorException;
import com.easysoftware.common.utils.ResultUtil;
-import com.easysoftware.common.utils.UuidUtil;
-import com.easysoftware.domain.epkgpackage.EPKGPackage;
-import com.easysoftware.domain.epkgpackage.EPKGPackageUnique;
import com.easysoftware.domain.epkgpackage.gateway.EPKGPackageGateway;
import com.easysoftware.infrastructure.epkgpackage.gatewayimpl.dataobject.EPKGPackageDO;
import com.easysoftware.infrastructure.mapper.EPKGPackageDOMapper;
-import com.easysoftware.kafka.Producer;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
@@ -35,73 +40,6 @@ public class EPKGPackageServiceImpl extends
@Resource
private EPKGPackageGateway ePKGPackageGateway;
- /**
- * Kafka producer for messaging.
- */
- @Autowired
- private Producer kafkaProducer;
-
- /**
- * API endpoint for repository maintainers.
- */
- @Value("${api.repoMaintainer}")
- private String repoMaintainerApi;
-
- /**
- * API endpoint for repository signatures.
- */
- @Value("${api.repoSig}")
- private String repoSigApi;
-
- /**
- * Kafka topic for application version messages.
- */
- @Value("${producer.topic}")
- private String topicAppVersion;
-
- /**
- * Deletes EPKG packages by their names.
- *
- * @param ids List of package names to delete.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity deleteEPKGPkg(final List ids) {
- int mark = ePKGPackageGateway.delete(ids);
- String msg = String.format("the number of deleted : %d", mark);
- return ResultUtil.success(HttpStatus.OK, msg);
- }
-
- /**
- * Inserts an EPKG package.
- *
- * @param inputEPKGPackage InputEPKGPackage object.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity insertEPKGPkg(final InputEPKGPackage inputEPKGPackage) {
- EPKGPackage epkgPkg = new EPKGPackage();
- BeanUtils.copyProperties(inputEPKGPackage, epkgPkg);
-
- Map kafkaMsg = ObjectMapperUtil.jsonToMap(inputEPKGPackage);
- kafkaMsg.put("table", "EPKGPackage");
- kafkaProducer.sendMess(topicAppVersion + "_epkg", UuidUtil.getUUID32(),
- ObjectMapperUtil.writeValueAsString(kafkaMsg));
-
- return ResultUtil.success(HttpStatus.OK);
- }
-
- /**
- * Queries all EPKG package menus based on search conditions.
- *
- * @param condition EPKGPackageSearchCondition object.
- * @return Map containing the menu data.
- */
- @Override
- public Map queryAllEPKGPkgMenu(final EPKGPackageSearchCondition condition) {
- return ePKGPackageGateway.queryMenuByName(condition);
- }
-
/**
* Searches for EPKG packages based on search conditions.
*
@@ -110,48 +48,21 @@ public class EPKGPackageServiceImpl extends
*/
@Override
public ResponseEntity searchEPKGPkg(final EPKGPackageSearchCondition condition) {
- String os = StringUtils.trimToEmpty(condition.getOs());
- String subPath = StringUtils.trimToEmpty(condition.getSubPath());
- String name = StringUtils.trimToEmpty(condition.getName());
- String version = StringUtils.trimToEmpty(condition.getVersion());
- String arch = StringUtils.trimToEmpty(condition.getArch());
-
- StringBuilder cSb = new StringBuilder();
- cSb.append(os);
- cSb.append(subPath);
- cSb.append(name);
- cSb.append(version);
- cSb.append(arch);
- String pkgId = cSb.toString();
-
- List epkgList = ePKGPackageGateway.queryDetailByPkgId(pkgId);
+ if (StringUtils.isBlank(condition.getPkgId())) {
+ throw new ParamErrorException("the pkgid can not be null");
+ }
- if (!epkgList.isEmpty()) {
- Map res = Map.ofEntries(
- Map.entry("total", epkgList.size()),
- Map.entry("list", epkgList));
- return ResultUtil.success(HttpStatus.OK, res);
+ List epkgList = ePKGPackageGateway.queryDetailByPkgId(condition.getPkgId());
+ if (epkgList.isEmpty()) {
+ throw new NoneResException("the epkg package does not exist");
}
- Map res = ePKGPackageGateway.queryDetailByName(condition);
+ Map res = Map.ofEntries(
+ Map.entry("total", epkgList.size()),
+ Map.entry("list", epkgList));
return ResultUtil.success(HttpStatus.OK, res);
}
- /**
- * Updates an EPKG package.
- *
- * @param inputEPKGPackage InputEPKGPackage object.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity updateEPKGPkg(final InputEPKGPackage inputEPKGPackage) {
- EPKGPackage epkgPkg = new EPKGPackage();
- BeanUtils.copyProperties(inputEPKGPackage, epkgPkg);
- int mark = ePKGPackageGateway.update(epkgPkg);
- String msg = String.format("the number of updated : %d", mark);
- return ResultUtil.success(HttpStatus.OK, msg);
- }
-
/**
* Saves a batch of data objects.
*
@@ -159,28 +70,7 @@ public class EPKGPackageServiceImpl extends
*/
@Override
public void saveDataObjectBatch(final ArrayList dataObject) {
- saveOrUpdateBatch(ePKGPackageGateway.convertBatch(dataObject));
- }
-
- /**
- * Checks if an application with a given name exists.
- *
- * @param unique unique of the application.
- * @return boolean indicating if the application exists.
- */
- @Override
- public boolean existApp(final String unique) {
- EPKGPackageUnique uniquePkg = ObjectMapperUtil.jsonToObject(unique, EPKGPackageUnique.class);
- return ePKGPackageGateway.existEPKG(uniquePkg);
- }
-
- /**
- * Saves a single data object.
- *
- * @param dataObject Data object to save.
- */
- @Override
- public void saveDataObject(final String dataObject) {
+ return;
}
/**
@@ -190,21 +80,8 @@ public class EPKGPackageServiceImpl extends
* @return Map containing the epkg package menu.
*/
@Override
- public ResponseEntity queryEulerVersionsByName(EPKGPackageSearchCondition condition) {
+ public ResponseEntity queryEulerVersionsByName(EPKGPackageNameSearchCondition condition) {
Map res = ePKGPackageGateway.queryEulerVersionByName(condition);
return ResultUtil.success(HttpStatus.OK, res);
}
-
- /**
- * Queries all available openEuler archs of epkg package.
- *
- * @param condition The search condition.
- * @return Map containing the epkg package menu.
- */
- @Override
- public ResponseEntity queryEulerArchsByName(EPKGPackageSearchCondition condition) {
- Map res = ePKGPackageGateway.queryEulerArchsByName(condition);
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageNameSearchCondition.java b/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageNameSearchCondition.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc299433a3654f0127e0d9d279e4aa5dd3bcf4e3
--- /dev/null
+++ b/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageNameSearchCondition.java
@@ -0,0 +1,33 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
+package com.easysoftware.application.epkgpackage.dto;
+
+import com.easysoftware.common.constant.PackageConstant;
+
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class EPKGPackageNameSearchCondition {
+ /**
+ * Name field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
+ */
+ @Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
+ private String name;
+
+}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageSearchCondition.java b/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageSearchCondition.java
index 623f7c2b8a42442cf7fe4419f7765301dd4c488b..e04150123fc6b32640f66ffe278f742f3bc42114 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/dto/EPKGPackageSearchCondition.java
@@ -1,9 +1,22 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage.dto;
import org.hibernate.validator.constraints.Range;
import com.easysoftware.common.constant.PackageConstant;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -17,78 +30,91 @@ public class EPKGPackageSearchCondition {
* Name field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String name;
/**
* ID field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String id;
/**
* Package ID field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String pkgId;
/**
* Page number within the specified range defined by PackageConstant.MIN_PAGE_NUM and PackageConstant.MAX_PAGE_NUM.
*/
@Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
+ @NotNull
private Integer pageNum = 1;
/**
* Page size within the specified range defined by PackageConstant.MIN_PAGE_SIZE and PackageConstant.MAX_PAGE_SIZE.
*/
@Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
+ @NotNull
private Integer pageSize = 10;
/**
* Version field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String version;
/**
* Operating system field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String os;
/**
* Subpath field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String subPath;
/**
* Architecture field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String arch;
/**
* Category field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String category;
/**
* EPKG update timestamp field with a maximum length defined by PackageConstant.MAX_FIELD_LENGTH.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String epkgUpdateAt;
/**
* Time order.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String timeOrder;
/**
* Name order.
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String nameOrder;
}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/dto/InputEPKGPackage.java b/src/main/java/com/easysoftware/application/epkgpackage/dto/InputEPKGPackage.java
deleted file mode 100644
index 799eadb186a62cabc96cb2ff9bd6bd1848176ef6..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/epkgpackage/dto/InputEPKGPackage.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package com.easysoftware.application.epkgpackage.dto;
-
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class InputEPKGPackage {
- /**
- * Name of the package.
- */
- @Size(max = 255, message = "the length of name cannot exceed 255")
- private String name;
-
- /**
- * Unique identifier for the package.
- */
- @Size(max = 255, message = "the length of id cannot exceed 255")
- private String id;
-
- /**
- * Version of the package.
- */
- @Size(max = 255, message = "the length of version cannot exceed 255")
- private String version;
-
- /**
- * Operating system compatibility.
- */
- @Size(max = 255, message = "the length of os cannot exceed 255")
- private String os;
-
- /**
- * Architecture type required by the package.
- */
- @Size(max = 255, message = "the length of arch cannot exceed 255")
- private String arch;
-
- /**
- * Category of the package.
- */
- @Size(max = 255, message = "the length of category cannot exceed 255")
- private String category;
-
- /**
- * Update timestamp for the package.
- */
- @Size(max = 255, message = "the length of epkgUpdateAt cannot exceed 255")
- private String epkgUpdateAt;
-
- /**
- * Source repository URL.
- */
- @Size(max = 255, message = "the length of srcRepo cannot exceed 255")
- private String srcRepo;
-
- /**
- * Size of the package.
- */
- @Size(max = 255, message = "the length of epkgSize cannot exceed 255")
- private String epkgSize;
-
- /**
- * Binary download URL.
- */
- @Size(max = 255, message = "the length of binDownloadUrl cannot exceed 255")
- private String binDownloadUrl;
-
- /**
- * Source code download URL.
- */
- @Size(max = 255, message = "the length of srcDownloadUrl cannot exceed 255")
- private String srcDownloadUrl;
-
- /**
- * Brief summary of the package.
- */
- @Size(max = 255, message = "the length of summary cannot exceed 255")
- private String summary;
-
- /**
- * Supported operating systems.
- */
- @Size(max = 255, message = "the length of osSupport cannot exceed 255")
- private String osSupport;
-
- /**
- * Repository URL.
- */
- @Size(max = 255, message = "the length of repo cannot exceed 255")
- private String repo;
-
- /**
- * Type of repository.
- */
- @Size(max = 255, message = "the length of repoType cannot exceed 255")
- private String repoType;
-
- /**
- * Installation instructions.
- */
- @Size(max = 10000, message = "the length of installation cannot exceed 10000")
- private String installation;
-
- /**
- * Detailed description of the package.
- */
- @Size(max = 10000, message = "the length of description cannot exceed 10000")
- private String description;
-
- /**
- * Dependencies required by the package.
- */
- @Size(max = 100_0000, message = "the length of requires can not exceed 100_0000")
- private String requires;
-
- /**
- * Features provided by the package.
- */
- @Size(max = 100_0000, message = "the length of provides can not exceed 100_0000")
- private String provides;
-
- /**
- * Conflicting packages.
- */
- @Size(max = 100_0000, message = "the length of conflicts can not exceed 100_0000")
- private String conflicts;
-
- /**
- * Changelog for the package.
- */
- @Size(max = 100_0000, message = "the length of changeLog can not exceed 100_0000")
- private String changeLog;
-
- /**
- * Path to package files.
- */
- @Size(max = 100_0000, message = "the length of path can not exceed 100_0000")
- private String files;
-
- /**
- * Maintainer's unique identifier.
- */
- @Size(max = 255, message = "the length of maintainerId cannot exceed 255")
- private String maintainerId;
-
- /**
- * Maintainer's email address.
- */
- @Size(max = 255, message = "the length of maintainerEmail cannot exceed 255")
- private String maintainerEmail;
-
- /**
- * Maintainer's Gitee ID.
- */
- @Size(max = 255, message = "the length of maintainerGiteeId cannot exceed 255")
- private String maintainerGiteeId;
-
- /**
- * Update timestamp for the maintainer.
- */
- @Size(max = 255, message = "the length of maintainerUpdateAt cannot exceed 255")
- private String maintainerUpdateAt;
-
- /**
- * Status of the maintainer.
- */
- @Size(max = 255, message = "the length of maintainerStatus cannot exceed 255")
- private String maintainerStatus;
-
- /**
- * Upstream source information.
- */
- @Size(max = 255, message = "the length of upStream cannot exceed 255")
- private String upStream;
-
- /**
- * Security-related information.
- */
- @Size(max = 255, message = "the length of security cannot exceed 255")
- private String security;
-
- /**
- * List of similar packages.
- */
- @Size(max = 1000, message = "the length of similarPkgs cannot exceed 1000")
- private String similarPkgs;
-
- /**
- * Download count for the package.
- */
- @Size(max = 255, message = "the length of downloadCount cannot exceed 255")
- private String downloadCount;
-
- /**
- * Unique identifier for the package.
- */
- @Size(max = 255, message = "the length of pkgId cannot exceed 255")
- private String pkgId;
-
- /**
- * Subpath information.
- */
- @Size(max = 255, message = "the length of subPath cannot exceed 255")
- private String subPath;
-
- /**
- * License.
- */
- @Size(max = 10_000, message = "the length of license cannot exceed 10000")
- private String license;
-
-}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageDetailVo.java b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageDetailVo.java
index 2faa4f43725a82f4684ee2c2e7062fbd67168e82..cdec4ee12b4df87b04206b3d1c44e9f138fa87c5 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageDetailVo.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageDetailVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerArchsVo.java b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerArchsVo.java
deleted file mode 100644
index 485b042ac97348c08f2820ae29813e0f4c9ecd5f..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerArchsVo.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.easysoftware.application.epkgpackage.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class EPKGPackageEulerArchsVo {
- /**
- * OpenEuler arch of the package.
- */
- private String arch;
-}
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerVersionVo.java b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerVersionVo.java
index 01e01184f33cb11d09e8b1bfecccb4e0fb35f38b..3cf3dce0444eb78617aa61a9d4d79c0458d27b6a 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerVersionVo.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageEulerVersionVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageMenuVo.java b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageMenuVo.java
index 54cac305054c91b348845add757d8347f4ff1e41..f2209c42a0527b2352942e755c2027924514b07b 100644
--- a/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageMenuVo.java
+++ b/src/main/java/com/easysoftware/application/epkgpackage/vo/EPKGPackageMenuVo.java
@@ -1,3 +1,14 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.epkgpackage.vo;
import lombok.AllArgsConstructor;
diff --git a/src/main/java/com/easysoftware/application/externalos/ExternalOsService.java b/src/main/java/com/easysoftware/application/externalos/ExternalOsService.java
deleted file mode 100644
index 8501e1a8eb29c97e2c28a2fffc4f72e52d0b4fa8..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/externalos/ExternalOsService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.easysoftware.application.externalos;
-
-import com.easysoftware.application.externalos.dto.ExternalOsSearchCondiiton;
-import com.easysoftware.application.externalos.dto.InputExternalOs;
-import org.springframework.http.ResponseEntity;
-
-import java.util.List;
-
-public interface ExternalOsService {
-
- /**
- * Search for package mappings based on the specified search conditions.
- *
- * @param condition The search conditions to filter package mappings.
- * @return ResponseEntity.
- */
- ResponseEntity searchPkgMap(ExternalOsSearchCondiiton condition);
-
- /**
- * Insert a new package mapping using the provided input data.
- *
- * @param input The input data for creating a new package mapping.
- * @return ResponseEntity.
- */
- ResponseEntity insertPkgMap(InputExternalOs input);
-
- /**
- * Update an existing package mapping with the provided input data.
- *
- * @param input The input data for updating an existing package mapping.
- * @return ResponseEntity.
- */
- ResponseEntity updatePkgMap(InputExternalOs input);
-
- /**
- * Delete package mappings associated with the specified list of IDs.
- *
- * @param ids List of IDs of package mappings to be deleted.
- * @return ResponseEntity.
- */
- ResponseEntity deletePkgMap(List ids);
-
-
-}
diff --git a/src/main/java/com/easysoftware/application/externalos/ExternalOsServiceImpl.java b/src/main/java/com/easysoftware/application/externalos/ExternalOsServiceImpl.java
deleted file mode 100644
index 7c3b31165f26cb76254b4886a96b202f14916926..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/externalos/ExternalOsServiceImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.easysoftware.application.externalos;
-
-import com.easysoftware.application.externalos.dto.ExternalOsSearchCondiiton;
-import com.easysoftware.application.externalos.dto.InputExternalOs;
-import com.easysoftware.common.entity.MessageCode;
-import com.easysoftware.common.utils.ResultUtil;
-import com.easysoftware.domain.externalos.ExternalOs;
-import com.easysoftware.domain.externalos.gateway.ExternalOsGateway;
-import jakarta.annotation.Resource;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class ExternalOsServiceImpl implements ExternalOsService {
- /**
- * Gateway for external operating system operations.
- */
- @Resource
- private ExternalOsGateway externalOsGateway;
-
- /**
- * Search for package mappings based on the specified search conditions.
- *
- * @param condition The search conditions to filter package mappings.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity searchPkgMap(final ExternalOsSearchCondiiton condition) {
- Map res = externalOsGateway.queryPkgMap(condition);
- return ResultUtil.success(HttpStatus.OK, res);
- }
-
- /**
- * Delete package mappings associated with the specified list of IDs.
- *
- * @param ids List of IDs of package mappings to be deleted.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity deletePkgMap(final List ids) {
- int mark = externalOsGateway.delete(ids);
- String msg = String.format("the number of deleted : %d", mark);
- return ResultUtil.success(HttpStatus.OK, msg);
- }
-
- /**
- * Insert a new package mapping using the provided input data.
- *
- * @param input The input data for creating a new package mapping.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity insertPkgMap(final InputExternalOs input) {
- // 若数据库中已经存在该数据,则请求失败
- if (StringUtils.isNotBlank(input.getId())) {
- return ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0002);
- }
-
- ExternalOs ex = new ExternalOs();
- BeanUtils.copyProperties(input, ex);
-
- boolean succeed = externalOsGateway.save(ex);
- return succeed ? ResultUtil.success(HttpStatus.OK)
- : ResultUtil.fail(HttpStatus.BAD_REQUEST, MessageCode.EC0006);
- }
-
- /**
- * Update an existing package mapping with the provided input data.
- *
- * @param input The input data for updating an existing package mapping.
- * @return ResponseEntity.
- */
- @Override
- public ResponseEntity updatePkgMap(final InputExternalOs input) {
- ExternalOs ex = new ExternalOs();
- BeanUtils.copyProperties(input, ex);
-
- int mark = externalOsGateway.update(ex);
- String msg = String.format("the number of updated : %d", mark);
- return ResultUtil.success(HttpStatus.OK, msg);
- }
-
-}
diff --git a/src/main/java/com/easysoftware/application/externalos/dto/ExternalOsSearchCondiiton.java b/src/main/java/com/easysoftware/application/externalos/dto/ExternalOsSearchCondiiton.java
deleted file mode 100644
index 9bea6f10326b02a564bee467942f34936f6a6e29..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/externalos/dto/ExternalOsSearchCondiiton.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.easysoftware.application.externalos.dto;
-
-import org.hibernate.validator.constraints.Range;
-
-import com.easysoftware.common.constant.PackageConstant;
-
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class ExternalOsSearchCondiiton {
- /**
- * Page number within the specified range.
- */
- @Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
- private Integer pageNum = 1;
-
- /**
- * Page size within the specified range.
- */
- @Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
- private Integer pageSize = 10;
-
- /**
- * Name of the original operating system (maximum 50 characters).
- */
- @Size(max = 50)
- private String originOsName;
-
- /**
- * Version of the original operating system (maximum 50 characters).
- */
- @Size(max = 50)
- private String originOsVer;
-
- /**
- * Name of the original package (maximum 50 characters).
- */
- @Size(max = 50)
- private String originPkg;
-
- /**
- * Name of the target operating system (maximum 50 characters).
- */
- @Size(max = 50)
- private String targetOsName;
-
- /**
- * Version of the target operating system (maximum 50 characters).
- */
- @Size(max = 50)
- private String targetOsVer;
-
- /**
- * Name of the target package (maximum 50 characters).
- */
- @Size(max = 50)
- private String targetPkg;
-
-}
diff --git a/src/main/java/com/easysoftware/application/externalos/dto/InputExternalOs.java b/src/main/java/com/easysoftware/application/externalos/dto/InputExternalOs.java
deleted file mode 100644
index 3aa201a94bbadd2f0585e3322b8a0134076d1d03..0000000000000000000000000000000000000000
--- a/src/main/java/com/easysoftware/application/externalos/dto/InputExternalOs.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.easysoftware.application.externalos.dto;
-
-import jakarta.validation.constraints.Size;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class InputExternalOs {
- /**
- * Name (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of name cannot exceed 255")
- private String name;
-
- /**
- * Identifier (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of id cannot exceed 255")
- private String id;
-
- /**
- * Original operating system name (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of originOsName cannot exceed 255")
- private String originOsName;
-
- /**
- * Original operating system version (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of originOsVer cannot exceed 255")
- private String originOsVer;
-
- /**
- * Original package name (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of originPkg cannot exceed 255")
- private String originPkg;
-
- /**
- * Target operating system name (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of targetOsName cannot exceed 255")
- private String targetOsName;
-
- /**
- * Target operating system version (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of targetOsVer cannot exceed 255")
- private String targetOsVer;
-
- /**
- * Target package name (maximum length: 255 characters).
- */
- @Size(max = 255, message = "the length of targetPkg cannot exceed 255")
- private String targetPkg;
-
-
-}
diff --git a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgColumnSearchCondition.java b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgColumnSearchCondition.java
index eefb000dd38d5e0e7235a771431e29081e7b35ba..d9ea415b716dea77012f8a49589ca0b5de00f9e6 100644
--- a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgColumnSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgColumnSearchCondition.java
@@ -1,5 +1,19 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.fieldpkg.dto;
+import com.easysoftware.common.constant.PackageConstant;
+
+import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -13,11 +27,13 @@ public class FieldPkgColumnSearchCondition {
* Column (maximum length: 50).
*/
@Size(max = 50)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String column;
/**
* Name (maximum length: 50).
*/
@Size(max = 50)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String name;
}
diff --git a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgDetailSearchCondition.java b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgDetailSearchCondition.java
index 88b474ae691b5dd450a8d3742c5673d1e7826f5f..029ae162afa1a255031c0fad8d10f2748e1c2268 100644
--- a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgDetailSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgDetailSearchCondition.java
@@ -1,7 +1,19 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.fieldpkg.dto;
import com.easysoftware.common.constant.PackageConstant;
+import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -15,17 +27,20 @@ public class FieldPkgDetailSearchCondition {
* RPM package ID (maximum length: PackageConstant.MAX_FIELD_LENGTH).
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String rpmPkgId;
/**
* EPKG package ID (maximum length: PackageConstant.MAX_FIELD_LENGTH).
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String epkgPkgId;
/**
* Application package ID (maximum length: PackageConstant.MAX_FIELD_LENGTH).
*/
@Size(max = PackageConstant.MAX_FIELD_LENGTH)
+ @Pattern(regexp = PackageConstant.VALID_STR_REG, message = PackageConstant.VALID_MESSAGE)
private String appPkgId;
}
diff --git a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgSearchCondition.java b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgSearchCondition.java
index abfd754e47f363af4d346b24ea90f15901f667b8..42c94d9acd5d21154b45799be8f86b5219827ae5 100644
--- a/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgSearchCondition.java
+++ b/src/main/java/com/easysoftware/application/fieldpkg/dto/FieldPkgSearchCondition.java
@@ -1,9 +1,21 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.fieldpkg.dto;
import org.hibernate.validator.constraints.Range;
import com.easysoftware.common.constant.PackageConstant;
+import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -17,12 +29,14 @@ public class FieldPkgSearchCondition {
* Page number within the specified range.
*/
@Range(min = PackageConstant.MIN_PAGE_NUM, max = PackageConstant.MAX_PAGE_NUM)
+ @NotNull
private Integer pageNum = 1;
/**
* Page size within the specified range.
*/
@Range(min = PackageConstant.MIN_PAGE_SIZE, max = PackageConstant.MAX_PAGE_SIZE)
+ @NotNull
private Integer pageSize = 10;
/**
diff --git a/src/main/java/com/easysoftware/application/fieldpkg/vo/FieldPkgVo.java b/src/main/java/com/easysoftware/application/fieldpkg/vo/FieldPkgVo.java
index 4284403587356f1d31dc409ce9cf894cb0f9efcd..397e25fb2e9d9aa396df1a6eb93711eea593c490 100644
--- a/src/main/java/com/easysoftware/application/fieldpkg/vo/FieldPkgVo.java
+++ b/src/main/java/com/easysoftware/application/fieldpkg/vo/FieldPkgVo.java
@@ -1,7 +1,18 @@
+/* Copyright (c) 2024 openEuler Community
+ EasySoftware is licensed under the Mulan PSL v2.
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
+ You may obtain a copy of Mulan PSL v2 at:
+ http://license.coscl.org.cn/MulanPSL2
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ See the Mulan PSL v2 for more details.
+*/
+
package com.easysoftware.application.fieldpkg.vo;
+import java.util.List;
import java.util.Map;
-import java.util.Set;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -42,9 +53,9 @@ public class FieldPkgVo {
private String iconUrl;
/**
- * Set of tags.
+ * List of tags.
*/
- private Set