Skip to content

Commit

Permalink
add gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
T1m1 committed Apr 19, 2016
0 parents commit 817c323
Show file tree
Hide file tree
Showing 25 changed files with 341 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
*.iml
target
**/*.xml
**/*.iml
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__aopalliance_aopalliance_1_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__junit_junit_4_12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_objenesis_objenesis_2_1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_projectlombok_lombok_1_16_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions src/main/java/de/htwg/konstanz/cloud/service/TestService.java
Original file line number Diff line number Diff line change
@@ -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<User> 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);
}
}

0 comments on commit 817c323

Please sign in to comment.