Added CourseService into javadoc
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
20341d5441
commit
f8b12d831b
@ -18,23 +18,43 @@ public class CourseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CourseRepository repo;
|
private CourseRepository repo;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* getCourseByName
|
||||||
|
* Return Course By Name
|
||||||
|
*/
|
||||||
public Optional<Course> getCourseByName(String name) {
|
public Optional<Course> getCourseByName(String name) {
|
||||||
return this.repo.findByName(name);
|
return this.repo.findByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* getAllCourses
|
||||||
|
* Return List of get courses
|
||||||
|
*/
|
||||||
public List<Course> getAllCourses() {
|
public List<Course> getAllCourses() {
|
||||||
return this.repo.findAll();
|
return this.repo.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* save
|
||||||
|
* @param course which course you would like to save
|
||||||
|
*/
|
||||||
public Course save(Course course) {
|
public Course save(Course course) {
|
||||||
this.repo.save(course);
|
this.repo.save(course);
|
||||||
return course;
|
return course;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* delete
|
||||||
|
* @param course which course you would like to delete
|
||||||
|
*/
|
||||||
public void delete(Course course) {
|
public void delete(Course course) {
|
||||||
this.repo.delete(course);
|
this.repo.delete(course);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* getCoursesAmmount
|
||||||
|
* Return a ammount of courses
|
||||||
|
*/
|
||||||
public int getCoursesAmmount() {
|
public int getCoursesAmmount() {
|
||||||
return (int) this.repo.count();
|
return (int) this.repo.count();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user