石墨仪设备 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
702 B

6 months ago
  1. import httpRequest, { type BaseResponse } from "../httpRequest";
  2. import { addTxnRecord } from "../txn";
  3. import type { OperationCmd } from "./cmdTypes";
  4. export function debugCmd(params: { command: OperationCmd; params: Record<string, any> }) {
  5. const commandId = addTxnRecord({ ...params, category: "debug" });
  6. return httpRequest<BaseResponse<string>>({ url: "/api/cmd/", params: { ...params, commandId }, method: "POST" });
  7. }
  8. export function taskCmd(params: { command: OperationCmd; params: Record<string, any> }) {
  9. const commandId = addTxnRecord({ ...params, category: "task" });
  10. return httpRequest<BaseResponse<string>>({ url: "/api/cmd/", params: { ...params, commandId }, method: "POST" });
  11. }