Conversation
maps added
all commands are done
Homewrok 2
rd pull req
bonus tasks
logging completed
unit testing done
some correctings
| @RequestMapping("/courses") | ||
| public class CourseController { | ||
|
|
||
| private static CourseService courseService; |
There was a problem hiding this comment.
You are missing on the controllers dependency injection:
public CourseController(CourseService courseService) {
this.courseService = courseService;
}
The same for Student and Teacher controllers.
| import az.ironschool.ironschool.entities.Course; | ||
| import az.ironschool.ironschool.entities.Teacher; | ||
| import az.ironschool.ironschool.utils.Logging; | ||
|
|
There was a problem hiding this comment.
Add @service to both classes. Without it, Spring's component scan doesn't register them.
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| public class TeacherService { |
There was a problem hiding this comment.
Add @service to both classes. Without it, Spring's component scan doesn't register them.
| @Service | ||
| public class StudentService { | ||
|
|
||
| private static Map<String, Student> students; |
There was a problem hiding this comment.
private final Map<String, Student> students = new HashMap<>();
All 3 Map fields (in the 3 different services) are declared but never initialized — they're null.
|
|
||
|
|
||
| @GetMapping("/lookup/{id}") | ||
| public Course lookupCourse(@PathVariable String courseId){ |
There was a problem hiding this comment.
@GetMapping("/lookup/{id}") and @PathVariable String courseId have to match. Either id or courseId
Check other controllers for the same pattern.
| @NotBlank(message = "name bos ola bilmez") | ||
| private String name; | ||
|
|
||
| @NotBlank(message = "price bos ola bilmez") |
|
It would also be good to have some exception handling. |
No description provided.