package com.artfess.rescue.open.controller;

import com.artfess.base.annotation.ApiGroup;
import com.artfess.base.constants.ApiGroupConsts;
import com.artfess.base.model.CommonResult;
import com.artfess.rescue.base.model.BizElectronicFenec;
import com.artfess.rescue.open.dto.OpenBaseQueryDTO;
import com.artfess.rescue.open.manager.OpenBaseManager;
import com.artfess.rescue.open.vo.BaseCarVO;
import com.artfess.rescue.open.vo.OpenBaseListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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;
import java.util.List;

/**
 * @Author: wsf
 * @Description: 巡查救援-驾驶舱基础数据相关服务
 * @DateTime: 2025/3/8 15:07
 **/

@RestController
@RequestMapping("/base/v1/")
@ApiGroup(group = {ApiGroupConsts.GROUP_BIZ_RESCUE})
@Api(tags = "巡查救援-驾驶舱相关服务")
public class OpenBaseController {

    @Resource
    private OpenBaseManager openBaseManager;

    @PostMapping("/task")
    @ApiOperation(value = "救援任务", notes = "救援任务")
    public CommonResult<List<OpenBaseListVO>> getTask(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getTask(dto);
    }

    @PostMapping("/point/patrol")
    @ApiOperation(value = "巡查驻点", notes = "巡查驻点")
    public CommonResult<List<OpenBaseListVO>> pointPatrol(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getPointPatrol(dto);
    }

    @PostMapping("/point/rescue")
    @ApiOperation(value = "救援驻点", notes = "救援驻点")
    public CommonResult<List<OpenBaseListVO>> pointRescue(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getPointRescue(dto);
    }

    @PostMapping("/car/patrol")
    @ApiOperation(value = "巡查车辆", notes = "巡查车辆")
    public CommonResult<List<BaseCarVO>> carPatrol(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getCarPatrol(dto);
    }

    @PostMapping("/car/rescue")
    @ApiOperation(value = "救援车辆", notes = "救援车辆")
    public CommonResult<List<BaseCarVO>> carRescue(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getCarRescue(dto);
    }

    @PostMapping("/rescue/region")
    @ApiOperation(value = "救援区域", notes = "救援区域")
    public CommonResult<List<BizElectronicFenec>> rescueRegion(@ApiParam(name = "OpenBaseQueryDTO", value = "驾驶舱查询条件DTO") @RequestBody OpenBaseQueryDTO dto) {
        return openBaseManager.getRescueRegion(dto);
    }
}
