支付模块重构完成

This commit is contained in:
RockYang
2025-08-30 16:27:39 +08:00
parent 3a6f8ccc16
commit 3c065b99fb
17 changed files with 661 additions and 317 deletions

View File

@@ -17,8 +17,9 @@ import (
"time"
"unicode"
"golang.org/x/crypto/sha3"
rand2 "math/rand"
"golang.org/x/crypto/sha3"
)
// RandString generate rand string with specified length
@@ -72,7 +73,16 @@ func Str2stamp(str string) int64 {
return 0
}
layout := "2006-01-02 15:04:05"
var layout string
if strings.Contains(str, "T") {
layout = "2006-01-02T15:04:05-07:00"
} else {
if len(str) < 12 {
str = str + " 00:00:00"
}
layout = "2006-01-02 15:04:05"
}
t, err := time.ParseInLocation(layout, str, time.Local)
if err != nil {
return 0