feat: 卡实名时间以上游 archiveTime 为准并记录实名时间历史,新增二次实名批次
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

This commit is contained in:
邹进
2026-11-08 19:12:46 +09:00
parent 94f86ab217
commit 4967f4df43
32 changed files with 1885 additions and 47 deletions

View File

@@ -0,0 +1,25 @@
package gateway
import (
"strings"
"time"
)
// upstreamLocation 是上游时间字段的时区(北京时间,固定 +08:00,不依赖系统时区数据库)。
var upstreamLocation = time.FixedZone("CST", 8*3600)
var upstreamTimeLayouts = []string{"2006-01-02 15:04:05", "2006-01-02T15:04:05", "2006/01/02 15:04:05"}
// parseUpstreamTime 按北京时间解析上游时间字符串,空或无法解析返回 nil。
func parseUpstreamTime(raw string) *time.Time {
value := strings.TrimSpace(raw)
if value == "" || strings.EqualFold(value, "null") {
return nil
}
for _, layout := range upstreamTimeLayouts {
if parsed, err := time.ParseInLocation(layout, value, upstreamLocation); err == nil {
return &parsed
}
}
return nil
}