Compare commits
No commits in common. "main" and "LabWork3" have entirely different histories.
104
.gitignore
vendored
104
.gitignore
vendored
@ -1,79 +1,37 @@
|
|||||||
# ---> JetBrains
|
HELP.md
|
||||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
.gradle
|
||||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
build/
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
# User-specific stuff
|
### STS ###
|
||||||
.idea/**/workspace.xml
|
.apt_generated
|
||||||
.idea/**/tasks.xml
|
.classpath
|
||||||
.idea/**/usage.statistics.xml
|
.factorypath
|
||||||
.idea/**/dictionaries
|
.project
|
||||||
.idea/**/shelf
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
bin/
|
||||||
|
!**/src/main/**/bin/
|
||||||
|
!**/src/test/**/bin/
|
||||||
|
|
||||||
# AWS User-specific
|
### IntelliJ IDEA ###
|
||||||
.idea/**/aws.xml
|
.idea
|
||||||
|
|
||||||
# Generated files
|
|
||||||
.idea/**/contentModel.xml
|
|
||||||
|
|
||||||
# Sensitive or high-churn files
|
|
||||||
.idea/**/dataSources/
|
|
||||||
.idea/**/dataSources.ids
|
|
||||||
.idea/**/dataSources.local.xml
|
|
||||||
.idea/**/sqlDataSources.xml
|
|
||||||
.idea/**/dynamic.xml
|
|
||||||
.idea/**/uiDesigner.xml
|
|
||||||
.idea/**/dbnavigator.xml
|
|
||||||
|
|
||||||
# Gradle
|
|
||||||
.idea/**/gradle.xml
|
|
||||||
.idea/**/libraries
|
|
||||||
|
|
||||||
# Gradle and Maven with auto-import
|
|
||||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
|
||||||
# since they will be recreated, and may cause churn. Uncomment if using
|
|
||||||
# auto-import.
|
|
||||||
# .idea/artifacts
|
|
||||||
# .idea/compiler.xml
|
|
||||||
# .idea/jarRepositories.xml
|
|
||||||
# .idea/modules.xml
|
|
||||||
# .idea/*.iml
|
|
||||||
# .idea/modules
|
|
||||||
# *.iml
|
|
||||||
# *.ipr
|
|
||||||
|
|
||||||
# CMake
|
|
||||||
cmake-build-*/
|
|
||||||
|
|
||||||
# Mongo Explorer plugin
|
|
||||||
.idea/**/mongoSettings.xml
|
|
||||||
|
|
||||||
# File-based project format
|
|
||||||
*.iws
|
*.iws
|
||||||
|
*.iml
|
||||||
# IntelliJ
|
*.ipr
|
||||||
out/
|
out/
|
||||||
|
!**/src/main/**/out/
|
||||||
|
!**/src/test/**/out/
|
||||||
|
|
||||||
# mpeltonen/sbt-idea plugin
|
### NetBeans ###
|
||||||
.idea_modules/
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
# JIRA plugin
|
/dist/
|
||||||
atlassian-ide-plugin.xml
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
# Cursive Clojure plugin
|
|
||||||
.idea/replstate.xml
|
|
||||||
|
|
||||||
# SonarLint plugin
|
|
||||||
.idea/sonarlint/
|
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
||||||
com_crashlytics_export_strings.xml
|
|
||||||
crashlytics.properties
|
|
||||||
crashlytics-build.properties
|
|
||||||
fabric.properties
|
|
||||||
|
|
||||||
# Editor-based Rest Client
|
|
||||||
.idea/httpRequests
|
|
||||||
|
|
||||||
# Android studio 3.1+ serialized cache file
|
|
||||||
.idea/caches/build_file_checksums.ser
|
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
22
HELP.md
Normal file
22
HELP.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Getting Started
|
||||||
|
|
||||||
|
### Reference Documentation
|
||||||
|
For further reference, please consider the following sections:
|
||||||
|
|
||||||
|
* [Official Gradle documentation](https://docs.gradle.org)
|
||||||
|
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.0.2/gradle-plugin/reference/html/)
|
||||||
|
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.0.2/gradle-plugin/reference/html/#build-image)
|
||||||
|
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.0.2/reference/htmlsingle/#web)
|
||||||
|
|
||||||
|
### Guides
|
||||||
|
The following guides illustrate how to use some features concretely:
|
||||||
|
|
||||||
|
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
|
||||||
|
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
|
||||||
|
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
|
||||||
|
|
||||||
|
### Additional Links
|
||||||
|
These additional references should also help you:
|
||||||
|
|
||||||
|
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)
|
||||||
|
|
31
build.gradle
Normal file
31
build.gradle
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
id 'org.springframework.boot' version '3.0.2'
|
||||||
|
id 'io.spring.dependency-management' version '1.1.0'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
group = 'com.lab'
|
||||||
|
version = '0.0.1-SNAPSHOT'
|
||||||
|
sourceCompatibility = '17'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
|
implementation 'com.h2database:h2:2.1.214'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||||
|
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.15'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.0.4'
|
||||||
|
implementation 'org.hibernate:hibernate-core:6.1.7.Final'
|
||||||
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
testImplementation 'org.testng:testng:7.7.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('test') {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
240
gradlew
vendored
Normal file
240
gradlew
vendored
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
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
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
91
gradlew.bat
vendored
Normal file
91
gradlew.bat
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem 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, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
1
settings.gradle
Normal file
1
settings.gradle
Normal file
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = 'springbapp'
|
14
src/main/java/com/lab/springbapp/SpringbappApplication.java
Normal file
14
src/main/java/com/lab/springbapp/SpringbappApplication.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.lab.springbapp;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class SpringbappApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(SpringbappApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
12
src/main/java/com/lab/springbapp/WebConfiguration.java
Normal file
12
src/main/java/com/lab/springbapp/WebConfiguration.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package com.lab.springbapp;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebConfiguration implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
|
registry.addMapping("/**").allowedMethods("*");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.lab.springbapp.configuration;
|
||||||
|
|
||||||
|
import com.lab.springbapp.domain.TypeArray;
|
||||||
|
import com.lab.springbapp.domain.TypeInt;
|
||||||
|
import com.lab.springbapp.domain.TypeString;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class TypeConfiguration {
|
||||||
|
|
||||||
|
//@Bean(value = "int")
|
||||||
|
public TypeInt createCalculationInt(){
|
||||||
|
return new TypeInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Bean(value = "str")
|
||||||
|
public TypeString createCalculationStr() {
|
||||||
|
return new TypeString();
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Bean (value = "arr")
|
||||||
|
public TypeArray createCalculationArr() {
|
||||||
|
return new TypeArray();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.lab.springbapp.controller;
|
||||||
|
|
||||||
|
import com.lab.springbapp.service.TypeService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class LabController {
|
||||||
|
private final TypeService Service;
|
||||||
|
|
||||||
|
public LabController(TypeService service) {
|
||||||
|
this.Service = service;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/Sum")
|
||||||
|
public Object Sum(@RequestParam(value = "obj1", defaultValue = "null") Object obj1,
|
||||||
|
@RequestParam(value = "obj2", defaultValue = "null") Object obj2,
|
||||||
|
@RequestParam(value = "typeInp", defaultValue = "str") String typeInp) {
|
||||||
|
return Service.Sum(obj1, obj2, typeInp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/Min")
|
||||||
|
public Object Min(@RequestParam(value = "obj1", defaultValue = "null") Object obj1,
|
||||||
|
@RequestParam(value = "obj2", defaultValue = "null") Object obj2,
|
||||||
|
@RequestParam(value = "typeInp", defaultValue = "str") String typeInp) {
|
||||||
|
return Service.Min(obj1, obj2, typeInp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/Mul")
|
||||||
|
public Object Mul(@RequestParam(value = "obj1", defaultValue = "null") Object obj1,
|
||||||
|
@RequestParam(value = "obj2", defaultValue = "null") Object obj2,
|
||||||
|
@RequestParam(value = "typeInp", defaultValue = "str") String typeInp) {
|
||||||
|
return Service.Mul(obj1, obj2, typeInp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/Del")
|
||||||
|
public Object Del(@RequestParam(value = "obj1", defaultValue = "null") Object obj1,
|
||||||
|
@RequestParam(value = "obj2", defaultValue = "null") Object obj2,
|
||||||
|
@RequestParam(value = "typeInp", defaultValue = "str") String typeInp) {
|
||||||
|
return Service.Del(obj1, obj2, typeInp);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package com.lab.springbapp.domain;
|
||||||
|
|
||||||
|
public interface ITypeInterface<T> {
|
||||||
|
T Sum(T value1, T value2);
|
||||||
|
T Min(T value1, T value2);
|
||||||
|
T Mul(T value1, T value2);
|
||||||
|
T Del(T value1, T value2);
|
||||||
|
}
|
93
src/main/java/com/lab/springbapp/domain/TypeArray.java
Normal file
93
src/main/java/com/lab/springbapp/domain/TypeArray.java
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
package com.lab.springbapp.domain;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component(value = "arr")
|
||||||
|
public class TypeArray implements ITypeInterface<String[]> {
|
||||||
|
@Override
|
||||||
|
public String[] Sum(String[] value1, String[] value2) {
|
||||||
|
String [] tempArr1;
|
||||||
|
String [] tempArr2;
|
||||||
|
if (value1.length > value2.length){
|
||||||
|
tempArr1 = value1.clone();
|
||||||
|
tempArr2 = value2.clone();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tempArr1 = value2.clone();
|
||||||
|
tempArr2 = value1.clone();
|
||||||
|
}
|
||||||
|
String [] ans = new String[tempArr1.length];
|
||||||
|
for (int i = 0; i < tempArr2.length; i ++){
|
||||||
|
ans[i] = Integer.toString(Integer.parseInt(tempArr1[i]) + Integer.parseInt(tempArr2[i]));
|
||||||
|
}
|
||||||
|
for (int i = tempArr2.length; i < tempArr1.length; i++){
|
||||||
|
ans[i] = tempArr1[i];
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] Min(String[] value1, String[] value2) {
|
||||||
|
String [] tempArr1;
|
||||||
|
String [] tempArr2;
|
||||||
|
if (value1.length > value2.length){
|
||||||
|
tempArr1 = value1.clone();
|
||||||
|
tempArr2 = value2.clone();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tempArr1 = value2.clone();
|
||||||
|
tempArr2 = value1.clone();
|
||||||
|
}
|
||||||
|
String [] ans = new String[tempArr1.length];
|
||||||
|
for (int i = 0; i < tempArr2.length; i++){
|
||||||
|
ans[i] = Integer.toString(Integer.parseInt(tempArr1[i]) - Integer.parseInt(tempArr2[i]));
|
||||||
|
}
|
||||||
|
for (int i = tempArr2.length; i < tempArr1.length; i++){
|
||||||
|
ans[i] = tempArr1[i];
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] Mul(String[] value1, String[] value2) {
|
||||||
|
String [] tempArr1;
|
||||||
|
String [] tempArr2;
|
||||||
|
if (value1.length > value2.length){
|
||||||
|
tempArr1 = value1.clone();
|
||||||
|
tempArr2 = value2.clone();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tempArr1 = value2.clone();
|
||||||
|
tempArr2 = value1.clone();
|
||||||
|
}
|
||||||
|
String [] ans = new String[tempArr1.length];
|
||||||
|
for (int i = 0; i < tempArr2.length; i ++){
|
||||||
|
ans[i] = Integer.toString(Integer.parseInt(tempArr1[i]) * Integer.parseInt(tempArr2[i]));
|
||||||
|
}
|
||||||
|
for (int i = tempArr2.length; i < tempArr1.length; i++){
|
||||||
|
ans[i] = tempArr1[i];
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] Del(String[] value1, String[] value2) {
|
||||||
|
String [] tempArr1;
|
||||||
|
String [] tempArr2;
|
||||||
|
if (value1.length > value2.length){
|
||||||
|
tempArr1 = value1.clone();
|
||||||
|
tempArr2 = value2.clone();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tempArr1 = value2.clone();
|
||||||
|
tempArr2 = value1.clone();
|
||||||
|
}
|
||||||
|
String [] ans = new String[tempArr1.length];
|
||||||
|
for (int i = 0; i < tempArr2.length; i ++){
|
||||||
|
ans[i] = Integer.toString(Integer.parseInt(tempArr1[i]) / Integer.parseInt(tempArr2[i]));
|
||||||
|
}
|
||||||
|
for (int i = tempArr2.length; i < tempArr1.length; i++){
|
||||||
|
ans[i] = tempArr1[i];
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
}
|
31
src/main/java/com/lab/springbapp/domain/TypeInt.java
Normal file
31
src/main/java/com/lab/springbapp/domain/TypeInt.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package com.lab.springbapp.domain;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component(value = "int")
|
||||||
|
public class TypeInt implements ITypeInterface<Integer>{
|
||||||
|
@Override
|
||||||
|
public Integer Sum(Integer value1, Integer value2) {
|
||||||
|
return value1 + value2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer Min(Integer value1, Integer value2) {
|
||||||
|
return value1 - value2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer Mul(Integer value1, Integer value2) {
|
||||||
|
return value1 * value2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer Del(Integer value1, Integer value2) {
|
||||||
|
if (value2 == 0){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return (value1/value2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
51
src/main/java/com/lab/springbapp/domain/TypeString.java
Normal file
51
src/main/java/com/lab/springbapp/domain/TypeString.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package com.lab.springbapp.domain;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component(value = "str")
|
||||||
|
public class TypeString implements ITypeInterface<String>{
|
||||||
|
@Override
|
||||||
|
public String Sum(String value1, String value2) {
|
||||||
|
return value1 + value2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String Min(String value1, String value2) {
|
||||||
|
StringBuilder bufStr = new StringBuilder();
|
||||||
|
if (value1.equals(value2)){
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (int i = 0; i < value1.length(); i++) {
|
||||||
|
boolean check = true;
|
||||||
|
for (int k = 0; k < value2.length(); k++) {
|
||||||
|
if (value1.charAt(i) == value2.charAt(k)) {
|
||||||
|
check = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (check){
|
||||||
|
bufStr.append(value1.charAt(i));}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bufStr.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String Mul(String value1, String value2) {
|
||||||
|
int multInt = value2.length();
|
||||||
|
StringBuilder multResult = new StringBuilder();
|
||||||
|
for (int i = 0; i < multInt; i++){
|
||||||
|
multResult.append(value1);
|
||||||
|
}
|
||||||
|
return multResult.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String Del(String value1, String value2) {
|
||||||
|
if (value2.length() !=0) {
|
||||||
|
double divRes = 1.0 * value1.length() / value2.length();
|
||||||
|
return Double.toString(divRes);
|
||||||
|
}
|
||||||
|
else return "error";
|
||||||
|
}
|
||||||
|
}
|
75
src/main/java/com/lab/springbapp/service/TypeService.java
Normal file
75
src/main/java/com/lab/springbapp/service/TypeService.java
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
package com.lab.springbapp.service;
|
||||||
|
|
||||||
|
import com.lab.springbapp.domain.ITypeInterface;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TypeService {
|
||||||
|
|
||||||
|
private final ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
public TypeService(ApplicationContext applicationContext) {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Object Sum(Object value1, Object value2, String type) {
|
||||||
|
final ITypeInterface calculator = (ITypeInterface) applicationContext.getBean(type);
|
||||||
|
if(type.equals("str")){
|
||||||
|
return calculator.Sum(value1.toString(),value2.toString());
|
||||||
|
}
|
||||||
|
if(type.equals("int")) {
|
||||||
|
return calculator.Sum(Integer.parseInt(value1.toString()), Integer.parseInt(value2.toString()) );
|
||||||
|
}
|
||||||
|
if(type.equals("arr")){
|
||||||
|
return calculator.Sum(cleanToArr(value1) , cleanToArr(value2));
|
||||||
|
}
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
public Object Min(Object value1, Object value2, String type) {
|
||||||
|
final ITypeInterface calculator = (ITypeInterface) applicationContext.getBean(type);
|
||||||
|
if(type.equals("str")){
|
||||||
|
return calculator.Min(value1.toString(),value2.toString());
|
||||||
|
}
|
||||||
|
if (type.equals("int")){
|
||||||
|
return calculator.Min(Integer.parseInt(value1.toString()), Integer.parseInt(value2.toString()));
|
||||||
|
}
|
||||||
|
if(type.equals("arr")){
|
||||||
|
return calculator.Min(cleanToArr(value1) , cleanToArr(value2));
|
||||||
|
}
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
public Object Mul(Object value1, Object value2, String type) {
|
||||||
|
final ITypeInterface calculator = (ITypeInterface) applicationContext.getBean(type);
|
||||||
|
if(type.equals("str")){
|
||||||
|
return calculator.Mul(value1.toString(), value2.toString());
|
||||||
|
}
|
||||||
|
if (type.equals("int")){
|
||||||
|
return calculator.Mul(Integer.parseInt(value1.toString()), Integer.parseInt(value2.toString()));
|
||||||
|
}
|
||||||
|
if (type.equals("arr")){
|
||||||
|
return calculator.Mul(cleanToArr(value1) , cleanToArr(value2));
|
||||||
|
}
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
public Object Del(Object value1, Object value2, String type) {
|
||||||
|
final ITypeInterface calculator = (ITypeInterface) applicationContext.getBean(type);
|
||||||
|
if (type.equals("str")){
|
||||||
|
return calculator.Del(value1.toString(), value2.toString());
|
||||||
|
}
|
||||||
|
if (type.equals("int")){
|
||||||
|
return calculator.Del(Integer.parseInt(value1.toString()), Integer.parseInt(value2.toString()));
|
||||||
|
}
|
||||||
|
if(type.equals("arr")){
|
||||||
|
return calculator.Del(cleanToArr(value1) , cleanToArr(value2));
|
||||||
|
}
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] cleanToArr(Object arr){
|
||||||
|
return Arrays.stream(arr.toString().split("[\\(\\)\\,\\.\\[\\] \\!\\?\\:\\;]")).filter(e -> e.trim().length()>0).toArray(String[]::new);
|
||||||
|
}
|
||||||
|
}
|
77
src/main/java/database/model/Category.java
Normal file
77
src/main/java/database/model/Category.java
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
package database.model;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "playlist")
|
||||||
|
public class Category {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
private String categoryName;
|
||||||
|
@ManyToMany(fetch = FetchType.EAGER,mappedBy = "categories")
|
||||||
|
private List<Video> videos;
|
||||||
|
|
||||||
|
public Category(){}
|
||||||
|
|
||||||
|
public Category(String _categoryName){
|
||||||
|
categoryName = _categoryName;
|
||||||
|
}
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public String getCategoryName(){
|
||||||
|
return categoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryName(String _categoryName){
|
||||||
|
categoryName = _categoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Video> getVideos(){
|
||||||
|
return videos;
|
||||||
|
}
|
||||||
|
public void addVideo(Video video){
|
||||||
|
if(videos==null) {
|
||||||
|
videos = new ArrayList<>();
|
||||||
|
}
|
||||||
|
videos.add(video);
|
||||||
|
}
|
||||||
|
public void removeVideo(Video video){
|
||||||
|
if(video!=null)
|
||||||
|
videos.remove(video);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Category category = (Category) o;
|
||||||
|
if(!this.categoryName.equals(category.getCategoryName())){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.id != category.getId()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(id, category.id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Category{" +
|
||||||
|
"id=" + id +
|
||||||
|
", categoryName='" + categoryName + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
101
src/main/java/database/model/User.java
Normal file
101
src/main/java/database/model/User.java
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
package database.model;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "user")
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "name")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Column(name = "subscribers count")
|
||||||
|
private int subsCount;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "user", fetch = FetchType.EAGER)
|
||||||
|
private List<Video> videos;
|
||||||
|
|
||||||
|
public User(){ }
|
||||||
|
|
||||||
|
public User(String _userName, int _subsCount) {
|
||||||
|
this.userName = _userName;
|
||||||
|
this.subsCount = _subsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String _userName) {
|
||||||
|
userName = _userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSubsCount() {
|
||||||
|
return subsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubsCount(int _subsCount) {
|
||||||
|
subsCount += _subsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Video> getVideos() {
|
||||||
|
return videos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addVideo(Video video){
|
||||||
|
if (videos == null){
|
||||||
|
videos = new ArrayList<>();
|
||||||
|
}
|
||||||
|
videos.add(video);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeVideo(Video video){
|
||||||
|
if (video != null){
|
||||||
|
videos.remove(video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
User user = (User) o;
|
||||||
|
if(this.id != user.getId())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.userName.equals(user.getUserName()) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.subsCount != user.getSubsCount()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(id, user.id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "User{" +
|
||||||
|
"id=" + id +
|
||||||
|
", userName='" + userName + '\'' +
|
||||||
|
", subsCount: " + subsCount + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
142
src/main/java/database/model/Video.java
Normal file
142
src/main/java/database/model/Video.java
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
package database.model;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "video")
|
||||||
|
public class Video {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "name")
|
||||||
|
private String videoName;
|
||||||
|
|
||||||
|
@Column(name = "duration")
|
||||||
|
private Double duration;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
private User user;
|
||||||
|
|
||||||
|
@ManyToMany(fetch = FetchType.EAGER)
|
||||||
|
@JoinTable(name="videos_categories",
|
||||||
|
joinColumns = @JoinColumn(name="video_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name="category_id")
|
||||||
|
)
|
||||||
|
private List<Category> categories;
|
||||||
|
|
||||||
|
public Video(){
|
||||||
|
}
|
||||||
|
|
||||||
|
public Video(String videoName, Double duration){
|
||||||
|
this.videoName = videoName;
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId(){
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVideoName(){
|
||||||
|
return videoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getDuration(){
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideoName(String videoName){
|
||||||
|
this.videoName = videoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuration(Double duration){
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(User _user){
|
||||||
|
if(user == null){
|
||||||
|
user = _user;
|
||||||
|
user.addVideo(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Category> getCategories(){
|
||||||
|
return categories;
|
||||||
|
}
|
||||||
|
public void addCategory(Category category){
|
||||||
|
if(categories==null)
|
||||||
|
categories=new ArrayList<>();
|
||||||
|
categories.add(category);
|
||||||
|
category.addVideo(this);
|
||||||
|
}
|
||||||
|
public void removeCategory(Category category){
|
||||||
|
if(categories!=null){
|
||||||
|
categories.remove(category);
|
||||||
|
category.removeVideo(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Video video = (Video) o;
|
||||||
|
if (this.id != video.getId()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.videoName.equals(video.getVideoName())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.duration.equals(video.getDuration())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.user.getId() != video.getUser().getId() )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(categories.size() != video.getCategories().size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(categories.size() > 0){
|
||||||
|
for (Category cat:
|
||||||
|
categories) {
|
||||||
|
Boolean check = false;
|
||||||
|
for (Category catVid:
|
||||||
|
video.getCategories()) {
|
||||||
|
if(cat.equals(catVid))
|
||||||
|
check = true;
|
||||||
|
}
|
||||||
|
if(!check)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Objects.equals(id, video.id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Video{" +
|
||||||
|
"id=" + id +
|
||||||
|
", videoName='" + videoName + '\'' +
|
||||||
|
", duration='" + duration + '\'' +
|
||||||
|
", User: " + (user == null ? "[]" : user.toString()) + '\'' +
|
||||||
|
"Categories:" + (categories == null ? "[]" : categories.toString()) +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
64
src/main/java/database/service/CategoryService.java
Normal file
64
src/main/java/database/service/CategoryService.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package database.service;
|
||||||
|
|
||||||
|
import database.model.Category;
|
||||||
|
import jakarta.persistence.EntityManager;
|
||||||
|
import jakarta.persistence.PersistenceContext;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CategoryService {
|
||||||
|
@PersistenceContext
|
||||||
|
private EntityManager em;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Category addCategory(String categoryName) {
|
||||||
|
if (!StringUtils.hasText(categoryName) ) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final Category category = new Category(categoryName);
|
||||||
|
em.persist(category);
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public Category findCategory(Long id) {
|
||||||
|
final Category category = em.find(Category.class, id);
|
||||||
|
if (category == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("Category with id [%s] is not found", id));
|
||||||
|
}
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public List<Category> findAllCategories() {
|
||||||
|
return em.createQuery("select c from Category c", Category.class).getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Category updateCategory(Long id, String categoryName) {
|
||||||
|
if (!StringUtils.hasText(categoryName) ) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final Category currentCategory = findCategory(id);
|
||||||
|
currentCategory.setCategoryName(categoryName);
|
||||||
|
return em.merge(currentCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Category deleteCategory(Long id) {
|
||||||
|
final Category currentCategory = findCategory(id);
|
||||||
|
em.remove(currentCategory);
|
||||||
|
return currentCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteAllCategories() {
|
||||||
|
em.createQuery("delete from Category").executeUpdate();
|
||||||
|
}
|
||||||
|
}
|
65
src/main/java/database/service/UserService.java
Normal file
65
src/main/java/database/service/UserService.java
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package database.service;
|
||||||
|
|
||||||
|
import database.model.User;
|
||||||
|
import jakarta.persistence.EntityManager;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import jakarta.persistence.PersistenceContext;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserService {
|
||||||
|
@PersistenceContext
|
||||||
|
private EntityManager em;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public User addUser(String userName, int subsCount) {
|
||||||
|
if (!StringUtils.hasText(userName) || subsCount <0 ) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final User user = new User(userName,subsCount);
|
||||||
|
em.persist(user);
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public User findUser(Long id) {
|
||||||
|
final User user = em.find(User.class, id);
|
||||||
|
if (user == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("User with id [%s] is not found", id));
|
||||||
|
}
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public List<User> findAllUsers() {
|
||||||
|
return em.createQuery("select b from User b", User.class).getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public User updateUser(Long id, String userName, int subsCount) {
|
||||||
|
if (!StringUtils.hasText(userName) || subsCount <0) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final User currentUser = findUser(id);
|
||||||
|
currentUser.setUserName(userName);
|
||||||
|
currentUser.setSubsCount(subsCount);
|
||||||
|
return em.merge(currentUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public User deleteUser(Long id) {
|
||||||
|
final User currentUser = findUser(id);
|
||||||
|
em.remove(currentUser);
|
||||||
|
return currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteAllUsers() {
|
||||||
|
em.createQuery("delete from User").executeUpdate();
|
||||||
|
}
|
||||||
|
}
|
118
src/main/java/database/service/VideoService.java
Normal file
118
src/main/java/database/service/VideoService.java
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
package database.service;
|
||||||
|
|
||||||
|
import database.model.User;
|
||||||
|
import database.model.Video;
|
||||||
|
import database.model.Category;
|
||||||
|
import jakarta.persistence.EntityManager;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import jakarta.persistence.PersistenceContext;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class VideoService {
|
||||||
|
@PersistenceContext
|
||||||
|
private EntityManager em;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video addVideo(String videoName, double duration) throws IOException {
|
||||||
|
if (!StringUtils.hasText(videoName) || duration <= 0) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final Video video = new Video(videoName, duration);
|
||||||
|
em.persist(video);
|
||||||
|
return video;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video addUser(Long VideoId, Long UserId) {
|
||||||
|
final Video video = em.find(Video.class, VideoId);
|
||||||
|
if (video == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("Video with id [%s] is not found", VideoId));
|
||||||
|
}
|
||||||
|
|
||||||
|
final User user = em.find(User.class, UserId);
|
||||||
|
if (user == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("User with id [%s] is not found", UserId));
|
||||||
|
}
|
||||||
|
|
||||||
|
video.setUser(user);
|
||||||
|
em.merge(video);
|
||||||
|
em.merge(user);
|
||||||
|
return video;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video addCategory(Long VideoId, Long CategoryId) {
|
||||||
|
final Video video = em.find(Video.class, VideoId);
|
||||||
|
if (video == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("Video with id [%s] is not found", VideoId));
|
||||||
|
}
|
||||||
|
|
||||||
|
final Category category = em.find(Category.class, CategoryId);
|
||||||
|
if (category == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("Category with id [%s] is not found", CategoryId));
|
||||||
|
}
|
||||||
|
video.addCategory(category);
|
||||||
|
return em.merge(video);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video removeCategory(Long VideoId, Long CategoryId) {
|
||||||
|
final Video video = em.find(Video.class, VideoId);
|
||||||
|
final Category category = em.find(Category.class, CategoryId);
|
||||||
|
if (CategoryId <= 0 || category == null) {
|
||||||
|
throw new IllegalArgumentException("Category with id [%s] is not found");
|
||||||
|
}
|
||||||
|
video.removeCategory(category);
|
||||||
|
return em.merge(video);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public Video findVideo(Long id) {
|
||||||
|
final Video video = em.find(Video.class, id);
|
||||||
|
if (video == null) {
|
||||||
|
throw new EntityNotFoundException(String.format("Video with id [%s] is not found", id));
|
||||||
|
}
|
||||||
|
return video;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public List<Video> findAllVideos() {
|
||||||
|
return em.createQuery("select v from Video v", Video.class).getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video updateVideo(Long id, String videoName) {
|
||||||
|
if (!StringUtils.hasText(videoName)) {
|
||||||
|
throw new IllegalArgumentException("Not good data");
|
||||||
|
}
|
||||||
|
final Video currentVideo = findVideo(id);
|
||||||
|
currentVideo.setVideoName(videoName);
|
||||||
|
return em.merge(currentVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Video deleteVideo(Long id) {
|
||||||
|
final Video currentVideo = findVideo(id);
|
||||||
|
em.remove(currentVideo);
|
||||||
|
return currentVideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteAllVideos() {
|
||||||
|
em.createQuery("delete from Video").executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public List<Video> findVideoWithDur(double from, double to) {
|
||||||
|
return em.createQuery("select v from Video v where v.duration between :from and :to", Video.class)
|
||||||
|
.setParameter("from", from)
|
||||||
|
.setParameter("to", to)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
}
|
1
src/main/resources/application.properties
Normal file
1
src/main/resources/application.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.lab.springbapp;
|
||||||
|
|
||||||
|
import com.lab.springbapp.service.TypeService;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class SpringbappApplicationTests {
|
||||||
|
@Autowired
|
||||||
|
TypeService Service;
|
||||||
|
@Test
|
||||||
|
void testIntPlus() {
|
||||||
|
final String res = (String) Service.Sum( "100", "10", "int");
|
||||||
|
Assertions.assertEquals("110", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testIntMinus() {
|
||||||
|
final String res = (String)Service.Min( "100", "10", "int");
|
||||||
|
Assertions.assertEquals("90", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testIntMultiply() {
|
||||||
|
final String res = (String)Service.Mul( "100", "10", "int");
|
||||||
|
Assertions.assertEquals("1000", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testIntDivision() {
|
||||||
|
final String res = (String)Service.Del( "100", "10", "int");
|
||||||
|
Assertions.assertEquals("10", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testStringPlus() {
|
||||||
|
final String res = (String)Service.Sum( "abc", "dfe", "str");
|
||||||
|
Assertions.assertEquals("abcdfe", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testStringMin() {
|
||||||
|
final String res = (String)Service.Min( "abcd", "ef", "str");
|
||||||
|
Assertions.assertEquals("cd", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testStringMul() {
|
||||||
|
final String res = (String)Service.Mul( "adc", "de", "str");
|
||||||
|
Assertions.assertEquals("adcdeadcde", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testStringDiv() {
|
||||||
|
final String res = (String)Service.Del( "adcdef", "de", "str");
|
||||||
|
Assertions.assertEquals("adcf", res);
|
||||||
|
}
|
||||||
|
}
|
64
src/test/java/com/lab/springbapp/VideoTest.java
Normal file
64
src/test/java/com/lab/springbapp/VideoTest.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package com.lab.springbapp;
|
||||||
|
|
||||||
|
import database.model.Category;
|
||||||
|
import database.model.User;
|
||||||
|
import database.model.Video;
|
||||||
|
import database.service.CategoryService;
|
||||||
|
import database.service.UserService;
|
||||||
|
import database.service.VideoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
public class VideoTest {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(VideoTest.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VideoService videoService;
|
||||||
|
@Autowired
|
||||||
|
private CategoryService categoryService;
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
@Autowired
|
||||||
|
public VideoTest(VideoService videoService) {
|
||||||
|
this.videoService = videoService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testVideoFindDur() {
|
||||||
|
videoService.deleteAllVideos();
|
||||||
|
categoryService.deleteAllCategories();
|
||||||
|
userService.deleteAllUsers();
|
||||||
|
final Category cat1 = categoryService.addCategory("Music");
|
||||||
|
final User user2 = userService.addUser("newUser",10000);
|
||||||
|
final Video video1;
|
||||||
|
try {
|
||||||
|
video1 = videoService.addVideo("newVideo1",30);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
final Video video2;
|
||||||
|
try {
|
||||||
|
video2 = videoService.addVideo("newVideo2",10);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
video1.addCategory(cat1);
|
||||||
|
video2.addCategory(cat1);
|
||||||
|
video1.setUser(user2);
|
||||||
|
video2.setUser(user2);
|
||||||
|
final List<Video> videos = videoService.findVideoWithDur(5,15);
|
||||||
|
log.info("testBloggerCount" + videos.size());
|
||||||
|
Assertions.assertEquals(videos.size(),1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user