Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
#196 use apperCase for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Stavetski committed May 14, 2018
1 parent 591bf91 commit bd2989b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ConnectorInfoController {
fun getTrades(
@PathVariable exchangeName: String
): Mono<ResponseEntity<Set<TokensPair>>> {
val pairs = connectorService.getTokensPairsByExchange(exchangeName)
val pairs = connectorService.getTokensPairsByExchange(exchangeName.toUpperCase())

return if (pairs != null && pairs.isNotEmpty()) {
ok().body(pairs).toMono()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import org.springframework.http.ResponseEntity.ok
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.client.RestTemplate
import reactor.core.publisher.Mono
import reactor.core.publisher.toMono

Expand All @@ -36,8 +35,6 @@ class RawDataController {
@Autowired
private lateinit var tradeRepository: TradeRepository

private val restTemplate = RestTemplate()

@GetMapping("/orderbook")
fun getOrderBook(
@RequestParam exchange: String,
Expand All @@ -49,10 +46,10 @@ class RawDataController {
if (ts != null) {
val nearestTs = nearestOrderBookTimestamp(ts)
val epochHour = nearestTs convert MILLIS_TO_HOURS
orderBook = orderBookRepository.getNearlest(exchange.toUpperCase(), CqlTokensPair(pair), epochHour, nearestTs)
orderBook = orderBookRepository.getNearlest(exchange.toUpperCase(), CqlTokensPair(pair.toUpperCase()), epochHour, nearestTs)
} else {
val tokensPair = TokensPair(pair)
val currentOrderBook = connectorService.getOrderBook(exchange, tokensPair)
val tokensPair = TokensPair(pair.toUpperCase())
val currentOrderBook = connectorService.getOrderBook(exchange.toUpperCase(), tokensPair)
if (currentOrderBook != null) {
orderBook = CqlOrderBook(exchange, tokensPair, currentOrderBook)
}
Expand All @@ -75,7 +72,7 @@ class RawDataController {
@RequestParam pair: String,
@RequestParam epochMin: Long
): Mono<ResponseEntity<List<CqlTrade>>> {
val trades = tradeRepository.get(exchange.toUpperCase(), CqlTokensPair(pair), epochMin)
val trades = tradeRepository.get(exchange.toUpperCase(), CqlTokensPair(pair.toUpperCase()), epochMin)

return if (trades != null && trades.isNotEmpty()) {
ok().body(trades).toMono()
Expand Down

0 comments on commit bd2989b

Please sign in to comment.