Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fagorym committed Nov 13, 2023
1 parent 9934d5e commit 01755db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public record RequestGetEstablishmentParameters(
limit = limit == null ? 100 : limit;
sortValue = sortValue == null ? "name" : sortValue;
workingDayCount = workingDayCount == null ? 7 : workingDayCount;
category = category == null ? "" : category;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
import ru.nsu.fit.directors.userservice.api.EstablishmentApi;
import ru.nsu.fit.directors.userservice.dto.request.RequestGetEstablishmentParameters;
import ru.nsu.fit.directors.userservice.dto.response.EstablishmentListDto;
import ru.nsu.fit.directors.userservice.dto.response.ResponseBasicEstablishmentInfo;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;

@Component
@RequiredArgsConstructor
Expand All @@ -20,7 +18,7 @@ public class EstablishmentServiceImpl implements EstablishmentService {

@Override
public EstablishmentListDto getEstablishmentByParams(RequestGetEstablishmentParameters parameters) {
List<ResponseBasicEstablishmentInfo> establishmentInfoList = establishmentApi.syncListGetWithParams(
EstablishmentListDto establishmentInfoList = establishmentApi.syncGetWithParams(
uriBuilder -> uriBuilder.path("/establishment/all")
.queryParam("name", parameters.name())
.queryParam("hasMap", parameters.hasMap())
Expand All @@ -29,9 +27,9 @@ public EstablishmentListDto getEstablishmentByParams(RequestGetEstablishmentPara
.build(),
new ParameterizedTypeReference<>() {
});
establishmentInfoList.forEach(
establishmentInfoList.establishmentInfoList().forEach(
info -> info.setFavourite(favouritesService.getFavouritesIds().contains(info.getId()))
);
return new EstablishmentListDto(establishmentInfoList.size(), establishmentInfoList);
return establishmentInfoList;
}
}

0 comments on commit 01755db

Please sign in to comment.