removed symbol
This commit is contained in:
parent
0b1a008526
commit
20e2cc9ea0
@ -1,5 +1,8 @@
|
|||||||
package com.plannaplan.controllers;
|
package com.plannaplan.controllers;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Dictionary;
|
||||||
|
import java.util.Hashtable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.plannaplan.entities.Course;
|
import com.plannaplan.entities.Course;
|
||||||
@ -19,8 +22,17 @@ public class CoursesController {
|
|||||||
private CourseService courseService;
|
private CourseService courseService;
|
||||||
|
|
||||||
@GetMapping("/getCourses")
|
@GetMapping("/getCourses")
|
||||||
public ResponseEntity<List<Course>> getMethodName() {
|
public ResponseEntity<List<Dictionary<String,Object>>> getMethodName() {
|
||||||
return new ResponseEntity<>(this.courseService.getAllCourses(), HttpStatus.OK);
|
List<Course> courses = this.courseService.getAllCourses();
|
||||||
|
List<Dictionary<String,Object>> response = new ArrayList<>();
|
||||||
|
for(Course c : courses){
|
||||||
|
Dictionary<String, Object> element = new Hashtable<>();
|
||||||
|
element.put("id", c.getId());
|
||||||
|
element.put("name",c.getName());
|
||||||
|
response.add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user