package com.tuoheng.admin.service.airportline;

import com.tuoheng.admin.entity.AirportLine;
import com.tuoheng.admin.mapper.AirportLineMapper;
import com.tuoheng.admin.service.airportline.query.accident.QueryAirportLineByAccidentIdService;
import com.tuoheng.admin.service.airportline.query.inspection.QueryAirportLineByInspectionIdFactory;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ChengWang
 * @Date 2023/3/2
 */
@Service
@Slf4j
public class AirportLineServiceImpl extends BaseServiceImpl<AirportLineMapper, AirportLine> implements IAirportLineService {

    @Autowired
    private QueryAirportLineByAccidentIdService queryAirportLineByAccidentIdService;

    @Autowired
    private QueryAirportLineByInspectionIdFactory queryAirportLineByInspectionIdFactory;

    /**
     * 查询航线信息
     *
     * @param accidentId 应急事故Id
     * @return
     */
    @Override
    public JsonResult getInfoByAccidentId(String accidentId) {
        return queryAirportLineByAccidentIdService.getInfoByAccidentId(accidentId);
    }

    /**
     * 查询航线信息
     *
     * @param inspectionId 任务Id
     * @return
     */
    @Override
    public JsonResult getInfoByInspectionId(String inspectionId) {
        return queryAirportLineByInspectionIdFactory.getAirportLineList(inspectionId);
    }
}
