add random pay
This commit is contained in:
parent
425c0eddc9
commit
e3adc95d15
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -31,6 +32,8 @@ func main() {
|
|||
logger.Recover()
|
||||
}()
|
||||
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
// 加载配置
|
||||
// 1.默认配置
|
||||
configPath := consts.ProductionConfigPath
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/go-pay/gopay"
|
||||
"github.com/go-pay/gopay/alipay"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"service/bizcommon/util"
|
||||
"service/library/configcenter"
|
||||
|
@ -26,6 +27,10 @@ const (
|
|||
var allAlipayClients = map[string]*AlipayClient{}
|
||||
|
||||
func GetDefaultAlipayClient() *AlipayClient {
|
||||
rate := rand.Intn(100)
|
||||
if rate < 50 {
|
||||
return allAlipayClients[AppIdMiYuanTianShi]
|
||||
}
|
||||
return allAlipayClients[AppIdLanXing01]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue