transformed to gradle multi project
This commit is contained in:
parent
b8dc6a24df
commit
a7a256947a
@ -1 +0,0 @@
|
||||
export {}
|
||||
@ -1,88 +0,0 @@
|
||||
import '@vaadin/common-frontend/ConnectionIndicator.js';
|
||||
import '@vaadin/polymer-legacy-adapter/style-modules.js';
|
||||
import '@vaadin/accordion/src/vaadin-accordion.js';
|
||||
import '@vaadin/details/src/vaadin-details.js';
|
||||
import '@vaadin/accordion/src/vaadin-accordion-panel.js';
|
||||
import '@vaadin/app-layout/src/vaadin-app-layout.js';
|
||||
import '@vaadin/button/src/vaadin-button.js';
|
||||
import 'Frontend/generated/jar-resources/buttonFunctions.js';
|
||||
import '@vaadin/app-layout/src/vaadin-drawer-toggle.js';
|
||||
import '@vaadin/avatar/src/vaadin-avatar.js';
|
||||
import '@vaadin/avatar-group/src/vaadin-avatar-group.js';
|
||||
import '@vaadin/checkbox/src/vaadin-checkbox.js';
|
||||
import '@vaadin/checkbox-group/src/vaadin-checkbox-group.js';
|
||||
import '@vaadin/combo-box/src/vaadin-combo-box.js';
|
||||
import 'Frontend/generated/jar-resources/flow-component-renderer.js';
|
||||
import 'Frontend/generated/jar-resources/comboBoxConnector.js';
|
||||
import '@vaadin/multi-select-combo-box/src/vaadin-multi-select-combo-box.js';
|
||||
import '@vaadin/confirm-dialog/src/vaadin-confirm-dialog.js';
|
||||
import '@vaadin/context-menu/src/vaadin-context-menu.js';
|
||||
import 'Frontend/generated/jar-resources/contextMenuConnector.js';
|
||||
import 'Frontend/generated/jar-resources/contextMenuTargetConnector.js';
|
||||
import '@vaadin/custom-field/src/vaadin-custom-field.js';
|
||||
import '@vaadin/date-picker/src/vaadin-date-picker.js';
|
||||
import 'Frontend/generated/jar-resources/datepickerConnector.js';
|
||||
import '@vaadin/date-time-picker/src/vaadin-date-time-picker.js';
|
||||
import '@vaadin/time-picker/src/vaadin-time-picker.js';
|
||||
import 'Frontend/generated/jar-resources/vaadin-time-picker/timepickerConnector.js';
|
||||
import '@vaadin/dialog/src/vaadin-dialog.js';
|
||||
import 'Frontend/generated/jar-resources/dndConnector.js';
|
||||
import '@vaadin/field-highlighter/src/vaadin-field-highlighter.js';
|
||||
import '@vaadin/form-layout/src/vaadin-form-layout.js';
|
||||
import '@vaadin/form-layout/src/vaadin-form-item.js';
|
||||
import '@vaadin/grid/src/vaadin-grid-column-group.js';
|
||||
import '@vaadin/grid/src/vaadin-grid.js';
|
||||
import '@vaadin/grid/src/vaadin-grid-column.js';
|
||||
import '@vaadin/grid/src/vaadin-grid-sorter.js';
|
||||
import 'Frontend/generated/jar-resources/gridConnector.js';
|
||||
import '@vaadin/tooltip/src/vaadin-tooltip.js';
|
||||
import 'Frontend/generated/jar-resources/vaadin-grid-flow-selection-column.js';
|
||||
import '@vaadin/icon/src/vaadin-icon.js';
|
||||
import '@vaadin/icons/vaadin-iconset.js';
|
||||
import '@vaadin/list-box/src/vaadin-list-box.js';
|
||||
import '@vaadin/item/src/vaadin-item.js';
|
||||
import '@vaadin/login/src/vaadin-login-form.js';
|
||||
import '@vaadin/login/src/vaadin-login-overlay.js';
|
||||
import 'Frontend/generated/jar-resources/menubarConnector.js';
|
||||
import '@vaadin/menu-bar/src/vaadin-menu-bar.js';
|
||||
import '@vaadin/message-input/src/vaadin-message-input.js';
|
||||
import 'Frontend/generated/jar-resources/messageListConnector.js';
|
||||
import '@vaadin/message-list/src/vaadin-message-list.js';
|
||||
import '@vaadin/notification/src/vaadin-notification.js';
|
||||
import '@vaadin/horizontal-layout/src/vaadin-horizontal-layout.js';
|
||||
import '@vaadin/scroller/src/vaadin-scroller.js';
|
||||
import '@vaadin/vertical-layout/src/vaadin-vertical-layout.js';
|
||||
import '@vaadin/progress-bar/src/vaadin-progress-bar.js';
|
||||
import '@vaadin/radio-group/src/vaadin-radio-button.js';
|
||||
import '@vaadin/radio-group/src/vaadin-radio-group.js';
|
||||
import '@vaadin/select/src/vaadin-select.js';
|
||||
import 'Frontend/generated/jar-resources/selectConnector.js';
|
||||
import 'Frontend/generated/jar-resources/tooltip.ts';
|
||||
import '@vaadin/side-nav/src/vaadin-side-nav.js';
|
||||
import '@vaadin/side-nav/src/vaadin-side-nav-item.js';
|
||||
import '@vaadin/split-layout/src/vaadin-split-layout.js';
|
||||
import '@vaadin/tabs/src/vaadin-tab.js';
|
||||
import '@vaadin/tabsheet/src/vaadin-tabsheet.js';
|
||||
import '@vaadin/tabs/src/vaadin-tabs.js';
|
||||
import 'Frontend/generated/jar-resources/vaadin-big-decimal-field.js';
|
||||
import '@vaadin/email-field/src/vaadin-email-field.js';
|
||||
import '@vaadin/integer-field/src/vaadin-integer-field.js';
|
||||
import '@vaadin/number-field/src/vaadin-number-field.js';
|
||||
import '@vaadin/password-field/src/vaadin-password-field.js';
|
||||
import '@vaadin/text-area/src/vaadin-text-area.js';
|
||||
import '@vaadin/text-field/src/vaadin-text-field.js';
|
||||
import 'Frontend/generated/jar-resources/lit-renderer.ts';
|
||||
import '@vaadin/grid/src/vaadin-grid-tree-toggle.js';
|
||||
import '@vaadin/upload/src/vaadin-upload.js';
|
||||
import '@vaadin/virtual-list/src/vaadin-virtual-list.js';
|
||||
import 'Frontend/generated/jar-resources/virtualListConnector.js';
|
||||
import '@vaadin/vaadin-lumo-styles/color-global.js';
|
||||
import '@vaadin/vaadin-lumo-styles/typography-global.js';
|
||||
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
||||
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
||||
import '@vaadin/vaadin-lumo-styles/style.js';
|
||||
import '@vaadin/vaadin-lumo-styles/vaadin-iconset.js';
|
||||
const loadOnDemand = (key) => { return Promise.resolve(0); }
|
||||
window.Vaadin = window.Vaadin || {};
|
||||
window.Vaadin.Flow = window.Vaadin.Flow || {};
|
||||
window.Vaadin.Flow.loadOnDemand = loadOnDemand;
|
||||
@ -1,5 +0,0 @@
|
||||
import './vaadin-featureflags.js';
|
||||
|
||||
import './index';
|
||||
|
||||
import 'Frontend/generated/jar-resources/vaadin-dev-tools/vaadin-dev-tools.js';
|
||||
@ -1 +0,0 @@
|
||||
rootProject.name = 'LoadBalancerWeb'
|
||||
@ -1,5 +0,0 @@
|
||||
package ru.dragonestia.loadbalancer.web.repository.impl.response;
|
||||
|
||||
import ru.dragonestia.loadbalancer.web.model.Bucket;
|
||||
|
||||
public record BucketInfoResponse(Bucket bucket) {}
|
||||
@ -1,7 +0,0 @@
|
||||
package ru.dragonestia.loadbalancer.web.repository.impl.response;
|
||||
|
||||
import ru.dragonestia.loadbalancer.web.model.dto.BucketDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BucketListResponse(String node, List<BucketDTO> buckets) {}
|
||||
@ -1,7 +0,0 @@
|
||||
package ru.dragonestia.loadbalancer.web.repository.impl.response;
|
||||
|
||||
import ru.dragonestia.loadbalancer.web.model.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BucketUserListResponse(int slots, int usedSlots, List<User> users) {}
|
||||
@ -1,5 +0,0 @@
|
||||
package ru.dragonestia.loadbalancer.web.repository.impl.response;
|
||||
|
||||
import ru.dragonestia.loadbalancer.web.model.Node;
|
||||
|
||||
public record NodeDetailsResponse(Node node) {}
|
||||
@ -1,7 +0,0 @@
|
||||
package ru.dragonestia.loadbalancer.web.repository.impl.response;
|
||||
|
||||
import ru.dragonestia.loadbalancer.web.model.Node;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record NodeListResponse(List<Node> nodes) {}
|
||||
23
app/build.gradle
Normal file
23
app/build.gradle
Normal file
@ -0,0 +1,23 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '3.1.5'
|
||||
id 'io.spring.dependency-management' version '1.1.3'
|
||||
}
|
||||
|
||||
configurations {
|
||||
compileOnly {
|
||||
extendsFrom annotationProcessor
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
}
|
||||
|
||||
tasks.named('bootBuildImage') {
|
||||
builder = 'paketobuildpacks/builder-jammy-base:latest'
|
||||
}
|
||||
0
LoadBalancerWeb/gradlew → app/gradlew
vendored
Executable file → Normal file
0
LoadBalancerWeb/gradlew → app/gradlew
vendored
Executable file → Normal file
184
LoadBalancerWeb/gradlew.bat → app/gradlew.bat
vendored
184
LoadBalancerWeb/gradlew.bat → app/gradlew.bat
vendored
@ -1,92 +1,92 @@
|
||||
@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=.
|
||||
@rem This is normally unused
|
||||
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
|
||||
@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=.
|
||||
@rem This is normally unused
|
||||
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
|
||||
@ -6,6 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class LoadBalancerApplication {
|
||||
|
||||
public record Test(String text) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(LoadBalancerApplication.class, args);
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package ru.dragonestia.loadbalancer.service;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
import ru.dragonestia.loadbalancer.model.Bucket;
|
||||
import ru.dragonestia.loadbalancer.model.Node;
|
||||
import ru.dragonestia.loadbalancer.model.type.LoadBalancingMethod;
|
||||
import ru.dragonestia.loadbalancer.model.type.SlotLimit;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class BucketServiceTest {
|
||||
|
||||
private BucketService bucketService;
|
||||
private HashMap<String, Bucket> bucketMap;
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
bucketMap = new HashMap<>();
|
||||
bucketService = Mockito.mock(BucketService.class);
|
||||
Mockito.doAnswer(invocation -> {
|
||||
var bucket = invocation.getArgument(0, Bucket.class);
|
||||
|
||||
return null;
|
||||
}).when(bucketService).createBucket(Mockito.any(Bucket.class));
|
||||
}
|
||||
|
||||
Node createNode() {
|
||||
return new Node("test-node", LoadBalancingMethod.ROUND_ROBIN);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
var node = createNode();
|
||||
|
||||
bucketService.createBucket(Bucket.create("test-bucket", node, SlotLimit.unlimited(), ""));
|
||||
}
|
||||
}
|
||||
43
build.gradle
43
build.gradle
@ -1,39 +1,14 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.1.5'
|
||||
id 'io.spring.dependency-management' version '1.1.3'
|
||||
}
|
||||
subprojects {
|
||||
apply plugin: 'java'
|
||||
|
||||
group = 'ru.dragonestia'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
group = 'ru.dragonestia'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
|
||||
java {
|
||||
sourceCompatibility = '17'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
configurations {
|
||||
compileOnly {
|
||||
extendsFrom annotationProcessor
|
||||
java {
|
||||
sourceCompatibility = '17'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
}
|
||||
|
||||
tasks.named('bootBuildImage') {
|
||||
builder = 'paketobuildpacks/builder-jammy-base:latest'
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.1.5'
|
||||
id 'io.spring.dependency-management' version '1.1.3'
|
||||
id 'com.vaadin' version '24.2.2'
|
||||
}
|
||||
|
||||
group = 'ru.dragonestia'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
|
||||
java {
|
||||
sourceCompatibility = '17'
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user