Conversation
| @Min(value = 400 , message = "Minimum salary for Azerbaijan is 400 azn . Salary cant be less than 400 azn") | ||
| private double salary; | ||
|
|
||
| public Teacher(String name , double Salary ) { |
| import jakarta.validation.constraints.Size; | ||
|
|
||
| public class Student { | ||
| private int counter = 1; |
There was a problem hiding this comment.
private static int counter = 1;
counter should be static.
Otherwise each new Student instance starts again at 1, and all students will end up with ID S1. In Course.java you handled this correctly by using a shared static counter.
| } | ||
| @PutMapping("{courseId}/students/{studentId}") | ||
| public void enrollStudent(@PathVariable String courseId , @PathVariable String studentId){ | ||
| courseService.assignTeacherToCourse(studentId,courseId); |
There was a problem hiding this comment.
Shouldn't it be courseService.enrollStudent?
| } | ||
|
|
||
| @DeleteMapping("/{courseId}") | ||
| public void deleteCourse(String courseId){ |
There was a problem hiding this comment.
@PathVariable, here and also on the student and teacher delete mappings.
|
You basically have no PUT or PATCH endpoints. Is there any reason for that? I think it would also had been good if you handled the MethodArgumentNotValidException. |
|
I think I resolved this problems added put patch , Pathvariable and etc. and I check this endpoints . So I think homework is done |
No description provided.