package com.base.biz.controller;


import com.base.api.model.AntennaRpcDTO;
import com.base.biz.service.AntennaService;
import com.base.orbit.web.Result;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
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;

@RestController
@RequestMapping("/api/antenna")
@Slf4j
@Api(tags = "天线模块")
public class AntennaController {

    @Resource
    private AntennaService antennaService;

    @PostMapping(value = "/selAntenaInfoByIds")
    @ApiOperation(value = "根据地面站代号查询天线信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "地面站代号")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK", response = AntennaRpcDTO.class)
    })
    public Object selAntenaInfoByIds(@RequestBody List<String> stationIds) {
        return Result.success(antennaService.selAntenaInfoByIds(stationIds));
    }

    @PostMapping(value = "/selAllAntenaInfos")
    @ApiOperation(value = "查询所有天线信息")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK", response = AntennaRpcDTO.class)
    })
    public Object selAllAntenaInfos() {
        return Result.success(antennaService.selAllAntenaInfos());
    }
}
