2016-06-19 02:57:35 +07:00
|
|
|
package com.baeldung.protobuf;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import com.baeldung.protobuf.BaeldungTraining.Course;
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
public class CourseController {
|
2016-06-18 22:08:24 +02:00
|
|
|
|
2016-06-19 02:57:35 +07:00
|
|
|
@Autowired
|
|
|
|
CourseRepository courseRepo;
|
|
|
|
|
|
|
|
@RequestMapping("/courses/{id}")
|
|
|
|
Course customer(@PathVariable Integer id) {
|
|
|
|
return courseRepo.getCourse(id);
|
|
|
|
}
|
|
|
|
}
|