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("/createBatchFolder", fn.createBatchFolder);

//获下载原素材
router.post("/downloadMaterial", fn.downloadMaterial);

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

//获取生产配置
autoRegisterRouter(router, "productionConfig", fn.productionConfig);
//更新生产配置
autoRegisterRouter(router, "productionConfigUpdate", fn.productionConfigUpdate);
//排版列表（分页）
autoRegisterRouter(router, "productionSoftware", fn.productionSoftware);
//查询该批次下的所有素材
autoRegisterRouter(router, "listMaterialsByBatch", fn.listMaterialsByBatch);
//重新合成排版
autoRegisterRouter(
  router,
  "psReComposingDesignImages",
  fn.psReComposingDesignImages
);
//重新合成排版
autoRegisterRouter(
  router,
  "replenishmentComposingDesignImages",
  fn.replenishmentComposingDesignImages
);
//根据批次分页查询操作单
autoRegisterRouter(router, "listOperationByBatch", fn.listOperationByBatch);

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

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

export { router as default };
