Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 6ba7b59

Browse files
committed
Rework API for TwitchStats
1 parent c878d08 commit 6ba7b59

File tree

1 file changed

+4
-4
lines changed
  • src/main/scala/org/codeoverflow/chatoverflow/requirement/service/twitch/api/impl

1 file changed

+4
-4
lines changed

src/main/scala/org/codeoverflow/chatoverflow/requirement/service/twitch/api/impl/TwitchStatImpl.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package org.codeoverflow.chatoverflow.requirement.service.twitch.api.impl
33
import akka.actor.{ActorRef, ActorSystem, Props}
44
import akka.pattern.ask
55
import akka.util.Timeout
6-
import org.codeoverflow.chatoverflow.api.io.dto.User
6+
import org.codeoverflow.chatoverflow.api.io.dto.stat.twitch.TwitchUserStats
77
import org.codeoverflow.chatoverflow.api.io.input.stat.TwitchStatInput
88
import org.codeoverflow.chatoverflow.framework.actors.{Mapping, StringMappingActor}
99
import org.codeoverflow.chatoverflow.registry.Impl
@@ -23,7 +23,7 @@ class TwitchStatInputImpl extends InputImpl[TwitchAPIConnector] with TwitchStatI
2323
private val actor: ActorRef = actorSystem.actorOf(Props[StringMappingActor])
2424
implicit val timeout: Timeout = Timeout(5 seconds)
2525

26-
override def getFollowers(userName: String): java.util.List[User] = {
26+
override def getFollowers(userName: String): java.util.List[TwitchUserStats] = {
2727
val userID = getUser(userName).getId
2828
val response = sourceConnector.get.getFollowers(userID)
2929
println(response)
@@ -35,13 +35,13 @@ class TwitchStatInputImpl extends InputImpl[TwitchAPIConnector] with TwitchStatI
3535
sourceConnector.get.getSubscriptions(userID)
3636
}
3737

38-
override def getUser(userName: String): User = {
38+
override def getUser(userName: String): TwitchUserStats = {
3939
val response = sourceConnector.get.getUser(userName)
4040
println(response)
4141
val result = Await.result(actor ? Mapping(map[UserResult], response), timeout.duration).asInstanceOf[UserResult]
4242
if (result.data.nonEmpty) {
4343
val user = result.data.head
44-
new User(user.id, user.display_name, user.description, user.profile_image_url, user.view_count)
44+
new TwitchUserStats(user.id, user.display_name, user.description, user.profile_image_url, user.view_count)
4545
}
4646
else null
4747
}

0 commit comments

Comments
 (0)