package se.kits.gakusei.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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 se.kits.gakusei.content.model.Course;
import se.kits.gakusei.content.repository.CourseRepository;

@RestController
public class CourseController {

    @Autowired
    CourseRepository courseRepository;

    @RequestMapping(
            value = "api/courses",
            method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
    )
    public ResponseEntity<Iterable<Course>> getAllCourses(){
        return null;
    }

    @RequestMapping(
            value = "api/courses/{courseID}",
            method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
    )
    public ResponseEntity<Course> getCourseByID(){
        return null;
    }

    @RequestMapping(
            value = "api/courses/{courseName}",
            method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
    )
    public ResponseEntity<Course> getCourseByName(){
        return null;
    }

    @RequestMapping(
            value = "api/courses/{courseCode}",
            method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
    )
    public ResponseEntity<Course> getCourseByCode(){
        return null;
    }

}

@@ -184,16 +184,77 @@
 Entity;%0A
+import org.springframework.web.bind.annotation.PathVariable;%0A
 import o
@@ -1117,19 +1117,66 @@
 rseByID(
+@PathVariable(value = %22courseID%22) Long courseID
 )%7B%0A
-
         
@@ -1421,16 +1421,69 @@
 eByName(
+@PathVariable(value = %22courseName%22) String courseName
 )%7B%0A     
@@ -1673,32 +1673,32 @@
 TF8_VALUE%0A    )%0A
-
     public Respo
@@ -1731,16 +1731,69 @@
 eByCode(
+@PathVariable(value = %22courseCode%22) String courseCode
 )%7B%0A     

Add path variables to functions in course controller