diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d48092 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.idea +*.iml +target +**/*.xml +**/*.iml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..b26911b --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml b/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml new file mode 100644 index 0000000..30ff5cb --- /dev/null +++ b/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_6_5.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_6_5.xml new file mode 100644 index 0000000..73c91ed --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_6_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_6_5.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_6_5.xml new file mode 100644 index 0000000..df1db76 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_6_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_6_5.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_6_5.xml new file mode 100644 index 0000000..015d92d --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_6_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml new file mode 100644 index 0000000..c24f7e3 --- /dev/null +++ b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml new file mode 100644 index 0000000..d411041 --- /dev/null +++ b/.idea/libraries/Maven__junit_junit_4_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..f58bbc1 --- /dev/null +++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml new file mode 100644 index 0000000..78dbe45 --- /dev/null +++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml b/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml new file mode 100644 index 0000000..a523703 --- /dev/null +++ b/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml b/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml new file mode 100644 index 0000000..7ab319b --- /dev/null +++ b/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_projectlombok_lombok_1_16_6.xml b/.idea/libraries/Maven__org_projectlombok_lombok_1_16_6.xml new file mode 100644 index 0000000..39769c2 --- /dev/null +++ b/.idea/libraries/Maven__org_projectlombok_lombok_1_16_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_3_3_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_3_3_RELEASE.xml new file mode 100644 index 0000000..11b70cf --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_3_3_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_core_1_0_1_RELEASE.xml b/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_core_1_0_1_RELEASE.xml new file mode 100644 index 0000000..5811ff4 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_core_1_0_1_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_mockmvc_1_0_1_RELEASE.xml b/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_mockmvc_1_0_1_RELEASE.xml new file mode 100644 index 0000000..471cd6a --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_restdocs_spring_restdocs_mockmvc_1_0_1_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_aop_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_aop_4_2_5_RELEASE.xml new file mode 100644 index 0000000..7388c82 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_aop_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_beans_4_2_5_RELEASE.xml new file mode 100644 index 0000000..6959be5 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_context_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_context_4_2_5_RELEASE.xml new file mode 100644 index 0000000..d71e0a4 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_context_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_core_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_core_4_2_5_RELEASE.xml new file mode 100644 index 0000000..9c970d9 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_core_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_expression_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_expression_4_2_5_RELEASE.xml new file mode 100644 index 0000000..c9285e1 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_expression_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_test_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_test_4_2_5_RELEASE.xml new file mode 100644 index 0000000..ff922bd --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_test_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_web_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_web_4_2_5_RELEASE.xml new file mode 100644 index 0000000..6646dba --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_web_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_webmvc_4_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_webmvc_4_2_5_RELEASE.xml new file mode 100644 index 0000000..20be062 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_webmvc_4_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/de/htwg/konstanz/cloud/service/TestService.java b/src/main/java/de/htwg/konstanz/cloud/service/TestService.java new file mode 100644 index 0000000..47d44f1 --- /dev/null +++ b/src/main/java/de/htwg/konstanz/cloud/service/TestService.java @@ -0,0 +1,44 @@ +package de.htwg.konstanz.cloud.service; + +import com.seitenbau.microservices.core.user.UserRepository; +import com.seitenbau.microservices.core.user.model.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/users") +public class TestService { + + @Autowired + private UserRepository repository; + + @RequestMapping(method = RequestMethod.GET) + public List getAll() { + return repository.findAll(); + } + + @RequestMapping(method = RequestMethod.POST, consumes = "application/json") + public User create(@RequestBody User user) { + return repository.save(user); + } + + @RequestMapping(value = "{userId}", method = RequestMethod.GET) + public User getUser(@PathVariable String userId) { + return repository.findOne(userId); + } + + @RequestMapping(value = "{userId}", method = RequestMethod.PUT, consumes = "application/json") + public User update(@PathVariable String userId, @RequestBody User user) { + User update = repository.findOne(userId); + update.setFirstName(user.getFirstName()); + update.setLastName(user.getLastName()); + return repository.save(update); + } + + @RequestMapping(value="{userId}", method = RequestMethod.DELETE ) + public void delete(@PathVariable String userId) { + repository.delete(userId); + } +}