DBService object to class with logger injection
This commit is contained in:
@@ -2,6 +2,7 @@ package parse
|
||||
|
||||
import cats.effect.IO
|
||||
import cats.effect.unsafe.implicits.global
|
||||
import db.DBService
|
||||
import io.circe.syntax.EncoderOps
|
||||
import parse.Aggregate.AggregateValueImplicits.aggregateValueEncoder
|
||||
import parse.Aggregate.{AggregateKey, UserQuery}
|
||||
@@ -19,7 +20,8 @@ object Main {
|
||||
val userQuery = UserQuery(List("Rīga"), "tempAvg", AggregateKey.List)
|
||||
|
||||
for {
|
||||
lines <- db.DBService.getInRange(from, to)
|
||||
dbService <- DBService.of
|
||||
lines <- dbService.getInRange(from, to)
|
||||
parsed <- IO.pure(Parser.queryData(userQuery, lines))
|
||||
_ <- IO.println(parsed.asJson)
|
||||
} yield ()
|
||||
|
||||
Reference in New Issue
Block a user