21 lines
570 B
Java
Raw Normal View History

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
@Autowired
CourseRepository courseRepo;
@RequestMapping("/courses/{id}")
Course customer(@PathVariable Integer id) {
return courseRepo.getCourse(id);
}
}