石墨消解 mock
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.

20 lines
426 B

5 months ago
5 months ago
5 months ago
  1. import express from "express";
  2. import { delay } from "../utils/helper";
  3. import { WsProxy } from "../utils/wss";
  4. const router = express.Router();
  5. router.post("/", async (req, res) => {
  6. await delay(200);
  7. setTimeout(() => {
  8. WsProxy.send({
  9. type: "cmd",
  10. data: {
  11. commandId: req.body.commandId,
  12. status: "D0000",
  13. },
  14. });
  15. }, 2000);
  16. res.json({ code: "00000", msg: "执行成功" });
  17. });
  18. export default router;