Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
完成运营商实名回调、业务事件观测序列与受控配置装配,同时恢复 UR43 已交付的 packages[].remove 字段及旧响应兼容,统一更新 OpenSpec、OpenAPI 和交付文档。 Constraint: 七月测试环境里程碑不新增或运行自动化测试 Rejected: 以必填 operation_type 替换 packages[].remove | 会破坏已交付前端契约 Confidence: high Scope-risk: broad Directive: 后续修改系列套餐管理接口必须保持 packages[].remove 和 ShopSeriesGrantResponse 兼容 Tested: go run ./cmd/gendocs;go build -buildvcs=false ./...;openspec validate complete-july-iteration-test-release --strict;git diff --check Not-tested: 按本 Change 约定未运行 go test,真实运营商与 Gateway 联调延期
76 lines
3.4 KiB
Go
76 lines
3.4 KiB
Go
package constants
|
|
|
|
import "time"
|
|
|
|
const (
|
|
// IntegrationDirectionInbound 表示外部系统调用本系统。
|
|
IntegrationDirectionInbound = "inbound"
|
|
// IntegrationDirectionOutbound 表示本系统调用外部系统。
|
|
IntegrationDirectionOutbound = "outbound"
|
|
)
|
|
|
|
const (
|
|
// IntegrationProviderCTCC 表示中国电信回调提供方。
|
|
IntegrationProviderCTCC = "ctcc"
|
|
// IntegrationOperationCTCCRealnameCallback 表示中国电信实名结果回调。
|
|
IntegrationOperationCTCCRealnameCallback = "realname_callback"
|
|
// IntegrationProviderCMCC 表示中国移动回调提供方。
|
|
IntegrationProviderCMCC = "cmcc"
|
|
// IntegrationOperationCMCCRealnameCallback 表示中国移动实名结果回调。
|
|
IntegrationOperationCMCCRealnameCallback = "realname_callback"
|
|
// IntegrationProviderCUCC 表示中国联通回调提供方。
|
|
IntegrationProviderCUCC = "cucc"
|
|
// IntegrationOperationCUCCRealnameRemovalCallback 表示中国联通解除实名回调。
|
|
IntegrationOperationCUCCRealnameRemovalCallback = "realname_removal_callback"
|
|
// IntegrationOperationCUCCRealnameCallback 表示中国联通实名成功回调。
|
|
IntegrationOperationCUCCRealnameCallback = "realname_callback"
|
|
// IntegrationInboundProcessingLease 表示入站回调 pending 记录允许恢复前的处理租约。
|
|
IntegrationInboundProcessingLease = time.Minute
|
|
)
|
|
|
|
const (
|
|
// IntegrationResultPending 表示外部尝试已建立但尚未终结。
|
|
IntegrationResultPending = "pending"
|
|
// IntegrationResultSuccess 表示外部尝试成功。
|
|
IntegrationResultSuccess = "success"
|
|
// IntegrationResultFailed 表示外部尝试明确失败。
|
|
IntegrationResultFailed = "failed"
|
|
// IntegrationResultUnknown 表示请求已发出但结果未知,需要按记录的策略恢复。
|
|
IntegrationResultUnknown = "unknown"
|
|
// IntegrationResultNotFound 表示外部资源不存在。
|
|
IntegrationResultNotFound = "not_found"
|
|
// IntegrationResultInvalidPayload 表示入站载荷无效。
|
|
IntegrationResultInvalidPayload = "invalid_payload"
|
|
// IntegrationResultConflict 表示入站事实存在唯一性或幂等冲突。
|
|
IntegrationResultConflict = "conflict"
|
|
// IntegrationResultIgnored 表示外部尝试被安全忽略。
|
|
IntegrationResultIgnored = "ignored"
|
|
// IntegrationResultMerged 表示尝试被合并且未发送请求。
|
|
IntegrationResultMerged = "merged"
|
|
// IntegrationResultRateLimited 表示尝试因限频未发送请求。
|
|
IntegrationResultRateLimited = "rate_limited"
|
|
// IntegrationResultCompleted 表示业务已达预期,尝试提前完成且未发送请求。
|
|
IntegrationResultCompleted = "completed"
|
|
// IntegrationResultCancelled 表示尝试已取消。
|
|
IntegrationResultCancelled = "cancelled"
|
|
)
|
|
|
|
// IntegrationResultName 返回外部尝试结果的中文名称。
|
|
func IntegrationResultName(result string) string {
|
|
names := map[string]string{
|
|
IntegrationResultPending: "待处理",
|
|
IntegrationResultSuccess: "成功",
|
|
IntegrationResultFailed: "失败",
|
|
IntegrationResultUnknown: "结果未知",
|
|
IntegrationResultNotFound: "未找到",
|
|
IntegrationResultInvalidPayload: "无效载荷",
|
|
IntegrationResultConflict: "冲突",
|
|
IntegrationResultIgnored: "已忽略",
|
|
IntegrationResultMerged: "已合并",
|
|
IntegrationResultRateLimited: "已限频",
|
|
IntegrationResultCompleted: "已提前完成",
|
|
IntegrationResultCancelled: "已取消",
|
|
}
|
|
return names[result]
|
|
}
|