Skip to content
Snippets Groups Projects
Commit c02fafd4 authored by fz2907's avatar fz2907
Browse files

Added ServerHttpService.js, Constants.js, ExampleService.js, and changed...

Added ServerHttpService.js, Constants.js, ExampleService.js, and changed HelloWorld.vue for show examples.
The front to back end connection is ready.
parent 217b3128
No related branches found
No related tags found
3 merge requests!27Sprint 1 done,!7Changed DB port from 3306 to 3307. So it will not interrupt with your own local MySQL,!5Added ServerHttpService.js, Constants.js, ExampleService.js, and changed HelloWorld.vue for show examples. The front to back end connection is ready.
/.idea/
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Gradle Imported" enabled="true">
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="false">
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.7.4/444e3980bdda8429a5055c9d55881dd66a61c85e/spring-boot-configuration-processor-2.7.4.jar" />
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.24/13a394eed5c4f9efb2a6d956e2086f1d81e857d9/lombok-1.18.24.jar" />
</processorPath>
<module name="SwitchRoom.main" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$/BackendFolder/SwitchRoom" />
<option name="gradleJvm" value="corretto-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/BackendFolder/SwitchRoom" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" project-jdk-name="corretto-17" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="8d1842aa-2e0c-43eb-813e-5bbde3c5a6ca" name="Changes" comment="Updated the example controller.">
<change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/switchroom.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<list default="true" id="2f445186-863f-4ba0-a69b-1197a12a9418" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/FrontendFolder/switch-room/src/services/Constants.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/FrontendFolder/switch-room/src/services/ExampleService.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/ExampleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/BackendFolder/SwitchRoom/src/main/java/vt/CS5934/SwitchRoom/controllers/ExampleController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FrontendFolder/switch-room/src/components/HelloWorld.vue" beforeDir="false" afterPath="$PROJECT_DIR$/FrontendFolder/switch-room/src/components/HelloWorld.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FrontendFolder/switch-room/src/services/HttpRequestService.js" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$/BackendFolder/SwitchRoom">
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$/BackendFolder/SwitchRoom">
<activation />
</task>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="SwitchRoom" type="f1a62948:ProjectNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2G32Z57VMxPLeVLmbPeeeH3ElgL" />
<component name="ProjectId" id="2G5usFtgI8bz2hXPNccYRLa4daI" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Code&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "D:/Code"
}
}</component>
<component name="RunManager" selected="Application.SwitchRoomApplication">
<configuration name="SwitchRoomApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="vt.CS5934.SwitchRoom.SwitchRoomApplication" />
<module name="SwitchRoom.main" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="vt.CS5934.SwitchRoom.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="SwitchRoom" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/BackendFolder/SwitchRoom" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.SwitchRoomApplication" />
<item itemvalue="Gradle.SwitchRoom" />
</list>
</recent_temporary>
</component>
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="8d1842aa-2e0c-43eb-813e-5bbde3c5a6ca" name="Changes" comment="" />
<created>1665603001198</created>
<changelist id="2f445186-863f-4ba0-a69b-1197a12a9418" name="Changes" comment="" />
<created>1665690971852</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1665603001198</updated>
<updated>1665690971852</updated>
</task>
<task id="LOCAL-00001" summary="Change spring boot port to 8081, so it will not interoperate with Vue">
<created>1665604029158</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1665604029158</updated>
</task>
<task id="LOCAL-00002" summary="Updated the example controller. &#10;Change spring boot port to 8081, so it will not interoperate with Vue">
<created>1665607317533</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1665607317533</updated>
</task>
<task id="LOCAL-00003" summary="Updated the example controller.">
<created>1665608330254</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1665608330254</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
......@@ -153,10 +56,4 @@
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Change spring boot port to 8081, so it will not interoperate with Vue" />
<MESSAGE value="Updated the example controller. &#10;Change spring boot port to 8081, so it will not interoperate with Vue" />
<MESSAGE value="Updated the example controller." />
<option name="LAST_COMMIT_MESSAGE" value="Updated the example controller." />
</component>
</project>
\ No newline at end of file
/**
* This is a class that contains all constant values, it help to make change on address or ports or other things.
*/
const SEVER_IP= location.hostname;
const SERVER_PORT= 8081;
const Server_URL= location.protocol +"//"+ SEVER_IP + ":" + SERVER_PORT + "/";
export default{
SEVER_IP,
SERVER_PORT,
Server_URL,
}
/*
Change logs:
Date | Author | Description
2022-10-12 | Fangzheng Zhang | create class and init
*/
\ No newline at end of file
/**
* This is an example service class to show you that how to use http service in ServerHttpService class.
* If you have some data pre-processing job, you can do it here.
*/
import ServerHttpService from "./ServerHttpService";
const baseUrl = "example";
export default{
getExapleFromServer(){
return ServerHttpService.Get(baseUrl);
},
getExampleWithIDFromServer(inputId){
let urlPath = "/"+inputId;
return ServerHttpService.Get(baseUrl + urlPath);
},
getExampleUserFromServer(){
let urlPath = "/getUser";
return ServerHttpService.Get(baseUrl + urlPath);
},
postExampleUserDataToServer(userData){
let urlPath = "/newUser";
return ServerHttpService.Post(baseUrl + urlPath, JSON.parse(userData));
}
};
/*
Change logs:
Date | Author | Description
2022-10-12 | Fangzheng Zhang | create class and init
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment