Skip to content

Elcin asiman dev#80

Open
Elcinn4013 wants to merge 4 commits intoironhack-labs:mainfrom
Elcinn4013:elcin-asiman-dev
Open

Elcin asiman dev#80
Elcinn4013 wants to merge 4 commits intoironhack-labs:mainfrom
Elcinn4013:elcin-asiman-dev

Conversation

@Elcinn4013
Copy link
Copy Markdown

No description provided.

@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 ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

salary, not Salary in the parameters.

import jakarta.validation.constraints.Size;

public class Student {
private int counter = 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be courseService.enrollStudent?

}

@DeleteMapping("/{courseId}")
public void deleteCourse(String courseId){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PathVariable, here and also on the student and teacher delete mappings.

@ahpoise
Copy link
Copy Markdown

ahpoise commented Mar 12, 2026

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.

@Asiman77
Copy link
Copy Markdown

I think I resolved this problems added put patch , Pathvariable and etc. and I check this endpoints . So I think homework is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants