Refactor to FileService and PostgresService

This commit is contained in:
Guntis Smaukstelis
2023-10-22 23:51:59 +03:00
parent e2c19024a2
commit aa4fa57adb
10 changed files with 89 additions and 78 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
package parse
import cats.effect.unsafe.implicits.global
import db.DBService
import db.FileService
import io.circe.syntax.EncoderOps
import parse.Aggregate.{AggregateKey, UserQuery}
@@ -43,8 +43,8 @@ object Main {
val from = LocalDateTime.parse("20230627_0000", formatter)
val to = LocalDateTime.parse("20230627_2359", formatter)
val dbService = DBService.of.unsafeRunSync()
val lines = dbService.getInRange(from, to).unsafeRunSync()
val fileService = FileService.of.unsafeRunSync()
val lines = fileService.getInRange(from, to).unsafeRunSync()
val query = UserQuery(List("Ainaži"), "tempAvg", AggregateKey.Avg, ChronoUnit.HOURS)
val parsed = Parser.queryData(query, lines)
println(parsed.asJson)