Skip to content

Commit

Permalink
CID-2744: send list of organizations to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlajmileanix committed Jul 16, 2024
1 parent 19cd1e3 commit 3feb544
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import org.springframework.stereotype.Service
class GitHubScanningService(
private val gitHubClient: GitHubClient,
private val cachingService: CachingService,
private val webSocketService: WebSocketService
) {
fun scanGitHubResources() {
val jwtToken = cachingService.get("jwtToken") ?: throw JwtTokenNotFound()
val installations = getInstallations(jwtToken.toString())
generateOrganizations(installations)
// send organizations to backend
val organizations = generateOrganizations(installations)
webSocketService.sendMessage("/app/ghe/organizations", organizations)
}

private fun getInstallations(jwtToken: String): List<Installation> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ class WebSocketService(
logger.info("init session")
stompSession = webSocketClientConfig.initSession()
}

fun sendMessage(topic: String, data: Any) {
stompSession!!.send(topic, data)
}
}

0 comments on commit 3feb544

Please sign in to comment.