package com.betasquirrel.controller;

import com.betasquirrel.model.User;
import com.betasquirrel.service.UserService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Anshad Vattapoyil on 10/06/17 2:58 PM.
 */

@RestController
@RequestMapping("/api")
public class HomeController {


    private UserService userService;

    @RequestMapping(value = "/user", method = RequestMethod.GET)
    public ResponseEntity listAllUsers() {
        List<User> users = userService.findAllUsers();
        if (users.isEmpty()) {
            return new ResponseEntity(HttpStatus.NO_CONTENT);
        }
        return new ResponseEntity<>(users, HttpStatus.OK);
    }
}

@@ -112,16 +112,79 @@
 ervice;%0A
+import org.springframework.beans.factory.annotation.Autowired;%0A
 import o
@@ -617,20 +617,26 @@
  %7B%0A%0A
-%0A
     
-private
+@Autowired%0A   
  Use

Fix service calling error.