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

com.infobip.kafkistry.webapp.controller.AutopilotController.kt Maven / Gradle / Ivy

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

import com.infobip.kafkistry.api.AutopilotApi
import com.infobip.kafkistry.webapp.url.AutopilotUrls.Companion.AUTOPILOT
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.servlet.ModelAndView

@Controller
@ConditionalOnProperty("app.autopilot.enabled", matchIfMissing = true)
@RequestMapping("\${app.http.root-path}$AUTOPILOT")
class AutopilotController(
    private val autopilotApi: AutopilotApi,
) : BaseController() {

    @GetMapping
    fun showAutopilotAll(): ModelAndView {
        val autopilotStatus = autopilotApi.status()
        val actionFlows = autopilotApi.listActionFlows()
        return ModelAndView("autopilot/all", mapOf(
            "autopilotStatus" to autopilotStatus,
            "actionFlows" to actionFlows,
        ))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy