package com.tymiller.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tymiller.model.User;
import com.tymiller.service.UserService;

@RestController
@RequestMapping("/rest")
public class UserResource {

	@Autowired
	private UserService userService;
	
	@RequestMapping("/user/users")
	public List<User> findAllUsers() {
		return userService.findAllUsers();
	}
}

@@ -168,23 +168,145 @@
 .Request
-Mapping
+Body;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod
 ;%0Aimport
@@ -623,16 +623,16 @@
 ers() %7B%0A
-
 %09%09return
@@ -663,10 +663,348 @@
 s();%0A%09%7D%0A
+%09%0A%09@RequestMapping(value=%22/user/userName%22, method = RequestMethod.POST)%0A%09public User findByUserName(@RequestBody String userName) %7B%0A%09%09return userService.findByUserName(userName);%0A%09%7D%0A%09%0A%09@RequestMapping(value=%22/user/update%22, method = RequestMethod.POST)%0A%09public User updateUser(@RequestBody User user) %7B%0A%09%09return userService.save(user);%0A%09%7D%0A
 %7D%0A

add requestmapping for findByUserName and update User