外观
API 接口文档
本文档描述 xt-pms(小微模具制造与注塑企业生产管理系统)后端 HTTP 接口的整体结构、模块划分与各端点的用途。其目的在于为前端对接、第三方集成与测试提供统一的接口索引。
数据来源与约定
- 接口定义来自
server/internal/router/*的路由注册,服务基于 Gin 框架,所有业务接口挂载在根路径/api之下(另有少量根路径公开端点,见对应章节)。- 路由中的路径参数使用 Gin 语法(如
:id、orderId),调用时替换为实际值。- 大部分接口需要 JWT 认证(请求头
Authorization: Bearer <token>);少数公开接口(登录、验证码、字典版本、系统信息、外发公开报工、健康检查)无需认证,已在各章节标注。- 接口访问同时受菜单权限控制(
middleware.RequirePerm/RequireAnyPerm);写操作通常同时接受对应:list权限,便于"列表页内联提交"。权限码形如mold:mold:list,详见各章节。
通用约定
- Base URL:
http://<host>:<port>/api - 认证:除特别标注为「公开」的接口外,均需在请求头携带
Authorization: Bearer <token>。 - 路径参数:以
:param形式出现(如/mold/:id中的:id)。 - 请求体:写操作(
POST/PUT)一般接收application/json主体。 - 权限:端点说明中的「权限」列给出该接口依赖的权限码(以
system:user:list这类格式表示,部分写操作以RequireAnyPerm同时放行:list权限)。
系统 / 认证 (system)
系统模块包含登录认证、用户/角色/部门/菜单管理、字典与配置、通知、操作日志、收款账户、系统更新等。路由组前缀 /system。
公开接口(无需 JWT):
GET
/system/captcha获取登录图形验证码(带 IP 限流)
POST
/system/login用户登录获取 JWT(带 IP 限流,每 IP 每分钟最多 10 次)
GET
/system/dict/version查询字典版本(供前端轮询;无需 JWT)
GET
/system/system-info获取系统信息配置(无需 JWT)
需认证接口:
GET
/system/profile登录即可获取当前用户信息
PUT
/system/profile登录即可更新当前用户
POST
/system/profile/password登录即可修改密码
GET
/system/profile/statistics登录即可获取个人统计
GET
/system/userssystem:user:list用户列表
GET
/system/users/:idsystem:user:list用户详情
POST
/system/userssystem:user:create创建用户
PUT
/system/userssystem:user:update更新用户
DELETE
/system/users/:idsystem:user:delete删除用户
PUT
/system/users/statussystem:user:update批量更新用户状态
PUT
/system/users/:id/reset-pwdsystem:user:update重置密码
PUT
/system/users/:id/unlocksystem:user:update解锁用户
GET
/system/rolessystem:role:list角色列表
GET
/system/roles/:idsystem:role:list角色详情
POST
/system/rolessystem:role:create创建角色
PUT
/system/rolessystem:role:update更新角色
DELETE
/system/roles/:idsystem:role:delete删除角色
GET
/system/deptssystem:dept:list部门列表
GET
/system/depts/:idsystem:dept:list部门详情
POST
/system/deptssystem:dept:list创建部门
PUT
/system/deptssystem:dept:list更新部门
DELETE
/system/depts/:idsystem:dept:list删除部门
PUT
/system/depts/:id/statussystem:dept:list更新部门状态
GET
/system/company登录即可获取公司信息
PUT
/system/companysystem:company:list更新公司信息
POST
/system/company/logosystem:company:list上传公司 Logo
DELETE
/system/company/logosystem:company:list删除公司 Logo
GET
/system/menus登录即可获取当前用户菜单树
GET
/system/menus/:idsystem:menu:list菜单详情
POST
/system/menussystem:menu:create创建菜单
PUT
/system/menussystem:menu:update更新菜单
DELETE
/system/menus/:idsystem:menu:delete删除菜单
GET
/system/role-menus/treesystem:role:assign-perm角色菜单树
GET
/system/roles/:id/menussystem:role:assign-perm角色已分配菜单
POST
/system/role-menussystem:role:assign-perm分配角色菜单
GET
/system/user/permissions登录用户必调获取当前用户权限
GET
/system/dict-typessystem:dict:list字典类型列表
GET
/system/dict-types/:idsystem:dict:list字典类型详情
POST
/system/dict-typessystem:dict:list创建字典类型
PUT
/system/dict-typessystem:dict:list更新字典类型
DELETE
/system/dict-types/:idsystem:dict:list删除字典类型
GET
/system/dict-datasystem:dict:list按类型查字典数据
GET
/system/dict-data-by-idsystem:dict:list按 ID 查字典数据
GET
/system/dict-data-pagesystem:dict:list字典数据分页
PUT
/system/dict-datasystem:dict:list更新字典数据(系统内置状态只读+可编辑颜色/备注)
POST
/system/dict-data/clear-cachesystem:dict:list清除字典缓存
POST
/system/dict-data/restore-seedsystem:dict:list恢复字典种子
POST
/system/dict-data/restore-production-seedsystem:dict:list恢复生产字典种子
POST
/system/business-dict-datasystem:dict:list创建业务字典数据
PUT
/system/business-dict-datasystem:dict:list更新业务字典数据
DELETE
/system/business-dict-data/:idsystem:dict:list删除业务字典数据
GET
/system/status-flow-configssystem:process-template:list状态流转配置列表
GET
/system/status-flow-configs/:idsystem:process-template:list状态流转配置详情
GET
/system/print-notice-configsystem:print-config:list获取打印通知单配置
POST
/system/print-notice-configsystem:print-config:list保存打印通知单配置
POST
/system/print-notice-config/resetsystem:print-config:list重置打印通知单配置
PUT
/system/system-infosystem:settings:list更新系统信息
POST
/system/faviconsystem:settings:list上传站点图标
DELETE
/system/faviconsystem:settings:list删除站点图标
POST
/system/cleanup-orphan-filessystem:settings:list清理孤立文件
GET
/system/cleanup-orphan-files/countsystem:settings:list孤立文件计数
GET
/system/cleanup-configsystem:settings:list获取清理配置
PUT
/system/cleanup-configsystem:settings:list更新清理配置
GET
/system/security-configsystem:settings:list获取安全配置
PUT
/system/security-configsystem:settings:list更新安全配置
GET
/system/notifications登录即可通知分页
GET
/system/notifications/types登录即可通知类型
GET
/system/notifications/unread-count登录即可未读通知数
PUT
/system/notifications/:id/read登录即可标记已读
PUT
/system/notifications/read-all登录即可全部已读
DELETE
/system/notifications/:id登录即可删除通知
POST
/system/notifications/test登录即可测试发送通知
GET
/system/notification-configs登录即可通知配置列表
GET
/system/notification-configs/types登录即可通知配置类型
POST
/system/notification-configs登录即可创建通知配置
PUT
/system/notification-configs登录即可更新通知配置
DELETE
/system/notification-configs/:id登录即可删除通知配置
GET
/system/oper-logssystem:oper-log:list操作日志列表
GET
/system/oper-logs/:idsystem:oper-log:list操作日志详情
GET
/system/oper-log/exportsystem:oper-log:list导出操作日志
GET
/system/oper-log/oper-typessystem:oper-log:list操作类型选项
GET
/system/receiving-accountssystem:receiving-account:list收款账户列表
GET
/system/receiving-accounts/:idsystem:receiving-account:list收款账户详情
POST
/system/receiving-accountssystem:receiving-account:list创建收款账户
PUT
/system/receiving-accountssystem:receiving-account:list更新收款账户
DELETE
/system/receiving-accounts/:idsystem:receiving-account:list删除收款账户
POST
/system/receiving-accounts/batch-deletesystem:receiving-account:list批量删除收款账户
PUT
/system/receiving-accounts/:id/statussystem:receiving-account:list更新收款账户状态
GET
/system/update/checksystem:settings:list检查系统更新
POST
/system/update/downloadsystem:settings:list下载更新包
POST
/system/update/applysystem:settings:list应用更新
POST
/system/update/restartsystem:settings:list重启服务
GET
/system/update/install-infosystem:settings:list获取安装信息
基础资料 (basic)
基础资料模块管理客户、仓库、工序、供应商、加工商等主数据。路由组前缀 /basic。列表/写操作权限统一为对应 :list 权限。
GET
/basic/customersystem:customer:list客户列表
GET
/basic/customer/:idsystem:customer:list客户详情
POST
/basic/customersystem:customer:list创建客户
PUT
/basic/customersystem:customer:list更新客户
DELETE
/basic/customer/:idsystem:customer:list删除客户
POST
/basic/customer/batch-deletesystem:customer:list批量删除客户
GET
/basic/warehousesystem:warehouse:list仓库列表
GET
/basic/warehouse/:idsystem:warehouse:list仓库详情
POST
/basic/warehousesystem:warehouse:list创建仓库
PUT
/basic/warehousesystem:warehouse:list更新仓库
DELETE
/basic/warehouse/:idsystem:warehouse:list删除仓库
POST
/basic/warehouse/batch-deletesystem:warehouse:list批量删除仓库
GET
/basic/processsystem:process-template:list工序列表
GET
/basic/process/:idsystem:process-template:list工序详情
POST
/basic/processsystem:process-template:list创建工序
PUT
/basic/processsystem:process-template:list更新工序
DELETE
/basic/process/:idsystem:process-template:list删除工序
GET
/basic/suppliersystem:processor-supplier:list供应商列表
GET
/basic/supplier/:idsystem:processor-supplier:list供应商详情
POST
/basic/suppliersystem:processor-supplier:list创建供应商
PUT
/basic/suppliersystem:processor-supplier:list更新供应商
DELETE
/basic/supplier/:idsystem:processor-supplier:list删除供应商
POST
/basic/supplier/batch-deletesystem:processor-supplier:list批量删除供应商
GET
/basic/processorsystem:processor-supplier:list加工商列表
GET
/basic/processor/:idsystem:processor-supplier:list加工商详情
POST
/basic/processorsystem:processor-supplier:list创建加工商
PUT
/basic/processorsystem:processor-supplier:list更新加工商
DELETE
/basic/processor/:idsystem:processor-supplier:list删除加工商
POST
/basic/processor/batch-deletesystem:processor-supplier:list批量删除加工商
模具管理 (mold)
模具模块覆盖模具档案、模具订单、模具工单、工单工序、试模、交付、库存、图片、产品关联、订单款项与工序模板。路由组前缀 /mold,另有独立的 /mold-product-relation、/mold-order、/process-template 子组。
模具档案 / 订单 / 工单
GET
/moldmold:mold:list模具列表
GET
/mold/statisticsmold:mold:list模具统计
GET
/mold/:idmold:mold:list模具详情
POST
/moldmold:mold:create 或 :list创建模具
PUT
/moldmold:mold:update 或 :list更新模具
DELETE
/mold/:idmold:mold:delete 或 :list删除模具
GET
/mold/ordersmold:order:list模具订单列表
GET
/mold/order/:idmold:order:list模具订单详情
POST
/mold/orders/fix-statusmold:order:update 或 :list修复订单状态
POST
/mold/ordermold:order:create 或 :list创建模具订单
PUT
/mold/ordermold:order:update 或 :list更新模具订单
DELETE
/mold/order/:idmold:order:delete 或 :list删除模具订单
GET
/mold/work-ordersmold:work-order:list模具工单列表
GET
/mold/work-order/:idmold:work-order:list模具工单详情
POST
/mold/work-ordermold:work-order:create 或 :list创建模具工单
PUT
/mold/work-ordermold:work-order:update 或 :list更新模具工单
DELETE
/mold/work-order/:idmold:work-order:delete 或 :list删除模具工单
POST
/mold/work-order/cancelmold:work-order:update 或 :list取消模具工单
GET
/mold/work-order/:id/processesmold:work-order:list工单工序列表
POST
/mold/work-order/process/togglemold:work-order:list切换工序完成状态
试模 / 交付 / 库存 / 图片
GET
/mold/try-testsmold:mold:list试模记录列表
POST
/mold/try-testmold:mold:list创建试模记录
PUT
/mold/try-test/:idmold:mold:list更新试模记录
DELETE
/mold/try-test/:idmold:mold:list删除试模记录
GET
/mold/deliveriesmold:mold:list模具交付列表
POST
/mold/deliverymold:mold:list创建模具交付
GET
/mold/stocksmold:mold:list模具库存列表
POST
/mold/stockmold:mold:list创建模具库存变更
GET
/mold/:id/imagesmold:mold:list模具图片列表
POST
/mold/:id/images/attachmold:mold:list关联图片文件
DELETE
/mold/images/:imageIdmold:mold:list删除模具图片
PUT
/mold/:id/images/:imageId/primarymold:mold:list设置主图
模具产品关联 / 订单款项 / 工序模板
GET
/mold-product-relation/by-moldmold:mold:list按模具查产品关联
GET
/mold-product-relation/by-productmold:mold:list按产品查模具关联
GET
/mold-product-relation/by-itemmold:mold:list按订单明细查关联
POST
/mold-product-relationmold:mold:list创建关联
DELETE
/mold-product-relation/:idmold:mold:list删除关联
GET
/mold-order/:orderId/paymentsmold:order:list订单款项列表
GET
/mold-order/payments/by-work-order/:workOrderIdmold:order:list按工单查款项
GET
/mold-order/payments/:idmold:order:list款项详情
POST
/mold-order/paymentsmold:order:list创建款项
PUT
/mold-order/payments/:idmold:order:list更新款项
DELETE
/mold-order/payments/:idmold:order:list删除款项
GET
/mold-order/:orderId/payment-statsmold:order:list款项统计
POST
/mold-order/payments/replace-by-work-ordermold:order:list按工单替换款项
GET
/process-templatesystem:process-template:list工序模板列表
GET
/process-template/activesystem:process-template:list启用中的工序模板
POST
/process-templatesystem:process-template:list创建工序模板
PUT
/process-templatesystem:process-template:list更新工序模板
DELETE
/process-template/:idsystem:process-template:list删除工序模板
产品管理 (product)
产品模块管理产品档案、产品 BOM 与产品库存。路由组前缀 /product;库存相关接口复用 production:stock:list 权限。
GET
/productproduct:list产品列表
POST
/product/syncproduct:list同步产品
GET
/product/:idproduct:list产品详情
POST
/productproduct:list创建产品
PUT
/productproduct:list更新产品
DELETE
/product/:idproduct:list删除产品
GET
/product/generate-codeproduct:list生成产品编码
GET
/product/bomsproduct:list产品 BOM 列表
POST
/product/bomproduct:list创建产品 BOM
PUT
/product/bomproduct:list更新产品 BOM
DELETE
/product/bom/:idproduct:list删除产品 BOM
GET
/product/stocksproduction:stock:list产品库存列表
GET
/product/stocks/:idproduction:stock:list库存详情
POST
/product/stockproduction:stock:list创建库存
PUT
/product/stockproduction:stock:list更新库存
POST
/product/stock/inproduction:stock:list产品入库
POST
/product/stock/outproduction:stock:list产品出库
GET
/product/stock/safe-checkproduction:stock:list安全库存检查
生产管理 (production)
生产模块覆盖生产订单全生命周期、生产报工、外发加工、模具使用记录、库存出入库、外来模具档案等。路由组前缀 /production。
生产订单
GET
/production/ordersproduction:order:list生产订单列表
GET
/production/orders/:idproduction:order:list生产订单详情
GET
/production/mold/:mold_id/production-itemsproduction:order:list按模具查生产明细
POST
/production/orderproduction:order:create 或 :list创建生产订单
PUT
/production/orderproduction:order:update 或 :list更新生产订单
DELETE
/production/order/:idproduction:order:delete 或 :list取消生产订单
POST
/production/order/:id/startproduction:order:update 或 :list开始生产
POST
/production/order/:id/completeproduction:order:update 或 :list完成生产
POST
/production/order/stock-inproduction:order:update 或 :list生产入库
POST
/production/order/:id/shipmentproduction:order:update 或 :list发货
POST
/production/order/:id/finishproduction:order:update 或 :list完结订单
POST
/production/order/:id/replenishproduction:order:update 或 :list补货发货
POST
/production/order/item/:item_id/finishproduction:order:update 或 :list完结订单明细
GET
/production/order/:id/actionsproduction:order:list获取可用操作
生产报工 / 外发 / 模具使用 / 统计
POST
/production/reportproduction:work-report:submit 或 :list提交生产报工
GET
/production/reportsproduction:work-report:list报工列表
GET
/production/outsourcingproduction:order:list外发记录列表
GET
/production/outsourcing/listproduction:order:list按类型查外发记录
POST
/production/outsourcingproduction:order:create 或 :list创建外发记录
POST
/production/outsourcing/:id/sendproduction:order:update 或 :list发出外发
POST
/production/outsourcing/:id/receiveproduction:order:update 或 :list收回外发
POST
/production/outsourcing/:id/reportproduction:order:update 或 :list外发报工
POST
/production/outsourcing/:id/share-tokenproduction:order:update 或 :list生成分享令牌
POST
/production/outsourcing/:id/regenerate-tokenproduction:order:update 或 :list重新生成分享令牌
GET
/production/outsourcing/:id/reportsproduction:order:list外发报工列表
POST
/production/mold-usageproduction:order:create 或 :list创建模具使用记录
GET
/production/mold/:mold_id/usage-historymold:usage-history:list模具使用历史
GET
/production/mold/usage-historymold:usage-history:list模具使用历史(全部)
GET
/production/mold/:mold_id/usage-statsmold:usage-history:list模具使用统计
GET
/production/statisticsproduction:order:list生产统计
库存 / 出入库 / 外来模具
GET
/production/stock/product-listproduction:stock:list产品库存列表
POST
/production/stock/deleteproduction:stock:out 或 :list删除库存
GET
/production/stock/ext/:external_mold_code/recordsproduction:stock:list按外来模具编码查库存记录
GET
/production/stock/:mold_id/recordsproduction:stock:list按模具查库存记录
GET
/production/stock-in/listproduction:stock:list入库单列表
GET
/production/stock-in/:idproduction:stock:list入库单详情
PUT
/production/stock-inproduction:stock:in 或 :list更新入库单
POST
/production/stock/directproduction:stock:in 或 :list直接入库
POST
/production/stock/checkproduction:stock:in 或 :list库存盘点
GET
/production/stock/statisticsproduction:stock:list库存统计
GET
/production/stock/trendproduction:stock:list库存趋势
POST
/production/stock-outproduction:stock-out:create 或 :list出库
GET
/production/stock-out/listproduction:stock-out:list出库单列表
GET
/production/stock-out/:idproduction:stock-out:list出库单详情
PUT
/production/stock-out/:idproduction:stock-out:update 或 :list更新出库单
GET
/production/stock-out/mold/:mold_id/recordsproduction:stock-out:list按模具查出库记录
GET
/production/stock-out/ext/:external_mold_code/recordsproduction:stock-out:list按外来模具编码查出库记录
GET
/production/stock-out/recognize-expressproduction:stock-out:list识别快递公司
POST
/production/stock-out/list-for-printproduction:stock-out:list打印用出库列表
POST
/production/stock/currentproduction:stock-out:list当前库存
GET
/production/external-mold-archive/queryproduction:order:list按编码查外来模具档案
GET
/production/external-mold-archive/listproduction:order:list外来模具档案列表
PUT
/production/external-mold-archive/:idproduction:order:list更新外来模具档案
DELETE
/production/external-mold-archive/:idproduction:order:list删除外来模具档案
综合订单 (master order)
综合订单将模具订单与生产订单合并管理,实现"先制模具、后做产品"的一体化流程。路由组前缀 /master-orders,权限统一为 order-management:list。
POST
/master-ordersorder-management:list创建综合订单
GET
/master-ordersorder-management:list综合订单列表
GET
/master-orders/:idorder-management:list综合订单详情
PUT
/master-orders/:idorder-management:list编辑综合订单
POST
/master-orders/:id/cancelorder-management:list取消综合订单
财务管理 (finance)
财务模块管理应收账款、应付账款与费用。路由组前缀 /finance。
应收账款
GET
/finance/receivablesfinance:receivable:list应收列表
GET
/finance/receivables/by-order/:orderId/:orderType动态判断按订单查应收
GET
/finance/receivables/:idfinance:receivable:list应收详情
POST
/finance/receivablesfinance:receivable:list创建应收
PUT
/finance/receivables/:idfinance:receivable:list更新应收
DELETE
/finance/receivables/:idfinance:receivable:list删除应收
POST
/finance/receivables/:id/receivefinance:receivable:list收款核销
GET
/finance/receivables/:id/paymentsfinance:receivable:list收款记录
PUT
/finance/receivables/payments/:paymentIdfinance:receivable:list更新收款记录
GET
/finance/receivables/overduefinance:receivable:list逾期应收
GET
/finance/receivables/aging-statsfinance:receivable:list账龄统计
应付账款 / 费用
GET
/finance/payablesfinance:payable:list应付列表
GET
/finance/payables/:idfinance:payable:list应付详情
POST
/finance/payablesfinance:payable:list创建应付
PUT
/finance/payables/:idfinance:payable:list更新应付
DELETE
/finance/payables/:idfinance:payable:list删除应付
POST
/finance/payables/:id/payfinance:payable:list付款
GET
/finance/payables/:id/paymentsfinance:payable:list付款记录
GET
/finance/payables/overduefinance:payable:list逾期应付
GET
/finance/expensesfinance:expense:list费用列表
GET
/finance/expenses/statsfinance:expense:list费用汇总统计
GET
/finance/expenses/:idfinance:expense:list费用详情
POST
/finance/expensesfinance:expense:list创建费用
PUT
/finance/expenses/:idfinance:expense:list更新费用
DELETE
/finance/expenses/:idfinance:expense:list删除费用
POST
/finance/expenses/:id/payfinance:expense:list费用付款
GET
/finance/expenses/:id/paymentsfinance:expense:list费用付款记录
GET
/finance/expenses/delivery/:delivery_idfinance:expense:list按交付查费用
数据看板 (dashboard)
数据看板提供经营概览与各类统计图表数据。路由组前缀 /dashboard;基础看板需 dashboard:base,财务/明细类需 dashboard:detail。
GET
/dashboard/overviewdashboard:base经营概览
GET
/dashboard/production-trenddashboard:base生产趋势
GET
/dashboard/mold-statusdashboard:base模具状态分布
GET
/dashboard/order-rankingdashboard:base订单排名
GET
/dashboard/in-production-moldsdashboard:base生产中模具
GET
/dashboard/in-progress-mold-ordersdashboard:base进行中模具订单
GET
/dashboard/in-progress-production-ordersdashboard:base进行中生产订单
GET
/dashboard/finance-overviewdashboard:detail财务概览
GET
/dashboard/detail-overviewdashboard:detail明细概览
GET
/dashboard/detail-production-trenddashboard:detail明细生产趋势
GET
/dashboard/delivery-punctualitydashboard:detail交付准时率
公共引用数据 (reference)
公共引用数据接口用于各页面下拉/选择器数据,仅需 JWT 认证(无额外菜单权限),以避免跨模块 403。路由组前缀 /reference。
GET
/reference/customers客户下拉
GET
/reference/customers/:id客户详情
GET
/reference/warehouses仓库下拉
GET
/reference/processes工序下拉
GET
/reference/suppliers供应商下拉
GET
/reference/processors加工商下拉
GET
/reference/process-templates工序模板下拉
GET
/reference/process-templates/active启用中工序模板
GET
/reference/dict-data字典数据下拉
GET
/reference/dict-data-by-id按 ID 查字典数据
GET
/reference/dict-types字典类型下拉
GET
/reference/status-flow-configs状态流转配置下拉
GET
/reference/status-flow-configs/:id状态流转配置详情
GET
/reference/company公司信息(打印等场景)
GET
/reference/print-notice-config打印通知单配置
GET
/reference/receiving-accounts收款账户下拉
GET
/reference/receiving-accounts/:id收款账户详情
GET
/reference/molds模具档案下拉
GET
/reference/molds/:id模具详情
GET
/reference/products产品下拉
GET
/reference/products/:id产品详情
GET
/reference/mold-product-relations/by-mold按模具查关联
GET
/reference/mold-product-relations/by-product按产品查关联
文件上传 (upload)
文件上传接口不单独设权限,由前端页面权限间接控制。上传组前缀 /upload;文件下载接口挂载在根路径 /files(非 /api)。
POST
/upload/image上传图片
POST
/upload/files上传文件
POST
/upload/generate-thumbnails补全缺失缩略图
GET
/files/:id/download按文件 ID 下载(根路径,Content-Disposition 返回原始文件名)
公开 / 实时接口 (public)
以下接口允许免登录或无需业务菜单权限访问,供外部加工商报工、健康检查、实时通知等场景使用。
GET
/api/ping连通性测试(返回 `pong`)
GET
/api/wsWebSocket 实时通知(token 经查询参数传入,内部自行校验)
GET
/api/public/outsourcing/:token加工商凭分享令牌查看外发任务(免登录)
POST
/api/public/outsourcing/:token/report加工商免登录报工
POST
/api/public/outsourcing/:token/process/toggle加工商免登录切换工序状态
GET
/health健康检查(根路径,供负载均衡/监控)
GET
/api/debug/metrics性能监控指标(需 JWT)
GET
/api/debug/pool连接池状态(需 JWT)
GET
/api/debug/health完整健康检查(需 JWT)
GET
/api/search全局搜索(需 JWT,无独立权限)
其他说明
- 权限模型:接口通过
middleware.RequirePerm(perm)或RequireAnyPerm([]string{...})校验菜单权限。写操作大多以RequireAnyPerm同时放行:create/:update/:delete与:list,即拥有列表权限的用户通常也能在列表页内联提交写操作。 - 路径参数:Gin 框架以
:声明路径参数(如/mold/:id),实际请求需替换为具体值(如/mold/12)。 - 外发公开链路:
/api/public/outsourcing/:token/*供加工商免登录使用,token由POST /production/outsourcing/:id/share-token生成,可经regenerate-token重新生成。 - 响应格式:接口统一返回 JSON;具体响应体结构以代码中 controller/handler 实现为准(本文档聚焦路由与用途,未逐接口罗列请求/响应字段)。
- 字典与引用数据:前端通常先调用
/reference/*或/system/dict-data拉取下拉选项,再提交业务表单;字典取值与中文标签详见《术语对照表》。