import express from "express";

import fn from "../entity/function.js";
const { autoRegisterRouter } = require("@/config/index.js");
let router = express.Router();

// 执行打印命令
router.post("/toPrint", fn.toPrint);
// 打印日志添加
router.post("/writePrintLog", fn.writePrintLog);
// 登录接口
router.post("/factory/login", fn.login);
// 获取本地文件返回
router.post("/getPngImg", fn.getPngImg);
// 上传文件到本地
router.post("/uploadImage", fn.uploadImage);
// 获取公司列表
router.get("/tools/getCompanyList", fn.getCompanyList);
// 提交授权申请
router.post("/commitApply", fn.commitApply);
// 下载素材到本地

router.post("/downloadByDesignId", fn.downloadByDesignId);
// 获取 生产单号返回素材地址
autoRegisterRouter(
  router,
  "downloadBySubOrderNumber",
  fn.downloadBySubOrderNumber
);
// 提交生产完成
autoRegisterRouter(router, "completeDelivery", fn.completeDelivery);
// 查询版本更新
router.get("/manage/rest/app/checkUpdate", fn.checkUpdate);
// 增量更新
router.post("/incrementalUpdates", fn.incrementalUpdates);
// 裁切单个图片的透明白边
router.post("/imageTransparentEdges", fn.imageTransparentEdges);
// 裁切图片目录中的所有图片的透明白边
router.post("/imageListTransparentEdges", fn.imageListTransparentEdges);
// 处理图片并输出结果
router.post("/processImage", fn.processImage);

// 删除图片
router.post("/cleanDirectorySync", fn.cleanDirectorySync);

// 保存生成后得图片返回地址
router.post("/saveToPng", fn.saveToPng);

// 保存生成后得图片返回地址
router.post("/getAllCountry", fn.getAllCountry);

//根据图片地址保存文件到本地
router.post("/saveImgByUrl", fn.saveImgByUrl);

//复制文件夹下文件
router.post("/copySingleImageFn", fn.copySingleImageFn);

// 根据生产单号查询详情
autoRegisterRouter(router, "findByPodProductionNo", fn.findByPodProductionNo);

autoRegisterRouter(
  router,
  "processTransparentBackground",
  fn.processTransparentBackground
);
//操作单状态
autoRegisterRouter(router, "scanProduce", fn.scanProduce);
//检查库存
autoRegisterRouter(router, "checkInventory", fn.checkInventory);

export { router as default };
