package com.base.track.controller;

import com.base.orbit.web.Result;
import com.base.track.model.dto.request.CxStationDTO;
import com.base.track.model.dto.request.TrbutRequestDTO;
import com.base.track.service.TrbutDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.annotation.Resource;

@RestController
@RequestMapping("/api/trbut")
@Api(value = "进出站")
public class TrbutDataController {

    @Resource
    TrbutDataService trbutDataService;


    @ApiOperation(value = "中继卫星进出站计算")
    @RequestMapping("/relay/count")
    public Object countTrbut(@RequestBody TrbutRequestDTO trbutRequestDTO){
        trbutDataService.relayTrbutCountAndBatch(trbutRequestDTO);
        return Result.success();
    }

    @PostMapping("/list")
    @ApiOperation(value = "进出站查询")
    public Object selTrButData(@RequestBody CxStationDTO cxStationDTO){
        return Result.success(trbutDataService.selTrButData(cxStationDTO));
    }

    @PostMapping("/selTrButDataByFz")
    @ApiOperation(value = "仿真显示中查询进出站")
    public Object selTrButDataByFz(@RequestBody CxStationDTO cxStationDTO){
        return Result.success(trbutDataService.selTrButDataByFz(cxStationDTO));
    }
}
