removed symbol

This commit is contained in:
Filip Izydorczyk 2020-08-24 11:36:15 +02:00
parent 0b1a008526
commit 20e2cc9ea0

View File

@ -1,5 +1,8 @@
package com.plannaplan.controllers;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.List;
import com.plannaplan.entities.Course;
@ -19,8 +22,17 @@ public class CoursesController {
private CourseService courseService;
@GetMapping("/getCourses")
public ResponseEntity<List<Course>> getMethodName() {
return new ResponseEntity<>(this.courseService.getAllCourses(), HttpStatus.OK);
public ResponseEntity<List<Dictionary<String,Object>>> getMethodName() {
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);
}
}