package com.base.plan.controller;

import com.base.orbit.web.Result;
import com.base.plan.model.dto.TaskStateDTO;
import com.base.plan.model.dto.request.FzTaskRunningStateReqDTO;
import com.base.plan.model.dto.request.FzTaskStepStateReqDTO;
import com.base.plan.service.FzViewService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController

@RequestMapping("/api/view")
public class FzTaskViewController {

    @Resource
    FzViewService fzViewService;

    @ApiOperation(value = "任务查询", response = TaskStateDTO.class)
    @PostMapping("/step/list")
    public Object getFzTaskStepState(@RequestBody FzTaskStepStateReqDTO req) {
        return Result.success(fzViewService.getFzTaskStepStateReqDTOList(req));
    }

    @PostMapping("/task/running/state/list")
    public Object getFzTaskRunningState(@RequestBody FzTaskRunningStateReqDTO req) {
        return Result.success(fzViewService.getFzTaskRunningState(req));

    }

    @PostMapping("/satellite/running/state/list")
    public Object getFzSatelliteRunningState(@RequestBody FzTaskRunningStateReqDTO req) {
        return Result.success(fzViewService.getFzSatelliteRunningState(req));

    }

    @PostMapping("/station/running/state/list")
    public Object getFzStationRunningState(@RequestBody FzTaskRunningStateReqDTO req) {
        return Result.success(fzViewService.getFzStationRunningState(req));
    }

    @PostMapping("/detail/info")
    public Object getFzDetailInfo(@RequestBody FzTaskRunningStateReqDTO req) {
        return Result.success(fzViewService.getFzResultDetailInfoDTO(req));
    }
}