All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m19s
52 lines
2.2 KiB
Go
52 lines
2.2 KiB
Go
package constants
|
|
|
|
const (
|
|
// IntegrationDirectionInbound 表示外部系统调用本系统。
|
|
IntegrationDirectionInbound = "inbound"
|
|
// IntegrationDirectionOutbound 表示本系统调用外部系统。
|
|
IntegrationDirectionOutbound = "outbound"
|
|
)
|
|
|
|
const (
|
|
// IntegrationResultPending 表示外部尝试已建立但尚未终结。
|
|
IntegrationResultPending = "pending"
|
|
// IntegrationResultSuccess 表示外部尝试成功。
|
|
IntegrationResultSuccess = "success"
|
|
// IntegrationResultFailed 表示外部尝试明确失败。
|
|
IntegrationResultFailed = "failed"
|
|
// IntegrationResultUnknown 表示请求已发出但结果未知,需要按记录的策略恢复。
|
|
IntegrationResultUnknown = "unknown"
|
|
// IntegrationResultNotFound 表示外部资源不存在。
|
|
IntegrationResultNotFound = "not_found"
|
|
// IntegrationResultInvalidPayload 表示入站载荷无效。
|
|
IntegrationResultInvalidPayload = "invalid_payload"
|
|
// 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: "无效载荷",
|
|
IntegrationResultIgnored: "已忽略",
|
|
IntegrationResultMerged: "已合并",
|
|
IntegrationResultRateLimited: "已限频",
|
|
IntegrationResultCompleted: "已提前完成",
|
|
IntegrationResultCancelled: "已取消",
|
|
}
|
|
return names[result]
|
|
}
|