I work on method that returns me for example 'stores' by id and some dynamic query parameters. I've made method that returns me all stores but only by id.
This is my method with id and two optional things:
override fun retriveStoresByDatabaseId(databaseId: String, pageSize: Int, pageNumber: Int): List<StoreDto> {
val sq = SearchQuery()
sq.setSearchParam("databaseId", databaseId)
sq.setPageNumber(pageNumber)
sq.setPageSize(pageSize)
val stores: MutableList<StoreDto> = mutableListOf()
storeRepository.findAll(sq).forEach {
stores.add(DtoHelper.toDto(it, ""))
}
return stores
}
In store model class I have list that have all Attributes(that is the type), in my request I want to send body that is map, and values are my dynamic params. Then I want to get value only these arguments that are equals to values in map. Can You give me some advice how to iter that list with every dynamic param?