Skip to content

Instantly share code, notes, and snippets.

@matsev
Created June 17, 2012 10:16
Show Gist options
  • Select an option

  • Save matsev/2944122 to your computer and use it in GitHub Desktop.

Select an option

Save matsev/2944122 to your computer and use it in GitHub Desktop.
@Controller
@RequestMapping("/user")
class UserController {
private final UserService userService;
@Autowired
UserController(UserService userService) {
this.userService = userService;
}
// Add CRUD methods
}
public interface UserService {
long create(User user);
User read(long userId) throws UnknownUserException;
void update(long userId, User user) throws UnknownUserException;
void delete(long userId) throws UnknownUserException;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment