You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
873 B
26 lines
873 B
package controllers
|
|
|
|
import com.alexitc.playsonify.models.ordering.OrderingQuery
|
|
import com.alexitc.playsonify.models.pagination.{Limit, Offset, PaginatedQuery}
|
|
import com.xsn.explorer.services.BalanceService
|
|
import controllers.common.{Codecs, MyJsonController, MyJsonControllerComponents}
|
|
import javax.inject.Inject
|
|
|
|
class BalancesController @Inject() (
|
|
balanceService: BalanceService,
|
|
cc: MyJsonControllerComponents)
|
|
extends MyJsonController(cc) {
|
|
|
|
import Codecs._
|
|
|
|
def get(offset: Int, limit: Int, ordering: String) = public { _ =>
|
|
val paginatedQuery = PaginatedQuery(Offset(offset), Limit(limit))
|
|
val orderingQuery = OrderingQuery(ordering)
|
|
|
|
balanceService.get(paginatedQuery, orderingQuery)
|
|
}
|
|
|
|
def getHighest(limit: Int, lastSeenAddress: Option[String]) = public { _ =>
|
|
balanceService.getHighest(Limit(limit), lastSeenAddress)
|
|
}
|
|
}
|