罗广辉
2025-06-19 f27ca082eb0a839449dd50c49007b58e5ed6946f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * @Author: GuLiMmo 2820890765@qq.com
 * @Date: 2024-03-12 17:59:03
 * @LastEditors: GuLiMmo 2820890765@qq.com
 * @LastEditTime: 2024-08-28 14:25:29
 * @FilePath: /drone-web/src/api/device-cmd/index.ts
 * @Description:
 * Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
 */
import request, { IWorkspaceResponse } from '/@/api/http/request'
import { DeviceCmd, DeviceCmdItemAction } from '/@/types/device-cmd'
 
const CMD_API_PREFIX = '/control/api/v1'
 
export interface SendCmdParams {
  dock_sn: string, // 机场cn
  device_cmd: DeviceCmd // 指令
}
 
export interface PostSendCmdBody {
  action: DeviceCmdItemAction
}
/**
 * 发送机场控制指令
 * @param params
 * @returns
 */
// /control/api/v1/devices/{dock_sn}/jobs/{service_identifier}
export async function postSendCmd (params: SendCmdParams, body?: PostSendCmdBody): Promise<IWorkspaceResponse<{}>> {
  const resp = await request.post(`${CMD_API_PREFIX}/devices/${params.dock_sn}/jobs/${params.device_cmd}`, body)
  return resp.data
}