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
+10 -11
View File
@@ -73,10 +73,10 @@ func validateTask(task *Task) bool {
}
for _, detail := range task.Details {
if detail != nil && detail.Reason == "" {
detail.Reason = "same batch contains validation failure; upstream request was skipped"
detail.Reason = "同批次存在校验失败卡,本卡未请求上游"
}
}
task.FailureReason = "batch validation failed; upstream request was skipped"
task.FailureReason = "批次校验未通过,未发起上游请求"
return false
}
@@ -85,7 +85,7 @@ func validateDetail(operation Operation, detail *Detail) {
return
}
if detail.Card == nil {
detail.Reason = "ICCID does not exist in SIM card records"
detail.Reason = "ICCID不存在或不属于当前租户"
return
}
detail.MSISDN = strings.TrimSpace(detail.Card.MSISDN)
@@ -94,21 +94,20 @@ func validateDetail(operation Operation, detail *Detail) {
detail.StatusBefore = detail.Card.BossCardStatus
if !detail.Authorized {
detail.Reason = "ICCID is outside the current operator authorization scope"
detail.Reason = "ICCID不在当前操作员授权范围内"
return
}
var reasons []string
if detail.ChanKey == "" {
detail.Reason = "ICCID is missing chanKey"
return
reasons = append(reasons, "ICCID缺少通道标识")
}
if detail.InputMSISDN != "" && detail.InputMSISDN != detail.MSISDN {
detail.Reason = "MSISDN does not match the SIM card record"
return
reasons = append(reasons, "MSISDN与卡档案不一致")
}
if detail.InputIMSI != "" && detail.InputIMSI != detail.IMSI {
detail.Reason = "IMSI does not match the SIM card record"
return
reasons = append(reasons, "IMSI与卡档案不一致")
}
detail.Reason = strings.Join(reasons, ";")
// TODO: 正常系统开发完成后恢复卡状态限制
// 注释原因:开发环境经常出现卡状态不在预期可操作范围内的情况,先放行
// if detail.Card.BossCardStatus != operation.ExpectedStatus {
@@ -162,7 +161,7 @@ func (e *executor) changeSubBatch(ctx context.Context, task *Task, details []*De
if err != nil {
outcomes := make([]Outcome, len(details))
for index := range outcomes {
outcomes[index].Message = "upstream request failed: " + err.Error()
outcomes[index].Message = "请求上游失败:" + err.Error()
}
return outcomes
}