All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.infobip.kafkistry.api.WebSessionsApi.kt Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package com.infobip.kafkistry.api

import com.infobip.kafkistry.webapp.UserSessions
import com.infobip.kafkistry.webapp.UserSessionsAndStats
import com.infobip.kafkistry.webapp.UserSessionsService
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("\${app.http.root-path}/api/web-sessions")
class WebSessionsApi(
    private val sessionsService: UserSessionsService,
) {

    @GetMapping
    fun allUsersSessions(): List = sessionsService.currentUsersSessions()

    @GetMapping("/stats")
    fun allUsersSessionsAndStats(): UserSessionsAndStats = sessionsService.currentUsersSessionsAndStats()

    @DeleteMapping("/{session-id}/expire")
    fun expireSession(
        @PathVariable("session-id") sessionId: String,
    ): Unit = sessionsService.expireSession(sessionId)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy