Files
bj_power/bj_power_workstation/internal/config/config.go
T
SunYF 0ab21b1234 feat&refactor: 完成多模块功能迭代与配置优化
本次提交覆盖多个业务模块的功能完善与体验优化:
1.  **鉴权与配置调整**:
    - 统一JWT滑动续签逻辑,简化Token存储,移除RefreshToken相关冗余代码
    - 调整多项目配置文件中JWT过期时间为3600秒,统一会话闲置窗口
    - 工位配置放开1~12限制,改为仅校验大于0
2.  **术语统一替换**:全链路将"精密件"替换为"电气件",修正物料管理描述
3.  **功能新增**:
    - 新增工位类型、工艺路线与产线点位台账模块
    - 添加工艺PDF预览面板、工位终端代理转发接口
    - 新增操作日志按操作人列表筛选、工位登出日志记录
    - 新增PLC移料指令与产线点位状态管理
4.  **业务流程优化**:
    - 调整BOM物料删除校验逻辑,优化工单备料计算
    - 补充物料图号、检测单号等追溯字段
    - 完善工艺流程图与工位绑定关系说明
    - 优化前端页面文案与交互细节
5.  **代码规范与维护**:
    - 新增通用工具函数与前端静态资源
    - 整理路由权限与中间件逻辑
    - 修复部分接口与配置的不兼容问题
2026-09-10 16:59:15 +08:00

55 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package config
import (
"github.com/zeromicro/go-zero/rest"
)
// AuthConfig JWT 登录鉴权配置
// go-zero conf 仅识别 json 标签(yaml/toml 统一转为 JSON 后按此映射)
type AuthConfig struct {
AccessSecret string `json:",default=Hardman_2026"`
AccessExpire int64 `json:",default=1800"` // 有效期(秒)
}
// MesConfig MES 服务地址(内部 API
type MesConfig struct {
BaseURL string `json:",default=http://127.0.0.1:8888"`
}
// InternalConfig 项目间内部 API 写死 token(请求头 X-API-TOKEN
type InternalConfig struct {
Token string `json:",default=Hardman_2026"`
}
// SimConfig 内置模拟拧紧枪数据源开关
type SimConfig struct {
Enable bool `json:",default=true"`
}
// SqliteConfig 本地 SQLite 缓存库
type SqliteConfig struct {
Path string `json:",default=workstation.db"`
}
// StationConfig 工位配置:启动时由 yaml 加载到内存,固定本终端工位号。
// 一个工位一个终端,终端不允许修改工位;变更工位只能改配置并重启服务。
type StationConfig struct {
StationNo int `json:",default=1"` // 固定工位号,启动时校验范围
ScrewCount int `json:",default=10"` // 本工位需拧紧的螺丝颗数(进度 9/10 用)
}
// PdfCacheConfig 工艺文件 PDF 本地预缓存目录
type PdfCacheConfig struct {
Dir string `json:",default=pdf_cache"` // 本地缓存目录;留空关闭缓存
}
type Config struct {
rest.RestConf
Auth AuthConfig `json:",optional"`
Mes MesConfig `json:",optional"`
Internal InternalConfig `json:",optional"`
Sim SimConfig `json:",optional"`
Sqlite SqliteConfig `json:",optional"`
Station StationConfig `json:",optional"`
PdfCache PdfCacheConfig `json:",optional"`
}