package com.tuoheng.admin.service.airportline;

import com.tuoheng.admin.entity.domain.AirportLine;
import com.tuoheng.admin.entity.request.inspection.AirportLineRequest;
import com.tuoheng.admin.mapper.AirportLineMapper;
import com.tuoheng.admin.service.airportline.add.AddAirportLineService;
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 QueryAirportLineByInspectionIdFactory queryAirportLineByInspectionIdFactory;

    @Autowired
    private AddAirportLineService addAirportLineService;

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

    /**
     *添加航线
     * @param request
     * @return
     */
    @Override
    public JsonResult addAirportLine(AirportLineRequest request) {
        return addAirportLineService.add(request);
    }
}
