Skip to content

Commit 1ee0651

Browse files
removing the use of dto in controller
1 parent df9679e commit 1ee0651

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/org/airpenthouse/GoTel/controllers/CountApiUsersController.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package org.airpenthouse.GoTel.controllers;
22

3-
import org.airpenthouse.GoTel.dtos.countApiUsers.CountApiUsersRequest;
43
import org.airpenthouse.GoTel.util.CountApiUsers;
5-
import org.airpenthouse.GoTel.util.mappers.CountApiUsersMapper;
6-
import org.springframework.beans.factory.annotation.Autowired;
74
import org.springframework.http.ResponseEntity;
85
import org.springframework.web.bind.annotation.CrossOrigin;
96
import org.springframework.web.bind.annotation.GetMapping;
@@ -17,13 +14,10 @@
1714
@CrossOrigin(origins="http://localhost:4200")
1815
public class CountApiUsersController extends CountApiUsers {
1916

20-
@Autowired
21-
private CountApiUsersMapper mapper;
22-
2317

2418
@GetMapping("/")
25-
public ResponseEntity<List<CountApiUsersRequest>> getAllCounts() {
26-
var entities = prepareToGetAllCounties().stream().map(mapper::toDto).toList();
19+
public ResponseEntity<List<CountApiUsers>> getAllCounts() {
20+
var entities = prepareToGetAllCounties();
2721
if (entities.isEmpty()) {
2822
return ResponseEntity.notFound().build();
2923
} else {

0 commit comments

Comments
 (0)