sync: 同步 v1.0.4 开源代码并脱敏

This commit is contained in:
MiFaZhan
2026-10-29 14:52:43 +08:00
parent 32e4316ee4
commit 6893e21f07
136 changed files with 9851 additions and 436 deletions
+3 -2
View File
@@ -1,8 +1,9 @@
package consts
// BatchSubBatchSize 是批量开停数据 / 停复机执行时,单个上游通道每次请求携带的卡数量上限。
// 原来一个通道整组一次性发给 upstream-chan,大批量会触发 worker 侧 HTTP 超时(默认 2 分钟上限)导致整批失败。
// 按此值拆分为多个小请求后,每个请求都能在超时上限内返回。
// upstream-chan 对同一通道按卡串行调用运营商接口,单个请求耗时随卡数线性增长;
// 因此超时预算必须按「单卡预算 × 卡数」计算并配置足够上限(见 upstream.proxy.maxTimeout),
// 不能依赖固定 2 分钟上限,否则请求仍在上游办理就会被判失败。
const BatchSubBatchSize = 100
// BatchSubBatchConcurrency 是同一通道内子批次的并发度,受信号量限制:
+10 -4
View File
@@ -71,17 +71,23 @@ const (
BatchAsyncStatusSuccess = 3
BatchAsyncStatusFailed = 4
BatchAsyncStatusPartialSuccess = 5
BatchAsyncStatusUnknown = 6
BatchAsyncStatusReview = 6
BatchRunResultPending = 0
BatchRunResultRunning = 1
BatchRunResultSuccess = 2
BatchRunResultFailed = 3
BatchRunResultPartialSuccess = 4
BatchRunResultUnknown = 5
BatchRunResultReview = 5
BatchDetailStatusPending = 0
BatchDetailStatusRunning = 1
BatchDetailStatusSuccess = 2
BatchDetailStatusFailed = 3
BatchDetailStatusPending = 0
BatchDetailStatusRunning = 1
BatchDetailStatusSuccess = 2
BatchDetailStatusFailed = 3
BatchDetailStatusUnknown = 4
BatchDetailStatusNotExecuted = 5
ResourceTypeExcel = 1
DownloadStatusGenerated = 1
+3
View File
@@ -25,6 +25,9 @@ const (
QueueBatchRestartResumeDelay = "iotlcm.batch.restart.resume.delay"
QueuePackageCustomerSync = "iotlcm.package_customer.sync"
QueueChannelRefresh = "iotlcm.channel.refresh"
// QueueDataReviewQuery 承载"手动同步上游结果"命令:Admin 发布父批号,
// Worker 只对既有 operationId 做只读补查并回写,绝不重发办理。
QueueDataReviewQuery = "iotlcm.data.review.query"
// QueueBalanceRechargeDeadLetter 保存重试次数耗尽后仍失败的充值超时消息,
// 供人工排查(例如支付宝凭据未配置导致的永久失败),不再自动重投。
QueueBalanceRechargeDeadLetter = "iotlcm.balance.recharge.dlq"
+11
View File
@@ -0,0 +1,11 @@
package consts
const (
DefaultSystemTenantCode = "000000"
SuperAdminRoleId = int64(1)
SysRoleMenuDataScopeRole = "0"
SysRoleDataScopeAll = "1"
SysRoleDataScopeCustom = "2"
SysRoleDataScopeDeptAndBelow = "4"
QueueAgentRoleSync = "iotlcm.agent.role.sync"
)