feat: add wechat pay
This commit is contained in:
15
backend/pkg/utils/order.go
Normal file
15
backend/pkg/utils/order.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// GenerateOrderSerial generate order serial
|
||||
func GenerateOrderSerial(prefix string) string {
|
||||
timestamp := time.Now().Format("20060102150405")
|
||||
randomSuffix := rand.Intn(10000)
|
||||
return fmt.Sprintf("%s%s%04d", strings.ToUpper(prefix), timestamp, randomSuffix)
|
||||
}
|
||||
Reference in New Issue
Block a user