package com.betriebsratkanzlei.legalconsenthub_middleware.smartcard

import com.betriebsratkanzlei.legalconsenthub_middleware_api.api.SmartCardApi
import com.betriebsratkanzlei.legalconsenthub_middleware_api.model.CertificateDto
import com.betriebsratkanzlei.legalconsenthub_middleware_api.model.SmartCardInfoDto
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RestController
import java.time.LocalDateTime

@RestController
@ConditionalOnProperty(name = ["dummy.mode.enabled"], havingValue = "false", matchIfMissing = true)
class SmartCardController(
    private val smartCardService: SmartCardService
) : SmartCardApi {
    
    override fun getSmartCardInfo(): ResponseEntity<SmartCardInfoDto> {
        val smartCardInfo = smartCardService.getSmartCardInfo()
        return ResponseEntity.ok(smartCardInfo)
    }
    
    override fun getSmartCardCertificates(): ResponseEntity<List<CertificateDto>> {
        val certificates = smartCardService.getSmartCardCertificates()
        return ResponseEntity.ok(certificates)
    }
} 