diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8af972c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +/gradlew text eol=lf +*.bat text eol=crlf +*.jar binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2065bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +HELP.md +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..91155c7 --- /dev/null +++ b/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '4.0.1' + id 'io.spring.dependency-management' version '1.1.7' +} + +group = 'org.example' +version = '0.0.1-SNAPSHOT' +description = 'DTRAMtest' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-jersey' + testImplementation 'org.springframework.boot:spring-boot-starter-jersey-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +tasks.named('test') { + useJUnitPlatform() +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f8e1ee3 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..23449a2 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..adff685 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# 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/HEAD/platforms/jvm/plugins-application/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 + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# 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 + + + +# 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 + if ! command -v java >/dev/null 2>&1 + then + 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 +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + 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" ) + + 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 + + +# 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"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# 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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..c4bdd3a --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@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 +@rem SPDX-License-Identifier: Apache-2.0 +@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. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +: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 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..fe3bf15 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'tampopo-server-dtram' diff --git a/src/main/java/org/example/tampoposerverdtram/JerseyConfig.java b/src/main/java/org/example/tampoposerverdtram/JerseyConfig.java new file mode 100644 index 0000000..32e53e1 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/JerseyConfig.java @@ -0,0 +1,12 @@ +package org.example.tampoposerverdtram; + +import org.glassfish.jersey.server.ResourceConfig; +import org.springframework.stereotype.Component; + +@Component +public class JerseyConfig extends ResourceConfig { + + public JerseyConfig() { + packages("com.example.dtramtest.resources"); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/TampopoServerDtramApplication.java b/src/main/java/org/example/tampoposerverdtram/TampopoServerDtramApplication.java new file mode 100644 index 0000000..962c871 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/TampopoServerDtramApplication.java @@ -0,0 +1,13 @@ +package org.example.tampoposerverdtram; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class TampopoServerDtramApplication { + + public static void main(String[] args) { + SpringApplication.run(TampopoServerDtramApplication.class, args); + } + +} diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Activities.java b/src/main/java/org/example/tampoposerverdtram/resources/Activities.java new file mode 100644 index 0000000..a819d62 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Activities.java @@ -0,0 +1,16 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; + +public class Activities { + private List value = new ArrayList<>(); + public List getValue() { + return new ArrayList<>(this.value); + } + public Activity getActivity(int activityId) { + return this.value.get(activityId); + } + public void postActivity(String userId, String updatedTime, String text) { + this.value.add(new Activity(updatedTime, user)); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Activity.java b/src/main/java/org/example/tampoposerverdtram/resources/Activity.java new file mode 100644 index 0000000..8182e4f --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Activity.java @@ -0,0 +1,20 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; + +public class Activity { + private User user; + private String updatedTime; + public Map getValue() { + Map temp_nil10 = new HashMap<>(); + temp_nil10.put("updatedTime",this.getUpdatedTime()); + return temp_nil10; + } + public String getUpdatedTime() { + return this.updatedTime; + } + public Activity(String updatedTime, User user) { + this.updatedTime = updatedTime; + this.user = user; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/ChatReqId.java b/src/main/java/org/example/tampoposerverdtram/resources/ChatReqId.java new file mode 100644 index 0000000..d4d8454 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/ChatReqId.java @@ -0,0 +1,35 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/chatReqId") +@Component +public class ChatReqId { + private String value = "0"; + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getValue() { + return new String(this.value); + } + @POST + public void updateFromChatRequests(@FormParam("chatRequests") String chatRequests_json) throws JsonProcessingException { + Map> chatRequests = new HashMap<>(); + { + Map>i = new ObjectMapper().readValue(chatRequests_json, HashMap.class); + chatRequests = i; + } + String temp_if32; + if (chatRequests.containsKey(this.value)) { + temp_if32 = (this.value+"1"); + } else { + temp_if32 = this.value; + } + this.value = temp_if32; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/ChatRequests.java b/src/main/java/org/example/tampoposerverdtram/resources/ChatRequests.java new file mode 100644 index 0000000..f53cf22 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/ChatRequests.java @@ -0,0 +1,64 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/chatRequests") +@Component +public class ChatRequests { + private Map> value = new HashMap<>(); + private Client client = ClientBuilder.newClient(); + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map> getValue() { + return new HashMap<>(this.value); + } + @DELETE + public void deleteChatRequest(@FormParam("id") String id) throws JsonProcessingException { + Map> temp_if23; + if (this.value.containsKey(id)) { + this.value.remove(id); + temp_if23 = this.value; + } else { + temp_if23 = this.value; + } + this.value = temp_if23; + Form form = new Form(); + form.param("chatRequests", new ObjectMapper().writeValueAsString(this.value)); + Entity
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + String result = client.target("http://localhost:8080").path("/chatReqId").request().post(entity, String.class); + } + @POST + public void postChatRequest(@FormParam("receiverId") String receiverId, @FormParam("senderId") String senderId) throws JsonProcessingException { + Map> users_json = client.target("http://localhost:8080").path("/users").request().get(HashMap.class); + Map> users = new HashMap<>(); + users = users_json; + String chatReqId = client.target("http://localhost:8080").path("/chatReqId").request().get(String.class); + Map> temp_if25; + if (senderId.equals(receiverId)) { + temp_if25 = this.value; + } else { + Map> temp_if24; + if ((users.containsKey(senderId)&&users.containsKey(receiverId))) { + Map temp_json0 = new HashMap<>(); + temp_json0.put("senderId", senderId); + temp_json0.put("receiverId", receiverId); + this.value.put(chatReqId,temp_json0); + temp_if24 = this.value; + } else { + temp_if24 = this.value; + } + temp_if25 = temp_if24; + } + this.value = temp_if25; + Form form = new Form(); + form.param("chatRequests", new ObjectMapper().writeValueAsString(this.value)); + Entity entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + String result = client.target("http://localhost:8080").path("/chatReqId").request().post(entity, String.class); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java b/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java new file mode 100644 index 0000000..420c607 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java @@ -0,0 +1,83 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/chatRooms") +@Component +public class ChatRooms { + private Map> value = new HashMap<>(); + private Client client = ClientBuilder.newClient(); + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map> getValue() { + return new HashMap<>(this.value); + } + public Map getChatRoom(String chatRoomId) { + return this.value.get(chatRoomId); + } + @Path("/{chatRoomId}") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getChatRoomValue(@PathParam("chatRoomId") String chatRoomId) { + return getChatRoom(chatRoomId); + } + public String getChatRoom(String chatRoomId, String userId) { + return this.value.get(chatRoomId).get(userId); + } + @Path("/{chatRoomId}/{userId}") + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getChatRoomValue(@PathParam("chatRoomId") String chatRoomId, @PathParam("userId") String userId) { + return getChatRoom(chatRoomId,userId); + } + @Path("/{userId}/{chatRoomId}") + @PUT + public void addChatRoomMessage(@PathParam("userId") String userId, @PathParam("chatRoomId") String chatRoomId, @FormParam("message") String message) { + this.value.put(chatRoomId,message); + } + @POST + public void postChatRoom(@FormParam("user1Id") String user1Id, @FormParam("user0Id") String user0Id) throws JsonProcessingException { + String roomId = client.target("http://localhost:8080").path("/roomId").request().get(String.class); + Map> users_json = client.target("http://localhost:8080").path("/users").request().get(HashMap.class); + Map> users = new HashMap<>(); + users = users_json; + Map temp_nil17 = new HashMap(); + temp_nil17.put(user0Id,null); + temp_nil17.put(user1Id,null); + this.value.put(roomId,temp_nil17); + Form form = new Form(); + form.param("chatRooms", new ObjectMapper().writeValueAsString(this.value)); + Entity entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + String result = client.target("http://localhost:8080").path("/roomId").request().post(entity, String.class); + } + @POST + public void deleteChatRoomMember(@FormParam("userId") String userId, @FormParam("chatRoomId") String chatRoomId) throws JsonProcessingException { + Map> temp_if34; + if (this.value.get(chatRoomId).containsKey(userId)) { + Map> temp_if33; + if ((this.value.get(chatRoomId).size()>1)) { + this.value.remove(chatRoomId); + this.value.get(chatRoomId).remove(userId); + this.value.put(chatRoomId,this.value.get(chatRoomId)); + temp_if33 = this.value; + } else { + this.value.remove(chatRoomId); + temp_if33 = this.value; + } + temp_if34 = temp_if33; + } else { + temp_if34 = this.value; + } + this.value = temp_if34; + Form form = new Form(); + form.param("chatRooms", new ObjectMapper().writeValueAsString(this.value)); + Entity entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + String result = client.target("http://localhost:8080").path("/roomId").request().post(entity, String.class); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/DeletedFriendPair.java b/src/main/java/org/example/tampoposerverdtram/resources/DeletedFriendPair.java new file mode 100644 index 0000000..8a53bce --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/DeletedFriendPair.java @@ -0,0 +1,47 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/deletedFriendPair") +@Component +public class DeletedFriendPair { + private Map value = new HashMap<>(); + private Client client = ClientBuilder.newClient(); + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getValue() { + return new HashMap<>(this.value); + } + @PUT + public void deleteFriend(@FormParam("id") String id) throws JsonProcessingException { + String user0Id = client.target("http://localhost:8080").path("/friends/pairs/" + id + "/user0Id").request().get(String.class); + String user1Id = client.target("http://localhost:8080").path("/friends/pairs/" + id + "/user1Id").request().get(String.class); + Map temp_json0 = new HashMap<>(); + temp_json0.put("pairId", id); + temp_json0.put("user0Id", user0Id); + temp_json0.put("user1Id", user1Id); + this.value = temp_json0; + Form form = new Form(); + form.param("deletedFriendPair", this.value.toString()); + Entity entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + String result = client.target("http://localhost:8080").path("/users/"+deletePair+"/friends").request().post(entity, String.class); + form = new Form(); + form.param("deletedFriendPair", this.value.toString()); + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + result = client.target("http://localhost:8080").path("/users/"+deletePair+"/friends").request().post(entity, String.class); + form = new Form(); + form.param("deletedFriendPair", this.value.toString()); + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + result = client.target("http://localhost:8080").path("/friends").request().post(entity, String.class); + form = new Form(); + form.param("deletedFriendPair", this.value.toString()); + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); + result = client.target("http://localhost:8080").path("/friends/pairs").request().post(entity, String.class); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/FriendRequests.java b/src/main/java/org/example/tampoposerverdtram/resources/FriendRequests.java new file mode 100644 index 0000000..37d8e90 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/FriendRequests.java @@ -0,0 +1,55 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/friendRequests") +@Component +public class FriendRequests { + private List> value = new ArrayList<>(); + private Client client = ClientBuilder.newClient(); + @Produces(MediaType.APPLICATION_JSON) + @GET + public List> getValue() { + return new ArrayList<>(this.value); + } + @DELETE + public void deleteFriendRequest(@FormParam("friendRequestId") int friendRequestId) { + List> temp_if35; + if ((friendRequestId> users_json = client.target("http://localhost:8080").path("/users").request().get(HashMap.class); + Map> users = new HashMap<>(); + users = users_json; + List> temp_if37; + if (senderId.equals(receiverId)) { + temp_if37 = this.value; + } else { + List> temp_if36; + if ((users.containsKey(senderId)&&users.containsKey(receiverId))) { + Map temp_json0 = new HashMap<>(); + temp_json0.put("senderId", senderId); + temp_json0.put("receiverId", receiverId); + this.value.add(temp_json0); + temp_if36 = this.value; + } else { + temp_if36 = this.value; + } + temp_if37 = temp_if36; + } + this.value = temp_if37; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Friends.java b/src/main/java/org/example/tampoposerverdtram/resources/Friends.java new file mode 100644 index 0000000..a338451 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Friends.java @@ -0,0 +1,125 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/friends") +@Component +public class Friends { + private Pairs pairs = new Pairs(); + private Client client = ClientBuilder.newClient(); + private Map> users; + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getValue() { + Map temp_nil9 = new HashMap<>(); + temp_nil9.put("users",this.getUsers()); + temp_nil9.put("pairs",this.pairs.getValue()); + return temp_nil9; + } + public Pairs getPairs() { + return this.pairs; + } + @Path("/pairs") + @DELETE + public void updateFromDeletedFriendPair(@FormParam("deletedFriendPair") Map deletedFriendPair) { + getPairs().updateFromDeletedFriendPair(deletedFriendPair); + } + @Path("/pairs") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getPairsValue() { + return getPairs().getValue(); + } + @Path("/pairs") + @POST + public void postFriend(@FormParam("user1Id") String user1Id, @FormParam("user0Id") String user0Id) { + getPairs().postFriend(user1Id, userDB, id, user0Id); + } + @Path("/pairs/{pid}") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getPairValue(@PathParam("pid") String pid) { + return getPairs().getPair(pid).getValue(); + } + public void updateUsersFromDeletedFriendPair(Map deletedFriendPair) { + Map> temp_if26; + if ((this.users.get(deletedFriendPair.get("user0Id")).containsKey(deletedFriendPair.get("pairId"))&&this.users.get(deletePair.get("user1Id")).containsKey(deletedFriendPair.get("pairId")))) { + this.users.remove(deletedFriendPair.get("user0Id")); + this.users.get(deletedFriendPair.get("user0Id")).remove(deletedFriendPair.get("pairId")); + this.users.put(deletedFriendPair.get("user0Id"),this.users.get(deletedFriendPair.get("user0Id"))); + this.users.remove(deletePair.get("user1Id")); + this.users.get(deletePair.get("user1Id")).remove(deletedFriendPair.get("pairId")); + this.users.put(deletePair.get("user1Id"),this.users.get(deletePair.get("user1Id"))); + temp_if26 = this.users; + } else { + temp_if26 = this.users; + }this.users = temp_if26; + } + @Path("/users") + @POST + public void updateUsersFromDeletedFriendPair(@FormParam("deletedFriendPair") Map deletedFriendPair) { + this.updateUsersFromDeletedFriendPair(deletedFriendPair); + } + public void updateUsersFromPair(String pid, Map pair) { + Map> temp_if29; + if ((this.users.containsKey(pair.get("user0Id"))&&this.users.containsKey(pair.get("user1Id")))) { + this.users.remove(pair.get("user0Id")); + this.users.get(pair.get("user0Id")).put(pid,pair.get("user1Id")); + this.users.put(pair.get("user0Id"),this.users.get(pair.get("user0Id"))); + this.users.remove(pair.get("user1Id")); + this.users.get(pair.get("user1Id")).put(pid,pair.get("user0Id")); + this.users.put(pair.get("user1Id"),this.users.get(pair.get("user1Id"))); + temp_if29 = this.users; + } else { + Map> temp_if28; + if (this.users.containsKey(pair.get("user0Id"))) { + this.users.remove(pair.get("user0Id")); + this.users.get(pair.get("user0Id")).put(pid,pair.get("user1Id")); + this.users.put(pair.get("user0Id"),this.users.get(pair.get("user0Id"))); + Map temp_nil13 = new HashMap(); + temp_nil13.put(pid,pair.get("user0Id")); + this.users.put(pair.get("user1Id"),temp_nil13); + temp_if28 = this.users; + } else { + Map> temp_if27; + if (this.users.containsKey(pair.get("user1Id"))) { + Map temp_nil14 = new HashMap(); + temp_nil14.put(pid,pair.get("user1Id")); + this.users.put(pair.get("user0Id"),temp_nil14); + this.users.remove(pair.get("user1Id")); + this.users.get(pair.get("user1Id")).put(pid,pair.get("user0Id")); + this.users.put(pair.get("user1Id"),this.users.get(pair.get("user1Id"))); + temp_if27 = this.users; + } else { + Map temp_nil15 = new HashMap(); + temp_nil15.put(pid,pair.get("user1Id")); + this.users.put(pair.get("user0Id"),temp_nil15); + Map temp_nil16 = new HashMap(); + temp_nil16.put(pid,pair.get("user0Id")); + this.users.put(pair.get("user1Id"),temp_nil16); + temp_if27 = this.users; + } + temp_if28 = temp_if27; + } + temp_if29 = temp_if28; + }this.users = temp_if29; + } + public Map> getUsers() { + return this.users; + } + @Path("/users") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map> getUsersValue() { + return getUsers(); + } + public Friends(Map> users) { + this.users = users; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Pair.java b/src/main/java/org/example/tampoposerverdtram/resources/Pair.java new file mode 100644 index 0000000..eaafdc1 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Pair.java @@ -0,0 +1,16 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; + +public class Pair { + private Friends friends; + public Map getValue() { + Map temp_nil11 = new HashMap<>(); + temp_nil11.put("user1Id",this.getUser1Id()); + temp_nil11.put("user0Id",this.getUser0Id()); + return temp_nil11; + } + public Pair(Friends friends) { + this.friends = friends; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/PairId.java b/src/main/java/org/example/tampoposerverdtram/resources/PairId.java new file mode 100644 index 0000000..740a238 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/PairId.java @@ -0,0 +1,24 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/pairId") +@Component +public class PairId { + private String value = "0"; + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getValue() { + return new String(this.value); + } + @POST + public void updateFromPair(@FormParam("pid") String pid, @FormParam("pair") Map pair) { + this.value = (this.value+"1"); + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Pairs.java b/src/main/java/org/example/tampoposerverdtram/resources/Pairs.java new file mode 100644 index 0000000..14f7d45 --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Pairs.java @@ -0,0 +1,44 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; + +public class Pairs { + private Map value = new HashMap<>(); + private Client client = ClientBuilder.newClient(); + public Map getValue() { + return new HashMap<>(this.value); + } + public Pair getPair(String pid) { + return this.value.get(pid); + } + public void updateFromDeletedFriendPair(Map deletedFriendPair) { + Map temp_if39; + if (this.value.containsKey(deletedFriendPair.get("pairId"))) { + this.value.remove(deletedFriendPair.get("pairId")); + temp_if39 = this.value; + } else { + temp_if39 = this.value; + } + this.value = temp_if39; + } + public void postFriend(String user1Id, Map> users, String pairId, String user0Id) { + String pairId = client.target("http://localhost:8080").path("/pairId").request().get(String.class); + Map> users_json = client.target("http://localhost:8080").path("/users").request().get(HashMap.class); + Map> users = new HashMap<>(); + users = users_json; + Map temp_if42; + if (user0Id.equals(user1Id)) { + temp_if42 = this.value; + } else { + Map temp_if41; + if ((users.containsKey(user0Id)&&users.containsKey(user1Id))) { + this.value.put(pairId,new Pair(friends)); + temp_if41 = this.value; + } else { + temp_if41 = this.value; + } + temp_if42 = temp_if41; + } + this.value = temp_if42; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/RoomId.java b/src/main/java/org/example/tampoposerverdtram/resources/RoomId.java new file mode 100644 index 0000000..46141de --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/RoomId.java @@ -0,0 +1,35 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/roomId") +@Component +public class RoomId { + private String value = "0"; + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getValue() { + return new String(this.value); + } + @POST + public void updateFromChatRooms(@FormParam("chatRooms") String chatRooms_json) throws JsonProcessingException { + Map> chatRooms = new HashMap<>(); + { + Map>i = new ObjectMapper().readValue(chatRooms_json, HashMap.class); + chatRooms = i; + } + String temp_if22; + if (chatRooms.containsKey(this.value)) { + temp_if22 = (this.value+"1"); + } else { + temp_if22 = this.value; + } + this.value = temp_if22; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/User.java b/src/main/java/org/example/tampoposerverdtram/resources/User.java new file mode 100644 index 0000000..cb468de --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/User.java @@ -0,0 +1,106 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; + +public class User { + private Activities activities = new Activities(); + private String lastUpdatedTime; + private String name; + private String email; + private Map friends; + public Map getValue() { + Map temp_nil12 = new HashMap<>(); + temp_nil12.put("friends",this.getFriends()); + temp_nil12.put("name",this.getName()); + temp_nil12.put("email",this.getEmail()); + temp_nil12.put("activities",this.activities.getValue()); + temp_nil12.put("lastUpdatedTime",this.getLastUpdatedTime()); + return temp_nil12; + } + public Activities getActivities() { + return this.activities; + } + public void updateLastUpdatedTimeFromUpdatedTime(String self, String userId, int activityId, String updatedTime) { + this.lastUpdatedTime = updatedTime; + } + public String getLastUpdatedTime() { + return this.lastUpdatedTime; + } + public String getName() { + return this.name; + } + public void updateName(String userId, String name) { + this.name = name; + } + public String getEmail() { + return this.email; + } + public void updateEmail(String userId, String email) { + this.email = email; + } + public void updateFriendsFromDeletedFriendPair(String self, Map deletedFriendPair) { + if (self.equals(deletePair.get("user1Id"))) { + Map temp_if31; + if (this.friends.containsKey(deletedFriendPair.get("pairId"))) { + this.friends.remove(deletedFriendPair.get("pairId")); + temp_if31 = this.friends; + } else { + temp_if31 = this.friends; + }this.friends = temp_if31; + } + if (self.equals(deletePair.get("user1Id"))) { + Map temp_if30; + if (this.friends.containsKey(deletedFriendPair.get("pairId"))) { + this.friends.remove(deletedFriendPair.get("pairId")); + temp_if30 = this.friends; + } else { + temp_if30 = this.friends; + }this.friends = temp_if30; + } + } + public void updateFriendsFromDeletedFriendPair(String self, Map deletedFriendPair) { + if (self.equals(deletePair.get("user1Id"))) { + Map temp_if31; + if (this.friends.containsKey(deletedFriendPair.get("pairId"))) { + this.friends.remove(deletedFriendPair.get("pairId")); + temp_if31 = this.friends; + } else { + temp_if31 = this.friends; + }this.friends = temp_if31; + } + if (self.equals(deletePair.get("user1Id"))) { + Map temp_if30; + if (this.friends.containsKey(deletedFriendPair.get("pairId"))) { + this.friends.remove(deletedFriendPair.get("pairId")); + temp_if30 = this.friends; + } else { + temp_if30 = this.friends; + }this.friends = temp_if30; + } + } + public void updateFriendsFromPair(String self, String pid, Map pair) { + if (self.equals(pair.get("user1Id"))) { + this.friends.put(pid,null); + } + if (self.equals(pair.get("user1Id"))) { + this.friends.put(pid,null); + } + } + public void updateFriendsFromPair(String self, String pid, Map pair) { + if (self.equals(pair.get("user1Id"))) { + this.friends.put(pid,null); + } + if (self.equals(pair.get("user1Id"))) { + this.friends.put(pid,null); + } + } + public Map getFriends() { + return this.friends; + } + public User(String name, String lastUpdatedTime, String email, Map friends) { + this.name = name; + this.lastUpdatedTime = lastUpdatedTime; + this.email = email; + this.friends = friends; + } +} \ No newline at end of file diff --git a/src/main/java/org/example/tampoposerverdtram/resources/Users.java b/src/main/java/org/example/tampoposerverdtram/resources/Users.java new file mode 100644 index 0000000..7ee7e4c --- /dev/null +++ b/src/main/java/org/example/tampoposerverdtram/resources/Users.java @@ -0,0 +1,128 @@ +package org.example.tampoposerverdtram.resources; + +import java.util.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.client.*; +import jakarta.ws.rs.core.*; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +@Path("/users") +@Component +public class Users { + private Map value = new HashMap<>(); + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getValue() { + return new HashMap<>(this.value); + } + public User getUser(String userId) { + return this.value.get(userId); + } + @POST + public void createUser(@FormParam("userId") String userId) { + Map temp_if38; + if (this.value.containsKey(userId)) { + temp_if38 = this.value; + } else { + this.value.put(userId,new User(null, null, null, new HashMap<>())); + temp_if38 = this.value; + } + this.value = temp_if38; + } + @DELETE + public void deleteUser(@FormParam("userId") String userId) { + Map temp_if40; + if (this.value.containsKey(userId)) { + this.value.remove(userId); + temp_if40 = this.value; + } else { + temp_if40 = this.value; + } + this.value = temp_if40; + } + @Path("/{userId}/activities/{activityId}") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getActivityValue(@PathParam("userId") String userId, @PathParam("activityId") int activityId) { + return getUser(userId).getActivities().getActivity(activityId).getValue(); + } + @Path("/{userId}/lastUpdatedTime") + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getLastUpdatedTimeValue(@PathParam("userId") String userId) { + return getUser(userId).getLastUpdatedTime(); + } + @Path("/{userId}/name") + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getNameValue(@PathParam("userId") String userId) { + return getUser(userId).getName(); + } + @Path("/{userId}/name") + @PUT + public void updateName(@PathParam("userId") String userId, @FormParam("name") String name) { + getUser(userId).updateName(userId, name); + } + @Path("/{userId}") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getUserValue(@PathParam("userId") String userId) { + return getUser(userId).getValue(); + } + @Path("/{userId}/email") + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getEmailValue(@PathParam("userId") String userId) { + return getUser(userId).getEmail(); + } + @Path("/{userId}/email") + @PUT + public void updateEmail(@PathParam("userId") String userId, @FormParam("email") String email) { + getUser(userId).updateEmail(userId, email); + } + @Path("/{userId}/activities") + @Produces(MediaType.APPLICATION_JSON) + @GET + public List getActivitiesValue(@PathParam("userId") String userId) { + return getUser(userId).getActivities().getValue(); + } + @Path("/{userId}/activities") + @POST + public void postActivity(@PathParam("userId") String userId, @FormParam("updatedTime") String updatedTime, @FormParam("text") String text) { + getUser(userId).getActivities().postActivity(userId, updatedTime, text); + } + @Path("/{user1Id}/friends") + @DELETE + public void updateFriendsFromDeletedFriendPair(@PathParam("user1Id") String user1Id, @FormParam("deletedFriendPair") Map deletedFriendPair) { + getUser(user1Id).updateFriendsFromDeletedFriendPair(user1Id, deletedFriendPair); + } + @Path("/{user1Id}/friends") + @DELETE + public void updateFriendsFromDeletedFriendPair(@PathParam("user1Id") String user1Id, @FormParam("deletedFriendPair") Map deletedFriendPair) { + getUser(user1Id).updateFriendsFromDeletedFriendPair(user1Id, deletedFriendPair); + } + @Path("/{user1Id}/friends") + @POST + public void updateFriendsFromPair(@PathParam("user1Id") String user1Id, @FormParam("pid") String pid, @FormParam("pair") Map pair) { + getUser(user1Id).updateFriendsFromPair(user1Id, pid, pair); + } + @Path("/{user1Id}/friends") + @POST + public void updateFriendsFromPair(@PathParam("user1Id") String user1Id, @FormParam("pid") String pid, @FormParam("pair") Map pair) { + getUser(user1Id).updateFriendsFromPair(user1Id, pid, pair); + } + @Path("/{user1Id}/friends") + @Produces(MediaType.APPLICATION_JSON) + @GET + public Map getFriendsValue(@PathParam("user1Id") String user1Id) { + return getUser(user1Id).getFriends(); + } + @Path("/{userId}/activities/{activityId}/updatedTime") + @Produces(MediaType.APPLICATION_JSON) + @GET + public String getUpdatedTimeValue(@PathParam("userId") String userId, @PathParam("activityId") int activityId) { + return getUser(userId).getActivities().getActivity(activityId).getUpdatedTime(); + } +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..100f26b --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=tampopo-server-dtram diff --git a/src/test/java/org/example/tampoposerverdtram/DtraMtestApplicationTests.java b/src/test/java/org/example/tampoposerverdtram/DtraMtestApplicationTests.java new file mode 100644 index 0000000..8967689 --- /dev/null +++ b/src/test/java/org/example/tampoposerverdtram/DtraMtestApplicationTests.java @@ -0,0 +1,13 @@ +package org.example.tampoposerverdtram; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DtraMtestApplicationTests { + + @Test + void contextLoads() { + } + +}