wanshenmean
2026-03-11 a8f45091019012eeafec563913dee71cda3d9790
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -1,5 +1,5 @@
{
  "urls": "http://*:9291", //web服务端口,如果用IIS部署,把这个去掉
  "urls": "http://*:9292", //web服务端口,如果用IIS部署,把这个去掉
  "Logging": {
    "LogLevel": {
      "Default": "Information",
@@ -38,11 +38,56 @@
  "ApiName": "WIDESEAWCS",
  "ExpMinutes": 120,
  "QuartzJobAutoStart": true,
  "DBSeedEnable": true,
  "QuartzDBSeedEnable": true,
  "DBSeedEnable": false,
  "QuartzDBSeedEnable": false,
  "LogDeubgEnable": false, //是否记录调试日志
  "PrintSql": true, //打印SQL语句
  "LogAOPEnable": true, //是否记录AOP日志
  "PrintSql": false, //打印SQL语句
  "LogAOPEnable": false, //是否记录AOP日志
  "WebSocketEnable": true, //是否开启WebSocket服务
  "WebSocketPort": 9296 //WebSocket服务端口
  "WebSocketPort": 9296, //WebSocket服务端口
  "SocketServer": {
    "Enabled": true, //是否启用Socket服务器
    "Port": 2000, //监听端口
    "IpAddress": "0.0.0.0", //监听地址,
    "Backlog": 1000, //最大连接数
    "EncodingName": "utf-8", //编码方式
    "AutoDetectEncoding": true, //是否自动检测编码
    "IdleTimeoutSeconds": 0, //空闲超时时间,单位秒,0表示不超时
    "EnableHeartbeat": true, //是否启用心跳检测
    "LogFilePath": "socketserver.log" //日志文件路径
  },
  "CheckPalletPositions": [
    {
      "Code": "11068",
      "WarehouseId": 1
    }
  ],
  "RedisConfig": {
    "Enabled": true, //是否启用Redis,false时仅使用内存缓存
    "ConnectionString": "127.0.0.1:6379,password=P@ssw0rd,defaultDatabase=0,connectTimeout=5000,abortConnect=false", //Redis连接字符串
    "InstanceName": "WIDESEAWCS:", //实例名称,用于区分不同应用
    "DefaultDatabase": 0, //默认数据库索引(0-15)
    "EnableSentinel": false, //是否启用哨兵模式
    "SentinelMasterName": "mymaster", //哨兵主节点名称
    "SentinelEndpoints": [], //哨兵节点地址列表,如 ["sentinel1:26379","sentinel2:26379"]
    "PoolSize": 10, //连接池大小
    "ConnectRetry": 3, //连接失败重试次数
    "SerializerType": "Newtonsoft", //序列化方式:Newtonsoft
    "FallbackToMemory": true, //Redis不可用时是否降级到内存缓存
    "KeyPrefix": "wcs:", //全局Key前缀,用于隔离不同系统的数据
    "EnableL1Cache": false, //是否启用L1内存缓存层。禁用后只使用Redis,适用于需要外部修改Redis数据的场景
    "EnableAutoSync": false, //是否启用Redis到内存缓存的自动同步
    "SyncIntervalSeconds": 30, //自动同步间隔时间(秒),建议30-60秒
    "SyncBatchSize": 1000, //同步时单次批量获取的Redis key数量上限
    "SyncExcludePrefixes": [ "wcs:Code:SocketDevices:" ], //排除设备状态key不参与自动同步(防止覆盖本地修改)
    "Monitoring": {
      "Enabled": false, //是否启用监控
      "SlowLogThresholdMs": 100, //慢查询阈值(毫秒)
      "HealthCheckIntervalSeconds": 30 //健康检查间隔(秒)
    },
    "Eviction": {
      "DefaultExpirationSeconds": 3600, //默认缓存过期时间(秒)
      "MaxMemoryPolicy": "allkeys-lru" //内存淘汰策略:allkeys-lru, volatile-lru, noeviction等
    }
  }
}