package com.tuoheng.admin.controller.callback;

import com.tuoheng.admin.request.inspection.UpdateTaskByCodeRequest;
import com.tuoheng.admin.request.inspection.UploadFlightUrlRequest;
import com.tuoheng.admin.service.inspection.IInspectionService;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * 飞手平台回调
 *
 * @author wanjing
 * @team tuoheng
 * @date 2022-12-22
 */
@Slf4j
@RestController
@RequestMapping("/pilot/callback")
public class PilotCallbackController {

    @Autowired
    private IInspectionService iInspectionService;

    /**
     * 上传离线视频
     *
     * @param request
     * @return
     */
    @PostMapping("/uploadFlightUrl")
    public JsonResult uploadFlightUrl(@RequestBody UploadFlightUrlRequest request) {
        return iInspectionService.uploadFlightUrl(request);
    }

    /**
     * 修改巡检任务
     *
     * @param request
     * @return
     */
    @PostMapping("/updateTaskByCode")
    public JsonResult updateTaskByCode(@RequestBody UpdateTaskByCodeRequest request) {
        return iInspectionService.updateTaskByCode(request);
    }
}
