Skip to content

Commit 35273cb

Browse files
committed
fix: cleanup
1 parent 0d73b6a commit 35273cb

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

backend/src/main/java/ch/xxx/maps/adapter/controller/CompanySiteController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ public CompanySiteDto getCompanySiteById(@Argument("id") Long id) {
6262
@BatchMapping(typeName = "CompanySiteOut")
6363
public List<List<PolygonDto>> polygons(List<CompanySiteDto> companySiteDtos) {
6464
return this.companySiteService.fetchPolygonDtos(companySiteDtos).entrySet().stream().map(value -> value
65-
.getValue().stream().map(myValue -> this.entityDtoMapper.mapToDtoNew(myValue, value.getKey())).toList())
65+
.getValue().stream().map(myValue -> this.entityDtoMapper.mapToDto(myValue, value.getKey())).toList())
6666
.toList();
6767
}
6868

6969
@BatchMapping(typeName = "PolygonOut")
7070
public List<List<RingDto>> rings(List<PolygonDto> polygonDtos) {
7171
return this.companySiteService.fetchRingDtos(polygonDtos).entrySet().stream().map(value -> value.getValue()
72-
.stream().map(myValue -> this.entityDtoMapper.mapToDtoNew(myValue, value.getKey())).toList()).toList();
72+
.stream().map(myValue -> this.entityDtoMapper.mapToDto(myValue, value.getKey())).toList()).toList();
7373
}
7474

7575
@BatchMapping(typeName = "RingOut")
7676
public List<List<LocationDto>> locations(List<RingDto> ringDtos) {
7777
return this.companySiteService.fetchLocationDtos(ringDtos).entrySet().stream().map(value -> value.getValue()
78-
.stream().map(myValue -> this.entityDtoMapper.mapToDtoNew(myValue, value.getKey())).toList()).toList();
78+
.stream().map(myValue -> this.entityDtoMapper.mapToDto(myValue, value.getKey())).toList()).toList();
7979
}
8080

8181
@MutationMapping

backend/src/main/java/ch/xxx/maps/usecase/mapper/EntityDtoMapper.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,20 @@ public CompanySiteDto mapToDto(CompanySite companySite) {
9595
return dto;
9696
}
9797

98-
public CompanySiteDto mapToDtoNew(CompanySite companySite) {
99-
var dto = new CompanySiteDto(companySite.getId(), companySite.getTitle(), companySite.getAtDate(),
100-
new ArrayList<PolygonDto>());
101-
return dto;
102-
}
103-
104-
public PolygonDto mapToDtoNew(Polygon polygon, CompanySiteDto companySiteDto) {
98+
public PolygonDto mapToDto(Polygon polygon, CompanySiteDto companySiteDto) {
10599
PolygonDto dto = new PolygonDto(polygon.getId(), polygon.getFillColor(), polygon.getBorderColor(),
106100
polygon.getTitle(), polygon.getLongitude(), polygon.getLatitude(), new ArrayList<RingDto>());
107101
companySiteDto.getPolygons().add(dto);
108102
return dto;
109103
}
110104

111-
public RingDto mapToDtoNew(Ring ring, PolygonDto polygonDto) {
105+
public RingDto mapToDto(Ring ring, PolygonDto polygonDto) {
112106
var dto = new RingDto(ring.getId(), ring.isPrimaryRing(), new ArrayList<LocationDto>());
113107
polygonDto.getRings().add(dto);
114108
return dto;
115109
}
116110

117-
public LocationDto mapToDtoNew(Location location, RingDto ringDto) {
111+
public LocationDto mapToDto(Location location, RingDto ringDto) {
118112
var dto = new LocationDto(location.getId(), location.getLongitude(), location.getLatitude(), location.getOrderId());
119113
ringDto.getLocations().add(dto);
120114
return dto;

0 commit comments

Comments
 (0)