package space.nstart.pcp.pcp_request_service.controller

import jakarta.validation.Valid
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import space.nstart.pcp.pcp_request_service.service.SatelliteService
import space.nstart.pcp.pcp_types_lib.dto.ballistics.ObjViewRequestDTO


@RestController
@RequestMapping("/api/obj-view")
class ObjViewController {

    @Autowired
    private lateinit var satelliteService: SatelliteService

    @PostMapping("/mpl-square")
    fun mplSquare(
        @Valid @RequestBody body : ObjViewRequestDTO
    ) =
        satelliteService.mplSquare(body)

    @PostMapping("/mpl-point")
    fun mplPoint(
        @Valid @RequestBody body : ObjViewRequestDTO
    ) =
        satelliteService.mplPoint(body)

    @GetMapping("cell-coverage/{number}")
    fun cellCov(@PathVariable number : Long) = satelliteService.getCellCovering(number)

}