package com.base.biz.controller.rpc;

import com.base.biz.model.dto.response.SatelliteStationMatchDTO;
import com.base.biz.service.SatelliteStationMatchService;
import com.base.api.model.SatelliteStationMatchRpcDTO;
import com.base.orbit.utils.BizUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController

@RequestMapping("/rpc/stationmatch")
public class SatelliteStationMatchRpcController {
    @Resource
    SatelliteStationMatchService satelliteStationMatchService;


    @GetMapping("/list")
    public List<SatelliteStationMatchRpcDTO> getBySatelliteCodeAndStationCode(@RequestParam("satelliteCodeList") List<String> satelliteCodeList, @RequestParam("stationCodeList")List<String> stationCodeList){
        List<SatelliteStationMatchDTO> satelliteStationMatchDTOList= satelliteStationMatchService.getBySatelliteCodeAndStationCode(satelliteCodeList,stationCodeList);
        return BizUtils.copyEntityToDto(SatelliteStationMatchRpcDTO.class,satelliteStationMatchDTOList);
    }
}
