/* * 【机场1】从 dock2 原类 com.ard.sample.wayline.service.IWaylineJobService 复制/独立适配(DJI Dock 1 / M30)。 * 与 dock2 原类同服务共存;本文件内的适配差异以「// 机场1:」内联注释标出。 */ package com.ard.sample.dock1.wayline.service; import com.ard.common.core.domain.model.LoginUser; import com.ard.sample.common.model.PaginationData; import com.ard.sample.common.model.ResponseResult; import com.ard.sample.component.mqtt.model.CommonTopicReceiver; import com.ard.sample.wayline.model.dto.WaylineJobDTO; import com.ard.sample.wayline.model.enums.WaylineJobStatusEnum; import com.ard.sample.wayline.model.param.CreateJobParam; import org.springframework.messaging.MessageHeaders; import java.sql.SQLException; import java.util.Collection; import java.util.List; import java.util.Optional; /** * @author sean * @version 1.1 * @date 2022/6/1 */ public interface IWaylineJobService { /** * Create wayline job in the database. * @param param * @param username user info * @param beginTime The time the job started. * @param endTime The time the job ended. * @return */ Optional createWaylineJob(CreateJobParam param, String username, Long beginTime, Long endTime); /** * Create a sub-task based on the information of the parent task. * @param parentId * @return */ Optional createWaylineJobByParent(String parentId); /** * Issue wayline mission to the dock. * @param param * @param loginUser user info * @return */ ResponseResult publishFlightTask(CreateJobParam param, LoginUser loginUser) throws SQLException; ResponseResult publishFlightTaskPrepare(Optional waylineJobOpt) throws SQLException; /** * Execute the task immediately. * @param jobId * @throws SQLException * @return */ Boolean executeFlightTask(String jobId); /** * Cancel the task Base on job Ids. * @param jobId * @throws SQLException */ ResponseResult cancelFlightTask(Collection jobId); // void cancelFlightTask(Collection jobIds); /** * Cancel the dock tasks that have been issued but have not yet been executed. * @param dockSn * @param jobIds */ ResponseResult publishCancelTask(String dockSn, List jobIds); /** * 删除任务 * */ void deleteTask(String id); /** * Query wayline jobs based on conditions. * @param jobIds * @param status * @return */ List getJobsByConditions( Collection jobIds, WaylineJobStatusEnum status); /** * Query job information based on job id. * @param jobId * @return job information */ Optional getJobByJobId(String jobId); /** * Update job data. * @param dto * @return */ Boolean updateJob(WaylineJobDTO dto); /** * Paginate through all jobs in this workspace. * @param page * @param pageSize * @return */ PaginationData getJobsByWorkspaceId(long page, long pageSize); PaginationData getJobsList(long page, long pageSize, Integer status, Long startTime, Long endTime, Integer taskType, String name, Boolean isComplete); /** * Process to get interface data of flight mission resources. * @param receiver * @param headers */ void flightTaskResourceGet(CommonTopicReceiver receiver, MessageHeaders headers); /** * Set the media files for this job to upload immediately. * @param jobId */ void uploadMediaHighestPriority(String jobId); }